Skip to content

Commit efb2174

Browse files
authored
Merge branch 'main' into yuanhaoz/update33291
2 parents 5055331 + bb4c4d2 commit efb2174

File tree

66 files changed

+757
-1483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+757
-1483
lines changed

CHANGELOG.v2.alpha.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
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.181.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.181.0-alpha.0...v2.181.1-alpha.0) (2025-02-27)
6+
7+
8+
### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES
9+
10+
* **cognito-identitypool-alpha:** Any `IdentityPool` resources deployed in versions `>=2.179.0` will now fail to deploy. You will need to delete the `IdentityPoolRoleAttachment` from your stack via the console before redeploying.
11+
12+
### Bug Fixes
13+
14+
* **cognito-identitypool-alpha:** prevent stacks from not deploying correctly ([#33609](https://github.com/aws/aws-cdk/issues/33609)) ([a1e2afe](https://github.com/aws/aws-cdk/commit/a1e2afe67cc907fa278503ebc886aa3b5bf97887)), closes [#33510](https://github.com/aws/aws-cdk/issues/33510)
15+
516
## [2.181.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.180.0-alpha.0...v2.181.0-alpha.0) (2025-02-25)
617

718

CHANGELOG.v2.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
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.181.1](https://github.com/aws/aws-cdk/compare/v2.181.0...v2.181.1) (2025-02-27)
6+
57
## [2.181.0](https://github.com/aws/aws-cdk/compare/v2.180.0...v2.181.0) (2025-02-25)
68

79

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ this capability, please see the [developer guide](https://docs.aws.amazon.com/cd
155155

156156
## More Resources
157157

158-
* [CDK Workshop](https://cdkworkshop.com/)
158+
* [AWS CDK Immersion Day Workshop](https://catalog.us-east-1.prod.workshops.aws/workshops/10141411-0192-4021-afa8-2436f3c66bd8/en-US)
159159
* [Construct Hub](https://constructs.dev) - Find and use open-source Cloud Development Kit (CDK) libraries
160160
* Best Practices
161161
* [Best practices for developing cloud applications with AWS CDK](https://aws.amazon.com/blogs/devops/best-practices-for-developing-cloud-applications-with-aws-cdk/)

ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ To make the CDK more accessible and easier to understand, we publish educational
138138
- [Blog] [How the PGA Tour speeds up development with the AWS CDK](https://aws.amazon.com/blogs/devops/driving-development-forward-how-the-pga-tour-speeds-up-development-with-the-aws-cdk/)
139139
- [Workshop/Livestream] [CDK Workshop Series on CDK Live!](https://youtube.com/playlist?list=PLp1wJE9SAACOLvdtKL2P2Kq_N_AiYIj8N&si=hH14gEVmM_35xivq)
140140
- [Livestream] [Learn how to build and publish AWS CDK Constructs](https://www.youtube.com/live/kUfSoFy4Mgg?si=aDMMacUT3lq6ZeKw)
141-
- [Workshop] [The AWS CDK Workshop](https://cdkworkshop.com/)
141+
- [Workshop] [AWS CDK Immersion Day Workshop](https://catalog.us-east-1.prod.workshops.aws/workshops/10141411-0192-4021-afa8-2436f3c66bd8/en-US)
142142
- [Workshop] [Extended CDK Workshop](https://catalog.us-east-1.prod.workshops.aws/workshops/071bbc60-6c1f-47b6-8c66-e84f5dc96b3f/en-US)
143143
- [Workshop] [Automating your workload deployments in AWS Local Zones](https://catalog.workshops.aws/localzone-cdk/en-US)
144144
- [Blogpost] [Using AWS CloudFormation and AWS Cloud Development Kit to provision multicloud resources](https://aws.amazon.com/blogs/devops/using-aws-cloudformation-and-aws-cloud-development-kit-to-provision-multicloud-resources/)

allowed-breaking-changes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ change-return-type:@aws-cdk/cloud-assembly-schema.Manifest.load
66
# Adding any new context queries will add to the ContextQueryProperties type,
77
# which changes the signature of MissingContext.
88
weakened:@aws-cdk/cloud-assembly-schema.MissingContext
9+
weakened:aws-cdk-lib.cloud_assembly_schema.MissingContext
910

1011
removed:@aws-cdk/core.BootstraplessSynthesizer.DEFAULT_ASSET_PUBLISHING_ROLE_ARN
1112
removed:@aws-cdk/core.DefaultStackSynthesizer.DEFAULT_ASSET_PUBLISHING_ROLE_ARN

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.graphql.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ customerDS.createResolver('MutationRemoveCustomer', {
178178
responseMappingTemplate: MappingTemplate.dynamoDbResultItem(),
179179
});
180180

181-
const ops = [
182-
{ suffix: 'Eq', op: KeyCondition.eq },
183-
{ suffix: 'Lt', op: KeyCondition.lt },
184-
{ suffix: 'Le', op: KeyCondition.le },
185-
{ suffix: 'Gt', op: KeyCondition.gt },
186-
{ suffix: 'Ge', op: KeyCondition.ge },
181+
const ops: Array<{ suffix: string; op: (x: string, y: string) => KeyCondition }> = [
182+
{ suffix: 'Eq', op: (x, y) => KeyCondition.eq(x, y) },
183+
{ suffix: 'Lt', op: (x, y) => KeyCondition.lt(x, y) },
184+
{ suffix: 'Le', op: (x, y) => KeyCondition.le(x, y) },
185+
{ suffix: 'Gt', op: (x, y) => KeyCondition.gt(x, y) },
186+
{ suffix: 'Ge', op: (x, y) => KeyCondition.ge(x, y) },
187187
];
188188
for (const { suffix, op } of ops) {
189189
orderDS.createResolver(`QueryGetCustomerOrders${suffix}`, {

packages/@aws-cdk/aws-eks-v2-alpha/lib/cluster.ts

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,8 @@ export class Cluster extends ClusterBase {
10671067

10681068
private readonly _kubectlProvider?: IKubectlProvider;
10691069

1070+
private readonly _clusterAdminAccess?: AccessEntry;
1071+
10701072
/**
10711073
* Initiates an EKS Cluster with the supplied arguments
10721074
*
@@ -1279,11 +1281,7 @@ export class Cluster extends ClusterBase {
12791281

12801282
// give the handler role admin access to the cluster
12811283
// so it can deploy/query any resource.
1282-
this.grantAccess('ClusterAdminRoleAccess', this._kubectlProvider?.role!.roleArn, [
1283-
AccessPolicy.fromAccessPolicyName('AmazonEKSClusterAdminPolicy', {
1284-
accessScopeType: AccessScopeType.CLUSTER,
1285-
}),
1286-
]);
1284+
this._clusterAdminAccess = this.grantClusterAdmin('ClusterAdminRoleAccess', this._kubectlProvider?.role!.roleArn);
12871285
}
12881286

12891287
// do not create a masters role if one is not provided. Trusting the accountRootPrincipal() is too permissive.
@@ -1351,6 +1349,32 @@ export class Cluster extends ClusterBase {
13511349
this.addToAccessEntry(id, principal, accessPolicies);
13521350
}
13531351

1352+
/**
1353+
* Grants the specified IAM principal cluster admin access to the EKS cluster.
1354+
*
1355+
* This method creates an `AccessEntry` construct that grants the specified IAM principal the cluster admin
1356+
* access permissions. This allows the IAM principal to perform the actions permitted
1357+
* by the cluster admin acces.
1358+
*
1359+
* @param id - The ID of the `AccessEntry` construct to be created.
1360+
* @param principal - The IAM principal (role or user) to be granted access to the EKS cluster.
1361+
* @returns the access entry construct
1362+
*/
1363+
@MethodMetadata()
1364+
public grantClusterAdmin(id: string, principal: string): AccessEntry {
1365+
const newEntry = new AccessEntry(this, id, {
1366+
principal,
1367+
cluster: this,
1368+
accessPolicies: [
1369+
AccessPolicy.fromAccessPolicyName('AmazonEKSClusterAdminPolicy', {
1370+
accessScopeType: AccessScopeType.CLUSTER,
1371+
}),
1372+
],
1373+
});
1374+
this.accessEntries.set(principal, newEntry);
1375+
return newEntry;
1376+
}
1377+
13541378
/**
13551379
* Fetch the load balancer address of a service of type 'LoadBalancer'.
13561380
*
@@ -1730,13 +1754,19 @@ export class Cluster extends ClusterBase {
17301754
},
17311755
});
17321756

1733-
new KubernetesPatch(this, 'CoreDnsComputeTypePatch', {
1757+
const k8sPatch = new KubernetesPatch(this, 'CoreDnsComputeTypePatch', {
17341758
cluster: this,
17351759
resourceName: 'deployment/coredns',
17361760
resourceNamespace: 'kube-system',
17371761
applyPatch: renderPatch(CoreDnsComputeType.FARGATE),
17381762
restorePatch: renderPatch(CoreDnsComputeType.EC2),
17391763
});
1764+
1765+
// In Patch deletion, it needs to apply the restore patch to the cluster
1766+
// So the cluster admin access can only be deleted after the patch
1767+
if (this._clusterAdminAccess) {
1768+
k8sPatch.node.addDependency(this._clusterAdminAccess);
1769+
}
17401770
}
17411771
}
17421772

packages/@aws-cdk/aws-eks-v2-alpha/lib/managed-nodegroup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ function getPossibleAmiTypes(instanceTypes: InstanceType[]): NodegroupAmiType[]
633633
const architectures: Set<AmiArchitecture> = new Set(instanceTypes.map(typeToArch));
634634

635635
if (architectures.size === 0) { // protective code, the current implementation will never result in this.
636-
throw new Error(`Cannot determine any ami type compatible with instance types: ${instanceTypes.map(i => i.toString).join(', ')}`);
636+
throw new Error(`Cannot determine any ami type compatible with instance types: ${instanceTypes.map(i => i.toString()).join(', ')}`);
637637
}
638638

639639
if (architectures.size > 1) {

packages/@aws-cdk/aws-eks-v2-alpha/test/integ.fargate-cluster.js.snapshot/asset.2e670e0c40dc05a34d602c35c948edefcb81afaeea05b9f6240341173af6164e.zip

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)