# BucketNamespace

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`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-s3/lib/bucket.ts#L1776)
- Type last changed: v2.256.0 · 20 May 2026

## 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
```

## 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`](/v2/docs/aws-cdk-lib.aws_s3.BucketProps).bucketNamespace
