# VirtualHostedStyleUrlOptions

Options for creating Virtual-Hosted style URL.

Used as argument in: [IAccessPoint.virtualHostedUrlForObject](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-s3objectlambda-alpha.IAccessPoint.html#virtualhostedurlforobject), IBucket.virtualHostedUrlForObject

- Source: [`aws-s3/lib/bucket.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-s3/lib/bucket.ts#L4011)

## Example

TypeScript:

```ts
const bucket = new s3.Bucket(this, 'MyBucket');
bucket.urlForObject('objectname'); // Path-Style URL
bucket.virtualHostedUrlForObject('objectname'); // Virtual Hosted-Style URL
bucket.virtualHostedUrlForObject('objectname', { regional: false }); // Virtual Hosted-Style URL but non-regional
```

Python:

```python
bucket = s3.Bucket(self, "MyBucket")
bucket.url_for_object("objectname") # Path-Style URL
bucket.virtual_hosted_url_for_object("objectname") # Virtual Hosted-Style URL
bucket.virtual_hosted_url_for_object("objectname", regional=False)
```

Java:

```java
Bucket bucket = new Bucket(this, "MyBucket");
bucket.urlForObject("objectname"); // Path-Style URL
bucket.virtualHostedUrlForObject("objectname"); // Virtual Hosted-Style URL
bucket.virtualHostedUrlForObject("objectname", VirtualHostedStyleUrlOptions.builder().regional(false).build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var bucket = new Bucket(this, "MyBucket");
bucket.UrlForObject("objectname"); // Path-Style URL
bucket.VirtualHostedUrlForObject("objectname"); // Virtual Hosted-Style URL
bucket.VirtualHostedUrlForObject("objectname", new VirtualHostedStyleUrlOptions { Regional = false });
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
bucket := s3.NewBucket(this, jsii.String("MyBucket"))
bucket.UrlForObject(jsii.String("objectname")) // Path-Style URL
bucket.VirtualHostedUrlForObject(jsii.String("objectname")) // Virtual Hosted-Style URL
bucket.VirtualHostedUrlForObject(jsii.String("objectname"), &VirtualHostedStyleUrlOptions{
	Regional: jsii.Boolean(false),
})
```

## Properties

- `regional`: boolean = true — Specifies the URL includes the region.
