Skip to content

Commit f12c8d1

Browse files
authored
Merge branch 'aws:main' into ecs_blue_green_l2
2 parents 9e73d77 + 49b2627 commit f12c8d1

39 files changed

+65752
-6
lines changed

CHANGELOG.v2.alpha.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.208.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.207.0-alpha.0...v2.208.0-alpha.0) (2025-07-29)
6+
7+
8+
### Features
9+
10+
* **glue:** throw ValidationError instead of untyped errors ([#35084](https://github.com/aws/aws-cdk/issues/35084)) ([1e20df6](https://github.com/aws/aws-cdk/commit/1e20df640dfe1ddfd082d459fc9ff5e063b1a95c))
11+
512
## [2.207.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.206.0-alpha.0...v2.207.0-alpha.0) (2025-07-24)
613

714
## [2.206.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.205.0-alpha.0...v2.206.0-alpha.0) (2025-07-16)

CHANGELOG.v2.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.208.0](https://github.com/aws/aws-cdk/compare/v2.207.0...v2.208.0) (2025-07-29)
6+
7+
8+
### Features
9+
10+
* update L1 CloudFormation resource definitions ([#35054](https://github.com/aws/aws-cdk/issues/35054)) ([a2b3e78](https://github.com/aws/aws-cdk/commit/a2b3e788fdedff02ce2abd8998c37d4da5a5dc2d))
11+
* **region-info:** add support for region ap-southeast-6 ([#35036](https://github.com/aws/aws-cdk/pull/35036))
12+
13+
14+
### Bug Fixes
15+
16+
* **core:** `Tag must have a value` error is impossible to attribute to a specific tag ([#35091](https://github.com/aws/aws-cdk/issues/35091)) ([6c4181b](https://github.com/aws/aws-cdk/commit/6c4181bbe1c28b8080ba5f12716ad91475b2b3f5))
17+
* **custom-resources:** use loggingFormat instead of deprecated logFormat ([#35015](https://github.com/aws/aws-cdk/issues/35015)) ([81fe660](https://github.com/aws/aws-cdk/commit/81fe66029bba42135143874072f16387f7edc741)), closes [#35002](https://github.com/aws/aws-cdk/issues/35002)
18+
* **logs:** query strings can have multiple stats commands ([#34590](https://github.com/aws/aws-cdk/issues/34590)) ([57ae6f9](https://github.com/aws/aws-cdk/commit/57ae6f92949623d93c73ff23057291ba0f5eb95b)), closes [#34578](https://github.com/aws/aws-cdk/issues/34578) [#34578](https://github.com/aws/aws-cdk/issues/34578)
19+
* **logs:** revert "exposed metric from the metric filter will now include the dimension map ([#34648](https://github.com/aws/aws-cdk/issues/34648))" ([#35102](https://github.com/aws/aws-cdk/issues/35102)) ([24bbced](https://github.com/aws/aws-cdk/commit/24bbced7e67ec6265713cf46c51b110f38b6cf7d)), closes [#35097](https://github.com/aws/aws-cdk/issues/35097)
20+
521
## [2.207.0](https://github.com/aws/aws-cdk/compare/v2.206.0...v2.207.0) (2025-07-24)
622

723

DEPRECATED_APIs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
| Module | API Element | Message |
44
|--------|-------------|---------|
5+
| aws-cdk-lib/aws-route53 | RecordSetOptions.​deleteExisting | This property is dangerous and can lead to unintended record deletion in case of deployment failure.|
56
| @aws-cdk/core | AppProps.​runtimeInfo | use `versionReporting` instead |
67
| @aws-cdk/core | Arn.​parse() | use split instead |
78
| @aws-cdk/core | ArnComponents.​sep | use arnFormat instead |

packages/@aws-cdk/aws-s3tables-alpha/README.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,59 @@ const sampleTableBucket = new TableBucket(scope, 'ExampleTableBucket', {
3939
});
4040
```
4141

42+
### Define an S3 Tables Namespace
43+
44+
```ts
45+
// Build a namespace
46+
const sampleNamespace = new Namespace(scope, 'ExampleNamespace', {
47+
namespaceName: 'example-namespace-1',
48+
tableBucket: tableBucket,
49+
});
50+
```
51+
52+
### Define an S3 Table
53+
54+
```ts
55+
// Build a table
56+
const sampleTable = new Table(scope, 'ExampleTable', {
57+
tableName: 'example_table',
58+
namespace: namespace,
59+
openTableFormat: OpenTableFormat.ICEBERG,
60+
withoutMetadata: true,
61+
});
62+
63+
// Build a table with an Iceberg Schema
64+
const sampleTableWithSchema = new Table(scope, 'ExampleSchemaTable', {
65+
tableName: 'example_table_with_schema',
66+
namespace: namespace,
67+
openTableFormat: OpenTableFormat.ICEBERG,
68+
icebergMetadata: {
69+
icebergSchema: {
70+
schemaFieldList: [
71+
{
72+
name: 'id',
73+
type: 'int',
74+
required: true,
75+
},
76+
{
77+
name: 'name',
78+
type: 'string',
79+
},
80+
],
81+
},
82+
},
83+
compaction: {
84+
status: Status.ENABLED,
85+
targetFileSizeMb: 128,
86+
},
87+
snapshotManagement: {
88+
status: Status.ENABLED,
89+
maxSnapshotAgeHours: 48,
90+
minSnapshotsToKeep: 5,
91+
},
92+
});
93+
```
94+
4295
Learn more about table buckets maintenance operations and default behavior from the [S3 Tables User Guide](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-table-buckets-maintenance.html)
4396

4497
### Controlling Table Bucket Permissions
@@ -110,5 +163,5 @@ const encryptedBucketAuto = new TableBucket(scope, 'EncryptedTableBucketAuto', {
110163

111164
L2 Construct support for:
112165

113-
- Namespaces
114-
- Tables
166+
- Table Policy
167+
- KMS encryption support for Tables

packages/@aws-cdk/aws-s3tables-alpha/lib/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55

66
export * from './table-bucket';
77
export * from './table-bucket-policy';
8+
export * from './namespace';
9+
export * from './table';
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
import { Construct } from 'constructs';
2+
import { IResource, RemovalPolicy, Resource, Token, UnscopedValidationError } from 'aws-cdk-lib/core';
3+
import { ITableBucket } from './table-bucket';
4+
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';
5+
import { CfnNamespace } from 'aws-cdk-lib/aws-s3tables';
6+
import { EOL } from 'os';
7+
8+
/**
9+
* Represents an S3 Tables Namespace.
10+
*/
11+
export interface INamespace extends IResource {
12+
/**
13+
* The name of this namespace
14+
* @attribute
15+
*/
16+
readonly namespaceName: string;
17+
18+
/**
19+
* The table bucket which this namespace belongs to
20+
* @attribute
21+
*/
22+
readonly tableBucket: ITableBucket;
23+
}
24+
25+
/**
26+
* Parameters for constructing a Namespace
27+
*/
28+
export interface NamespaceProps {
29+
/**
30+
* A name for the namespace
31+
*/
32+
readonly namespaceName: string;
33+
/**
34+
* The table bucket this namespace belongs to.
35+
*/
36+
readonly tableBucket: ITableBucket;
37+
/**
38+
* Policy to apply when the policy is removed from this stack.
39+
* @default RemovalPolicy.DESTROY
40+
*/
41+
readonly removalPolicy?: RemovalPolicy;
42+
}
43+
44+
/**
45+
* Attributes for importing an existing namespace
46+
*/
47+
export interface NamespaceAttributes {
48+
/**
49+
* The name of the namespace
50+
*/
51+
readonly namespaceName: string;
52+
53+
/**
54+
* The table bucket this namespace belongs to
55+
*/
56+
readonly tableBucket: ITableBucket;
57+
}
58+
59+
/**
60+
* An S3 Tables Namespace with helpers.
61+
*
62+
* A namespace is a logical container for tables within a table bucket.
63+
*/
64+
export class Namespace extends Resource implements INamespace {
65+
/**
66+
* Import an existing namespace from its attributes
67+
*/
68+
public static fromNamespaceAttributes(scope: Construct, id: string, attrs: NamespaceAttributes): INamespace {
69+
class Import extends Resource implements INamespace {
70+
public readonly namespaceName = attrs.namespaceName;
71+
public readonly tableBucket = attrs.tableBucket;
72+
}
73+
74+
return new Import(scope, id);
75+
}
76+
/**
77+
* See https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-naming.html
78+
* @param namespaceName Name of the namespace
79+
* @throws UnscopedValidationError if any naming errors are detected
80+
*/
81+
public static validateNamespaceName(namespaceName: string) {
82+
if (namespaceName == undefined || Token.isUnresolved(namespaceName)) {
83+
// the name is a late-bound value, not a defined string, so skip validation
84+
return;
85+
}
86+
87+
const errors: string[] = [];
88+
89+
// Length validation
90+
if (namespaceName.length < 1 || namespaceName.length > 255) {
91+
errors.push(
92+
'Namespace name must be at least 1 and no more than 255 characters',
93+
);
94+
}
95+
96+
// Character set validation
97+
const illegalCharsetRegEx = /[^a-z0-9_]/;
98+
const allowedEdgeCharsetRegEx = /[a-z0-9]/;
99+
100+
const illegalCharMatch = namespaceName.match(illegalCharsetRegEx);
101+
if (illegalCharMatch) {
102+
errors.push(
103+
'Namespace name must only contain lowercase characters, numbers, and underscores (_)' +
104+
` (offset: ${illegalCharMatch.index})`,
105+
);
106+
}
107+
108+
// Edge character validation
109+
if (!allowedEdgeCharsetRegEx.test(namespaceName.charAt(0))) {
110+
errors.push(
111+
'Namespace name must start with a lowercase letter or number (offset: 0)',
112+
);
113+
}
114+
if (
115+
!allowedEdgeCharsetRegEx.test(namespaceName.charAt(namespaceName.length - 1))
116+
) {
117+
errors.push(
118+
`Namespace name must end with a lowercase letter or number (offset: ${
119+
namespaceName.length - 1
120+
})`,
121+
);
122+
}
123+
124+
if (namespaceName.startsWith('aws')) {
125+
errors.push('Namespace name must not start with reserved prefix \'aws\'');
126+
}
127+
128+
if (errors.length > 0) {
129+
throw new UnscopedValidationError(
130+
`Invalid S3 Tables namespace name (value: ${namespaceName})${EOL}${errors.join(EOL)}`,
131+
);
132+
}
133+
}
134+
135+
/**
136+
* @internal The underlying namespace resource.
137+
*/
138+
private readonly _resource: CfnNamespace;
139+
140+
/**
141+
* The name of this namespace
142+
*/
143+
public readonly namespaceName: string;
144+
145+
/**
146+
* The table bucket which this namespace belongs to
147+
*/
148+
public readonly tableBucket: ITableBucket;
149+
150+
constructor(scope: Construct, id: string, props: NamespaceProps) {
151+
super(scope, id);
152+
// Enhanced CDK Analytics Telemetry
153+
addConstructMetadata(this, props);
154+
155+
Namespace.validateNamespaceName(props.namespaceName);
156+
157+
this.tableBucket = props.tableBucket;
158+
this.namespaceName = props.namespaceName;
159+
this._resource = new CfnNamespace(this, id, {
160+
namespace: props.namespaceName,
161+
tableBucketArn: this.tableBucket.tableBucketArn,
162+
});
163+
164+
if (props.removalPolicy) {
165+
this._resource.applyRemovalPolicy(props.removalPolicy);
166+
}
167+
}
168+
}

0 commit comments

Comments
 (0)