Skip to content
Closed
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6ca8753
Update .mergify.yml. Add me, remove Kailey and Michelle
QuantumNeuralCoder Feb 6, 2025
47187a0
Update .mergify.yml Removing Jacob, Kirti, Colin, Calvin.
QuantumNeuralCoder Feb 6, 2025
8a3fd60
Merge branch 'aws:main' into main
QuantumNeuralCoder Feb 6, 2025
ae36a25
Pinning minimatch and @types/glob versions to get rid of incompatibil…
Feb 7, 2025
cb336ae
Merge branch 'aws:main' into main
QuantumNeuralCoder Feb 7, 2025
70e0a20
Update codecov.yml
QuantumNeuralCoder Feb 7, 2025
f63e2a7
Merge branch 'aws:main' into main
QuantumNeuralCoder Feb 7, 2025
5b356c0
Merge branch 'aws:main' into main
QuantumNeuralCoder Feb 7, 2025
9cea97f
Merge branch 'aws:main' into main
QuantumNeuralCoder Feb 10, 2025
679f8b1
Merge branch 'aws:main' into main
QuantumNeuralCoder Feb 19, 2025
1851e8b
Merge branch 'aws:main' into main
QuantumNeuralCoder Feb 19, 2025
47333b2
Merge branch 'aws:main' into main
QuantumNeuralCoder Feb 26, 2025
8e73063
Merge branch 'aws:main' into main
QuantumNeuralCoder Mar 3, 2025
34365a1
Merge branch 'aws:main' into main
QuantumNeuralCoder Mar 4, 2025
6c01b62
Merge branch 'aws:main' into main
QuantumNeuralCoder Mar 4, 2025
51a0d48
issue-33688 Merge remote-tracking branch 'upstream/main'
Mar 4, 2025
4c04550
deprecate feature flag @aws-cdk/aws-lambda:createNewPoliciesWithAddTo…
Mar 4, 2025
58e531b
Removed unrelated files
Mar 4, 2025
c7ea0b6
chore: revert unintended changes to files
Mar 4, 2025
e5c0bc5
fix: minor updates to the description
Mar 5, 2025
d83ab06
chore: remove package-lock.json from PR
Mar 5, 2025
55fadf3
chore: add package-lock.json to .gitignore
Mar 5, 2025
8c4f95e
chore: add package-lock.json to .gitignore
Mar 5, 2025
42d696d
chore: remove .gitignore from PR
Mar 5, 2025
ee85c2b
chore: sync .gitignore with upstream
Mar 5, 2025
141feb3
Merge branch 'main' into issue-33688
QuantumNeuralCoder Mar 6, 2025
f2c07d7
Enabling ff to prevent destructive changes to snapshop
Mar 7, 2025
2fcf9c5
Adding ff to prevent breaking change in snapshot
Mar 7, 2025
fd11b4c
Merge branch 'main' into issue-33688
QuantumNeuralCoder Mar 17, 2025
68ee9cc
Merge branch 'main' into issue-33688
QuantumNeuralCoder Mar 17, 2025
bc076ac
Fixing integ tests for issue-33688
Mar 17, 2025
c1ab297
Merge branch 'main' into issue-33688
QuantumNeuralCoder Mar 18, 2025
f1a8acd
Merge branch 'main' into issue-33688
GavinZZ Mar 18, 2025
8c7ce74
Merge branch 'main' into issue-33688
QuantumNeuralCoder Mar 19, 2025
f3c4668
Merge branch 'main' into issue-33688
QuantumNeuralCoder Mar 19, 2025
25b0d8b
Merge branch 'main' into issue-33688
QuantumNeuralCoder Mar 19, 2025
72d6d66
Merge branch 'main' into issue-33688
QuantumNeuralCoder Apr 1, 2025
8f34db0
Merge branch 'main' into issue-33688
mergify[bot] Apr 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ if (!hostedZoneName) throw new Error('For this test you must provide your own Ho
const domainName = process.env.CDK_INTEG_DOMAIN_NAME ?? process.env.DOMAIN_NAME;
if (!domainName) throw new Error('For this test you must provide your own DomainName as an env var "DOMAIN_NAME". See framework-integ/README.md for details.');

const app = new App();
const app = new App({
postCliContext: {
'@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy': true,
},
});
const stack = new Stack(app, 'integ-dns-validated-certificate');
const hostedZone = PublicHostedZone.fromHostedZoneAttributes(stack, 'HostedZone', {
hostedZoneId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { CustomResourceConfig } from 'aws-cdk-lib/custom-resources';

const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy': true,
'@aws-cdk/aws-dynamodb:retainTableReplica': true,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ class TestStack extends Stack {
}
}

const app = new App();
const app = new App({
postCliContext: {
'@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy': true,
},
});
const stack = new TestStack(app, 'integ-provider-with-waiter-state-machine-custom-role');

new integ.IntegTest(app, 'IntegProviderWithWaiterStateMachineCustomRole', {
Expand Down
6 changes: 5 additions & 1 deletion packages/@aws-cdk/aws-eks-v2-alpha/test/integ.eks-auto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ export class EksAutoModeNodePoolsStack extends Stack {
}
}

const app = new App();
const app = new App({
postCliContext: {
'@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy': true,
},
});

const stack1 = new EksAutoModeBaseStack(app, 'eks-auto-mode-stack', { env: { region: 'us-east-1' } });
const stack2 = new EksAutoModeNodePoolsStack(app, 'eks-auto-mode-empty-nodepools-stack', { env: { region: 'us-east-1' } });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ class RedshiftStack extends Stack {
}
}

const app = new App();
const app = new App({
postCliContext: {
'@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy': true,
},
});

new integ.IntegTest(app, 'RedshiftMaintenanceTrackNameInteg', {
testCases: [new RedshiftStack(app, 'RedshiftMaintenanceTrackNameIntegStack')],
Expand Down
13 changes: 9 additions & 4 deletions packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Flags come in three types:
| [@aws-cdk/aws-elasticloadbalancingV2:albDualstackWithoutPublicIpv4SecurityGroupRulesDefault](#aws-cdkaws-elasticloadbalancingv2albdualstackwithoutpublicipv4securitygrouprulesdefault) | When enabled, the default security group ingress rules will allow IPv6 ingress from anywhere | 2.176.0 | (fix) |
| [@aws-cdk/aws-iam:oidcRejectUnauthorizedConnections](#aws-cdkaws-iamoidcrejectunauthorizedconnections) | When enabled, the default behaviour of OIDC provider will reject unauthorized connections | 2.177.0 | (fix) |
| [@aws-cdk/core:enableAdditionalMetadataCollection](#aws-cdkcoreenableadditionalmetadatacollection) | When enabled, CDK will expand the scope of usage data collected to better inform CDK development and improve communication for security concerns and emerging issues. | 2.178.0 | (config) |
| [@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy](#aws-cdkaws-lambdacreatenewpolicieswithaddtorolepolicy) | When enabled, Lambda will create new inline policies with AddToRolePolicy instead of adding to the Default Policy Statement | 2.180.0 | (fix) |
| [@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy](#aws-cdkaws-lambdacreatenewpolicieswithaddtorolepolicy) | [Deprecated]When enabled, Lambda will create new inline policies with AddToRolePolicy instead of adding to the Default Policy Statement | 2.180.0 | (fix) |
| [@aws-cdk/aws-s3:setUniqueReplicationRoleName](#aws-cdkaws-s3setuniquereplicationrolename) | When enabled, CDK will automatically generate a unique role name that is used for s3 object replication. | 2.182.0 | (fix) |
| [@aws-cdk/pipelines:reduceStageRoleTrustScope](#aws-cdkpipelinesreducestageroletrustscope) | Remove the root account principal from Stage addActions trust policy | 2.184.0 | (default) |
| [@aws-cdk/aws-events:requireEventBusPolicySid](#aws-cdkaws-eventsrequireeventbuspolicysid) | When enabled, grantPutEventsTo() will use resource policies with Statement IDs for service principals. | 2.186.0 | (fix) |
Expand Down Expand Up @@ -172,6 +172,8 @@ The following json shows the current recommended set of flags, as `cdk init` wou
"@aws-cdk/aws-elasticloadbalancingV2:albDualstackWithoutPublicIpv4SecurityGroupRulesDefault": true,
"@aws-cdk/aws-iam:oidcRejectUnauthorizedConnections": true,
"@aws-cdk/core:enableAdditionalMetadataCollection": true,
"@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy": false,
"@aws-cdk/aws-s3:setUniqueReplicationRoleName": true,
"@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy": true,
"@aws-cdk/aws-s3:setUniqueReplicationRoleName": true,
"@aws-cdk/aws-events:requireEventBusPolicySid": true,
Expand Down Expand Up @@ -1701,17 +1703,20 @@ When this feature flag is enabled, CDK expands the scope of usage data collectio

### @aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy

*When enabled, Lambda will create new inline policies with AddToRolePolicy instead of adding to the Default Policy Statement* (fix)
*[Deprecated]When enabled, Lambda will create new inline policies with AddToRolePolicy instead of adding to the Default Policy Statement* (fix)

When this feature flag is enabled, Lambda will create new inline policies with AddToRolePolicy.
[Deprecated default feature] When this feature flag is enabled, Lambda will create new inline policies with AddToRolePolicy.
The purpose of this is to prevent lambda from creating a dependency on the Default Policy Statement.
This solves an issue where a circular dependency could occur if adding lambda to something like a Cognito Trigger, then adding the User Pool to the lambda execution role permissions.
However in the current implementation, we have removed a dependency of the lambda function on the policy. In addition to this, a Role will be attached to the Policy instead of an inline policy being attached to the role.
This will create a data race condition in the CloudFormation template because the creation of the Lambda function no longer waits for the policy to be created. Having said that, we are not deprecating the feature (we are defaulting the feature flag to false for new stacks) since this feature can still be used to get around the circular dependency issue (issue-7016) particularly in cases where the lambda resource creation doesnt need to depend on the policy resource creation.
We recommend to unset the feature flag if already set which will restore the original behavior.


| Since | Default | Recommended |
| ----- | ----- | ----- |
| (not in v1) | | |
| 2.180.0 | `false` | `true` |
| 2.180.0 | `false` | `false` |


### @aws-cdk/aws-s3:setUniqueReplicationRoleName
Expand Down
7 changes: 5 additions & 2 deletions packages/aws-cdk-lib/cx-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,16 +615,19 @@ _cdk.json_

* `@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy`

When this feature flag is enabled, Lambda will create new inline policies with AddToRolePolicy.
[Deprecated default feature] When this feature flag is enabled, Lambda will create new inline policies with AddToRolePolicy.
The purpose of this is to prevent lambda from creating a dependency on the Default Policy Statement.
This solves an issue where a circular dependency could occur if adding lambda to something like a Cognito Trigger, then adding the User Pool to the lambda execution role permissions.
However in the current implementation, we have removed a dependency of the lambda function on the policy. In addition to this, a Role will be attached to the Policy instead of an inline policy being attached to the role.
This will create a data race condition in the CloudFormation template because the creation of the Lambda function no longer waits for the policy to be created. Having said that, we are not deprecating the feature (we are defaulting the feature flag to false for new stacks) since this feature can still be used to get around the circular dependency issue (issue-7016) particularly in cases where the lambda resource creation doesnt need to depend on the policy resource creation.
We recommend to unset the feature flag if already set which will restore the original behavior.

_cdk.json_

```json
{
"context": {
"@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy": true
"@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy": false
}
}
```
Expand Down
9 changes: 6 additions & 3 deletions packages/aws-cdk-lib/cx-api/lib/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1396,14 +1396,17 @@ export const FLAGS: Record<string, FlagInfo> = {
//////////////////////////////////////////////////////////////////////
[LAMBDA_CREATE_NEW_POLICIES_WITH_ADDTOROLEPOLICY]: {
type: FlagType.BugFix,
summary: 'When enabled, Lambda will create new inline policies with AddToRolePolicy instead of adding to the Default Policy Statement',
summary: '[Deprecated]When enabled, Lambda will create new inline policies with AddToRolePolicy instead of adding to the Default Policy Statement',
detailsMd: `
When this feature flag is enabled, Lambda will create new inline policies with AddToRolePolicy.
[Deprecated default feature] When this feature flag is enabled, Lambda will create new inline policies with AddToRolePolicy.
The purpose of this is to prevent lambda from creating a dependency on the Default Policy Statement.
This solves an issue where a circular dependency could occur if adding lambda to something like a Cognito Trigger, then adding the User Pool to the lambda execution role permissions.
However in the current implementation, we have removed a dependency of the lambda function on the policy. In addition to this, a Role will be attached to the Policy instead of an inline policy being attached to the role.
This will create a data race condition in the CloudFormation template because the creation of the Lambda function no longer waits for the policy to be created. Having said that, we are not deprecating the feature (we are defaulting the feature flag to false for new stacks) since this feature can still be used to get around the circular dependency issue (issue-7016) particularly in cases where the lambda resource creation doesnt need to depend on the policy resource creation.
We recommend to unset the feature flag if already set which will restore the original behavior.
`,
introducedIn: { v2: '2.180.0' },
recommendedValue: true,
recommendedValue: false,
},

//////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 2 additions & 0 deletions packages/aws-cdk-lib/recommended-feature-flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
"@aws-cdk/aws-elasticloadbalancingV2:albDualstackWithoutPublicIpv4SecurityGroupRulesDefault": true,
"@aws-cdk/aws-iam:oidcRejectUnauthorizedConnections": true,
"@aws-cdk/core:enableAdditionalMetadataCollection": true,
"@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy": false,
"@aws-cdk/aws-s3:setUniqueReplicationRoleName": true,
"@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy": true,
"@aws-cdk/aws-s3:setUniqueReplicationRoleName": true,
"@aws-cdk/aws-events:requireEventBusPolicySid": true,
Expand Down