BucketNamespace Enum
The namespace for the bucket name when using bucketNamePrefix.
Determines how CloudFormation generates the unique portion of the bucket name.
| Source | aws-s3/lib/bucket.ts |
|---|---|
| Type last changed |
Example
ts
new s3.Bucket(this, 'MyBucket', {
bucketNamePrefix: 'my-app',
bucketNamespace: s3.BucketNamespace.ACCOUNT_REGIONAL,
});
// Resulting bucket name: my-app-123456789012-us-east-1-an
python
s3.Bucket(self, "MyBucket",
bucket_name_prefix="my-app",
bucket_namespace=s3.BucketNamespace.ACCOUNT_REGIONAL
)
java
Bucket.Builder.create(this, "MyBucket")
.bucketNamePrefix("my-app")
.bucketNamespace(BucketNamespace.ACCOUNT_REGIONAL)
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
new Bucket(this, "MyBucket", new BucketProps {
BucketNamePrefix = "my-app",
BucketNamespace = BucketNamespace.ACCOUNT_REGIONAL
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
s3.NewBucket(this, jsii.String("MyBucket"), &BucketProps{
BucketNamePrefix: jsii.String("my-app"),
BucketNamespace: s3.BucketNamespace_ACCOUNT_REGIONAL,
})
Members
| Member | Description |
|---|---|
GLOBAL | The bucket name is globally unique. |
ACCOUNT_REGIONAL | The bucket name is unique within the account and region. |
Referenced by
BucketProps.bucketNamespacebucket_namespacebucketNamespaceBucketNamespaceBucketNamespace