Skip to content

Commit 195df6d

Browse files
authored
Merge branch 'main' into feat/eks-cluster-oidc-provider-36684
2 parents 16b71cb + 3462233 commit 195df6d

File tree

32 files changed

+1004
-192
lines changed

32 files changed

+1004
-192
lines changed

CHANGELOG.v2.alpha.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
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.236.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.235.1-alpha.0...v2.236.0-alpha.0) (2026-01-23)
6+
7+
8+
### Features
9+
10+
* **bedrock-agentcore-alpha:** added episodic memory strategy ([#36591](https://github.com/aws/aws-cdk/issues/36591)) ([21dcfc6](https://github.com/aws/aws-cdk/commit/21dcfc6807a3876e2275bdac6f1e4f7564a66100))
11+
* **bedrock-agentcore-alpha:** added gateway interceptors ([#36604](https://github.com/aws/aws-cdk/issues/36604)) ([ba8aa48](https://github.com/aws/aws-cdk/commit/ba8aa48a33b1e008194d6b6b13d10c41019f56b4))
12+
* **bedrock-agentcore-alpha:** make physical name properties optional for AgentCore resources ([#36354](https://github.com/aws/aws-cdk/issues/36354)) ([5137d81](https://github.com/aws/aws-cdk/commit/5137d811a92eb63f52d2bfa0713a660f5476839e)), closes [#36341](https://github.com/aws/aws-cdk/issues/36341)
13+
* **mixins-preview:** expose `BucketPolicyStatementsMixin` publicly ([#36771](https://github.com/aws/aws-cdk/issues/36771)) ([458156d](https://github.com/aws/aws-cdk/commit/458156dd43ced89c893687415d7c2a2fce141653))
14+
* **sagemaker:** add containerStartupHealthCheckTimeoutInSeconds support for EndpointConfig ([#35626](https://github.com/aws/aws-cdk/issues/35626)) ([47d707a](https://github.com/aws/aws-cdk/commit/47d707aac809fda8ec5302bf927380e8060d380a)), closes [#35566](https://github.com/aws/aws-cdk/issues/35566)
15+
16+
### Bug Fixes
17+
18+
* **eks-v2-alpha:** ensure kubectl provider access entry is depended upon by downstream resources ([#36734](https://github.com/aws/aws-cdk/issues/36734)) ([e104f45](https://github.com/aws/aws-cdk/commit/e104f45654177e87e2fb46510f77d02fcf20c499)), closes [#34898](https://github.com/aws/aws-cdk/issues/34898) [#34897](https://github.com/aws/aws-cdk/issues/34897)
19+
520
## [2.235.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.235.0-alpha.0...v2.235.1-alpha.0) (2026-01-19)
621

722
## [2.235.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.234.1-alpha.0...v2.235.0-alpha.0) (2026-01-15)

CHANGELOG.v2.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
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.236.0](https://github.com/aws/aws-cdk/compare/v2.235.1...v2.236.0) (2026-01-23)
6+
7+
8+
### Features
9+
10+
* update L1 CloudFormation resource definitions ([#36721](https://github.com/aws/aws-cdk/issues/36721)) ([7a4a443](https://github.com/aws/aws-cdk/commit/7a4a44329d7b71a12ba566885aa5fd730c0c2475))
11+
* **ecs:** add capacityOptionType (Spot support) to ManagedInstancesCapacityProvider L2 construct ([#36497](https://github.com/aws/aws-cdk/issues/36497)) ([e8ad85b](https://github.com/aws/aws-cdk/commit/e8ad85b3122e8c84e19adf0ffdfd71d79ba090f9)), closes [#35648](https://github.com/aws/aws-cdk/issues/35648)
12+
* **ecs:** add built-in Linear and Canary deployments ([#35981](https://github.com/aws/aws-cdk/issues/35981)) ([67ac5e7](https://github.com/aws/aws-cdk/commit/67ac5e7685e6eb8993e49aa010e43d8002998498)), closes [#35986](https://github.com/aws/aws-cdk/issues/35986) [#35987](https://github.com/aws/aws-cdk/issues/35987)
13+
* **logs:** add support for deletion protection configuration ([#36583](https://github.com/aws/aws-cdk/issues/36583)) ([c4d1389](https://github.com/aws/aws-cdk/commit/c4d13895339ef44ffc4cd6f86d80014a8d33a3f6)), closes [#36554](https://github.com/aws/aws-cdk/issues/36554) [#36554](https://github.com/aws/aws-cdk/issues/36554)
14+
15+
16+
### Bug Fixes
17+
18+
* **apigatewayv2:** use custom domain name instead of regional domain name when importing domain name via fromDomainNameAttributes ([#36710](https://github.com/aws/aws-cdk/issues/36710)) ([fe6eb0b](https://github.com/aws/aws-cdk/commit/fe6eb0b9130953d5ff35bd05b643253f9b6c3247))
19+
* **batch:** undeprecate useOptimalInstanceClasses property ([#36353](https://github.com/aws/aws-cdk/issues/36353)) ([3485d53](https://github.com/aws/aws-cdk/commit/3485d5399b6cfebc3461247643d4866242311152)), closes [#36291](https://github.com/aws/aws-cdk/issues/36291) [#36291](https://github.com/aws/aws-cdk/issues/36291)
20+
* **core:** resources allocate unnecessary string tokens upon instantiation ([#36692](https://github.com/aws/aws-cdk/issues/36692)) ([59d4928](https://github.com/aws/aws-cdk/commit/59d49286f656a5341e907d298f30decbc8959bcf))
21+
* **core:** tree.json unintentionally includes telemetry metadata ([#36748](https://github.com/aws/aws-cdk/issues/36748)) ([87fd86b](https://github.com/aws/aws-cdk/commit/87fd86be736b24ab18ea2ee7a2c96b724a67c903))
22+
* **scheduler:** scheduleName returns undefined when imported from ARN ([#36400](https://github.com/aws/aws-cdk/issues/36400)) ([752bd9b](https://github.com/aws/aws-cdk/commit/752bd9b7c31d027be6918cd7c8ebddb4b3d29e77)), closes [#36361](https://github.com/aws/aws-cdk/issues/36361)
23+
* recent change to IAlarmAction breaks too many implementors ([#36695](https://github.com/aws/aws-cdk/issues/36695)) ([0c5b0db](https://github.com/aws/aws-cdk/commit/0c5b0dbb08bd1bc965067e1fbe7b2ec7e82e697b))
24+
525
## [2.235.1](https://github.com/aws/aws-cdk/compare/v2.235.0...v2.235.1) (2026-01-19)
626

727

CONTRIBUTING.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -988,37 +988,37 @@ finalized, will be added to the AWS CDK with a specific suffix: `BetaX`. APIs
988988
with the preview suffix will never be removed, instead they will be deprecated
989989
and replaced by either the stable version (without the suffix), or by a newer
990990
preview version. For example, assume we add the method
991-
`grantAwesomePowerBeta1`:
991+
`addSecondaryResourceBeta1()` to a class:
992992

993993
```ts
994994
/**
995-
* This method grants awesome powers
995+
* This method adds a secondary resource to the main one
996996
*/
997-
grantAwesomePowerBeta1();
997+
addSecondaryResourceBeta1(res: SomeResource);
998998
```
999999

10001000
Times goes by, we get feedback that this method will actually be much better
1001-
if it accepts a `Principal`. Since adding a required property is a breaking
1002-
change, we will add `grantAwesomePowerBeta2()` and deprecate
1003-
`grantAwesomePowerBeta1`:
1001+
if it accepts an additional required `options` parameter. Since adding a required
1002+
parameter to a method is a breaking change, we will add `addSecondaryResourceBeta2()`
1003+
and deprecate `addSecondaryResourceBeta1`:
10041004

10051005
```ts
10061006
/**
1007-
* This method grants awesome powers to the given principal
1007+
* This method adds a secondary resource, with more options
10081008
*
10091009
* @param grantee The principal to grant powers to
10101010
*/
1011-
grantAwesomePowerBeta2(grantee: iam.IGrantable)
1011+
addSecondaryResourceBeta2(res: SomeResource, options: SecondaryResourceOptions);
10121012

10131013
/**
1014-
* This method grants awesome powers
1015-
* @deprecated use grantAwesomePowerBeta2
1014+
* This method adds a secondary resource to the main one
1015+
* @deprecated use addSecondaryResourceBeta1
10161016
*/
1017-
grantAwesomePowerBeta1()
1017+
addSecondaryResourceBeta1(res: SomeResource);
10181018
```
10191019

10201020
When we decide it's time to graduate the API, the latest preview version will
1021-
be deprecated and the final version - `grantAwesomePower` will be added.
1021+
be deprecated and the final version - `addSecondaryResource` will be added.
10221022

10231023
## Documentation
10241024

allowed-breaking-changes.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4142,3 +4142,12 @@ changed-type:aws-cdk-lib.aws_ses.EventDestination.bus
41424142
# CloudFormation has always required SecurityGroups for ManagedInstancesCapacityProvider.
41434143
# Making it required in TypeScript catches the error at compile time instead of deploy time.
41444144
strengthened:aws-cdk-lib.aws_ecs.ManagedInstancesCapacityProviderProps
4145+
4146+
# IEncryptedResource was too strongly typed for practical use.
4147+
# We need to weaken it and align with other traits.
4148+
# See: https://github.com/aws/aws-cdk/pull/36787
4149+
incompatible-argument:aws-cdk-lib.aws_iam.GrantableResources.isEncryptedResource
4150+
base-types:aws-cdk-lib.aws_iam.IEncryptedResource
4151+
removed:aws-cdk-lib.aws_iam.IEncryptedResource.applyRemovalPolicy
4152+
removed:aws-cdk-lib.aws_iam.IEncryptedResource.node
4153+
removed:aws-cdk-lib.aws_iam.IEncryptedResource.stack

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ declare const role: iam.Role;
397397

398398
// grant "elasticache:Connect" action permissions to role
399399
user.grantConnect(role);
400-
serverlessCache.grantConnect(role);
400+
serverlessCache.grants.connect(role);
401401
```
402402

403403
### Import an existing user and user group

packages/@aws-cdk/mixins-preview/lib/mixins/private/reflections.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { IConstruct } from 'constructs';
22
import { CfnResource } from 'aws-cdk-lib/core';
3-
import type { IBucketRef, CfnBucketPolicy } from 'aws-cdk-lib/aws-s3';
3+
import { type IBucketRef, type CfnBucketPolicy, CfnBucket } from 'aws-cdk-lib/aws-s3';
44
import { CfnDeliverySource } from 'aws-cdk-lib/aws-logs';
55
import { CfnKey, IKeyRef } from 'aws-cdk-lib/aws-kms';
66

@@ -99,6 +99,24 @@ export function tryFindDeliverySourceForResource(source: IConstruct, sourceArn:
9999
);
100100
}
101101

102+
export function tryFindKmsKeyforBucket(bucket: IBucketRef): CfnKey | undefined {
103+
const cfnBucket = tryFindBucketConstruct(bucket);
104+
const kmsMasterKeyId = cfnBucket && Array.isArray((cfnBucket.bucketEncryption as
105+
CfnBucket.BucketEncryptionProperty)?.serverSideEncryptionConfiguration) ?
106+
(((cfnBucket.bucketEncryption as CfnBucket.BucketEncryptionProperty).serverSideEncryptionConfiguration as
107+
CfnBucket.ServerSideEncryptionRuleProperty[])[0]?.serverSideEncryptionByDefault as
108+
CfnBucket.ServerSideEncryptionByDefaultProperty)?.kmsMasterKeyId
109+
: undefined;
110+
if (!kmsMasterKeyId) {
111+
return undefined;
112+
}
113+
return findClosestRelatedResource<IConstruct, CfnKey>(
114+
bucket,
115+
'AWS::KMS::Key',
116+
(_, key) => key.ref === kmsMasterKeyId || key.attrKeyId === kmsMasterKeyId || key.attrArn === kmsMasterKeyId,
117+
);
118+
}
119+
102120
/**
103121
* Attempts to find the L1 CfnResource for a given Ref interface.
104122
* Searches children first (for L2 wrappers), then the construct tree.
@@ -144,3 +162,11 @@ export function tryFindKmsKeyConstruct(kmsKey: IKeyRef): CfnKey | undefined {
144162
(cfn, ref) => ref.keyRef === cfn.keyRef,
145163
);
146164
}
165+
166+
export function tryFindBucketConstruct(bucket: IBucketRef): CfnBucket | undefined {
167+
return findL1FromRef<IBucketRef, CfnBucket>(
168+
bucket,
169+
'AWS::S3::Bucket',
170+
(cfn, ref) => ref.bucketRef == cfn.bucketRef,
171+
);
172+
}

packages/@aws-cdk/mixins-preview/lib/services/aws-logs/logs-delivery.ts

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import { Names, Stack, Tags } from 'aws-cdk-lib/core';
1+
import { Aws, Names, Stack, Tags } from 'aws-cdk-lib/core';
22
import { Effect, PolicyStatement, ServicePrincipal } from 'aws-cdk-lib/aws-iam';
33
import * as logs from 'aws-cdk-lib/aws-logs';
44
import * as s3 from 'aws-cdk-lib/aws-s3';
55
import { Construct, type IConstruct } from 'constructs';
66
import type { IDeliveryStreamRef } from 'aws-cdk-lib/aws-kinesisfirehose';
7-
import { tryFindBucketPolicyForBucket, tryFindDeliverySourceForResource } from '../../mixins/private/reflections';
7+
import { tryFindBucketPolicyForBucket, tryFindDeliverySourceForResource, tryFindKmsKeyConstruct, tryFindKmsKeyforBucket } from '../../mixins/private/reflections';
88
import { ConstructSelector, Mixins } from '../../core';
99
import * as xray from '../aws-xray/policy';
1010
import { BucketPolicyStatementsMixin } from '../aws-s3/bucket-policy';
11+
import { CfnKey, IKeyRef } from 'aws-cdk-lib/aws-kms';
1112

1213
/**
1314
* The individual elements of a logs delivery integration.
@@ -55,6 +56,18 @@ export enum S3LogsDeliveryPermissionsVersion {
5556
V2 = 'V2',
5657
}
5758

59+
/**
60+
* Properties for S3 logs destination configuration.
61+
*/
62+
export interface IS3LogsDestinationProps {
63+
/**
64+
* KMS key to use for encrypting logs in the S3 bucket.
65+
*
66+
* @default - No encryption key is configured
67+
*/
68+
readonly encryptionKey?: IKeyRef;
69+
}
70+
5871
/**
5972
* Props for S3LogsDelivery
6073
*/
@@ -66,6 +79,13 @@ export interface S3LogsDeliveryProps {
6679
* @default "V2"
6780
*/
6881
readonly permissionsVersion?: S3LogsDeliveryPermissionsVersion;
82+
/**
83+
* KMS key to use for encrypting logs in the S3 bucket.
84+
* When provided, grants the logs delivery service permissions to use the key.
85+
*
86+
* @default - No encryption key is configured
87+
*/
88+
readonly kmsKey?: IKeyRef;
6989
}
7090

7191
/**
@@ -74,13 +94,15 @@ export interface S3LogsDeliveryProps {
7494
export class S3LogsDelivery implements ILogsDelivery {
7595
private readonly bucket: s3.IBucketRef;
7696
private readonly permissions: S3LogsDeliveryPermissionsVersion;
97+
private readonly kmsKey: IKeyRef | undefined;
7798

7899
/**
79100
* Creates a new S3 Bucket delivery.
80101
*/
81102
constructor(bucket: s3.IBucketRef, props: S3LogsDeliveryProps = {}) {
82103
this.bucket = bucket;
83104
this.permissions = props.permissionsVersion ?? S3LogsDeliveryPermissionsVersion.V2;
105+
this.kmsKey = props.kmsKey;
84106
}
85107

86108
/**
@@ -95,6 +117,11 @@ export class S3LogsDelivery implements ILogsDelivery {
95117
const deliverySource = getOrCreateDeliverySource(logType, scope, sourceResourceArn);
96118
const deliverySourceRef = deliverySource.deliverySourceRef;
97119

120+
const kmsKey = this.findEncryptionKey();
121+
if (kmsKey) {
122+
this.addToEncryptionKeyPolicy(kmsKey);
123+
}
124+
98125
const deliveryDestination = new logs.CfnDeliveryDestination(container, 'Dest', {
99126
destinationResourceArn: this.bucket.bucketRef.bucketArn,
100127
name: deliveryDestName('s3', logType, container),
@@ -181,6 +208,40 @@ export class S3LogsDelivery implements ILogsDelivery {
181208
Mixins.of(policy, ConstructSelector.onlyItself())
182209
.apply(new BucketPolicyStatementsMixin(statements));
183210
}
211+
212+
private findEncryptionKey(): CfnKey | undefined {
213+
if (this.kmsKey) {
214+
return tryFindKmsKeyConstruct(this.kmsKey);
215+
}
216+
return tryFindKmsKeyforBucket(this.bucket);
217+
}
218+
219+
private addToEncryptionKeyPolicy(key: CfnKey) {
220+
const existingKeyPolicy = key.keyPolicy;
221+
const sourceArnPostfix = this.permissions === S3LogsDeliveryPermissionsVersion.V1 ? '*' : 'delivery-source:*';
222+
const sid = 'AWS CDK: Allow Logs Delivery to use the key';
223+
// Check if a statement with this SID already exists
224+
const hasDuplicateSid = existingKeyPolicy.statements.some((stmt: PolicyStatement) => stmt.sid === sid);
225+
if (hasDuplicateSid) {
226+
return;
227+
}
228+
229+
existingKeyPolicy.addStatements(new PolicyStatement({
230+
sid,
231+
effect: Effect.ALLOW,
232+
principals: [new ServicePrincipal('delivery.logs.amazonaws.com')],
233+
actions: ['kms:Encrypt', 'kms:Decrypt', 'kms:ReEncrypt*', 'kms:GenerateDataKey*', 'kms:DescribeKey'],
234+
resources: ['*'],
235+
conditions: {
236+
StringEquals: {
237+
'aws:SourceAccount': [key.env.account],
238+
},
239+
ArnLike: {
240+
'aws:SourceArn': [`arn:${Aws.PARTITION}:logs:${key.env.region}:${key.env.account}:${sourceArnPostfix}`],
241+
},
242+
},
243+
}));
244+
}
184245
}
185246

186247
/**

packages/@aws-cdk/mixins-preview/scripts/spec2logs/builder.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,17 @@ class LogsHelper extends ClassType {
153153
type: CDK_INTERFACES.IBucketRef,
154154
});
155155

156+
toS3.addParameter({
157+
name: 'props',
158+
type: MIXINS_LOGS_DELIVERY.S3LogsDestinationProps,
159+
optional: true,
160+
});
161+
156162
const permissions = this.log.permissionsVersion === 'V2' ? MIXINS_LOGS_DELIVERY.S3LogsDeliveryPermissionsVersion.V2 : MIXINS_LOGS_DELIVERY.S3LogsDeliveryPermissionsVersion.V1;
157163
toS3.addBody(stmt.block(
158164
stmt.ret(
159165
mixin.newInstance(expr.str(this.log.logType), new NewExpression(MIXINS_LOGS_DELIVERY.S3LogsDelivery, paramS3,
160-
expr.object({ permissionsVersion: permissions }))),
166+
expr.object({ permissionsVersion: permissions, kmsKey: expr.directCode('(props && props.encryptionKey) ? props.encryptionKey : undefined') }))),
161167
),
162168
));
163169
break;

packages/@aws-cdk/mixins-preview/scripts/spec2logs/helpers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class MixinsLogsDelivery extends ExternalModule {
77
public readonly XRayLogsDelivery = Type.fromName(this, 'XRayLogsDelivery');
88
public readonly ILogsDelivery = Type.fromName(this, 'ILogsDelivery');
99
public readonly S3LogsDeliveryPermissionsVersion = $T(Type.fromName(this, 'S3LogsDeliveryPermissionsVersion'));
10+
public readonly S3LogsDestinationProps = Type.fromName(this, 'IS3LogsDestinationProps');
1011
}
1112

1213
export const MIXINS_LOGS_DELIVERY = new MixinsLogsDelivery('@aws-cdk/mixins-preview/services/aws-logs');

packages/@aws-cdk/mixins-preview/test/codegen/__snapshots__/logs-delivery.test.ts.snap

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ export class CfnThingApplicationLogs {
2020
/**
2121
* Send logs to an S3 Bucket
2222
*/
23-
public toS3(bucket: interfaces.aws_s3.IBucketRef): CfnThingLogsMixin {
23+
public toS3(bucket: interfaces.aws_s3.IBucketRef, props?: logsDelivery.IS3LogsDestinationProps): CfnThingLogsMixin {
2424
{
2525
return new CfnThingLogsMixin("APPLICATION_LOGS", new logsDelivery.S3LogsDelivery(bucket, {
26-
permissionsVersion: logsDelivery.S3LogsDeliveryPermissionsVersion.V2
26+
permissionsVersion: logsDelivery.S3LogsDeliveryPermissionsVersion.V2,
27+
kmsKey: (props && props.encryptionKey) ? props.encryptionKey : undefined
2728
}));
2829
}
2930
}
@@ -58,10 +59,11 @@ export class CfnThingAccessLogs {
5859
/**
5960
* Send logs to an S3 Bucket
6061
*/
61-
public toS3(bucket: interfaces.aws_s3.IBucketRef): CfnThingLogsMixin {
62+
public toS3(bucket: interfaces.aws_s3.IBucketRef, props?: logsDelivery.IS3LogsDestinationProps): CfnThingLogsMixin {
6263
{
6364
return new CfnThingLogsMixin("ACCESS_LOGS", new logsDelivery.S3LogsDelivery(bucket, {
64-
permissionsVersion: logsDelivery.S3LogsDeliveryPermissionsVersion.V2
65+
permissionsVersion: logsDelivery.S3LogsDeliveryPermissionsVersion.V2,
66+
kmsKey: (props && props.encryptionKey) ? props.encryptionKey : undefined
6567
}));
6668
}
6769
}

0 commit comments

Comments
 (0)