You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(lambda): deprecate default feature flag @aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy (#34010)
deprecate default feature flag @aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy
same as pr-33689
### Issue # (if applicable)
Closes#33688 .
### Reason for this change
same as #33689
### Description of changes
### Describe any new or updated permissions being added
### Description of how you validated changes
### Checklist
- [ x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy file name to clipboardExpand all lines: packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md
+8-5
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ Flags come in three types:
89
89
|[@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) |
90
90
|[@aws-cdk/aws-iam:oidcRejectUnauthorizedConnections](#aws-cdkaws-iamoidcrejectunauthorizedconnections)| When enabled, the default behaviour of OIDC provider will reject unauthorized connections | 2.177.0 | (fix) |
91
91
|[@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) |
92
-
|[@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) |
92
+
|[@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) |
93
93
|[@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) |
94
94
|[@aws-cdk/pipelines:reduceStageRoleTrustScope](#aws-cdkpipelinesreducestageroletrustscope)| Remove the root account principal from Stage addActions trust policy | 2.184.0 | (default) |
95
95
|[@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) |
@@ -172,7 +172,7 @@ The following json shows the current recommended set of flags, as `cdk init` wou
*When enabled, Lambda will create new inline policies with AddToRolePolicy instead of adding to the Default Policy Statement* (fix)
1704
+
*[Deprecated] When enabled, Lambda will create new inline policies with AddToRolePolicy instead of adding to the Default Policy Statement* (fix)
1705
1705
1706
-
When this feature flag is enabled, Lambda will create new inline policies with AddToRolePolicy.
1706
+
[Deprecated default feature] When this feature flag is enabled, Lambda will create new inline policies with AddToRolePolicy.
1707
1707
The purpose of this is to prevent lambda from creating a dependency on the Default Policy Statement.
1708
1708
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.
1709
+
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.
1710
+
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.
1711
+
We recommend to unset the feature flag if already set which will restore the original behavior.
When this feature flag is enabled, Lambda will create new inline policies with AddToRolePolicy.
618
+
[Deprecated default feature] When this feature flag is enabled, Lambda will create new inline policies with AddToRolePolicy.
619
619
The purpose of this is to prevent lambda from creating a dependency on the Default Policy Statement.
620
620
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.
621
+
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.
622
+
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.
623
+
We recommend to unset the feature flag if already set which will restore the original behavior.
summary: 'When enabled, Lambda will create new inline policies with AddToRolePolicy instead of adding to the Default Policy Statement',
1399
+
summary: '[Deprecated] When enabled, Lambda will create new inline policies with AddToRolePolicy instead of adding to the Default Policy Statement',
1400
1400
detailsMd: `
1401
-
When this feature flag is enabled, Lambda will create new inline policies with AddToRolePolicy.
1401
+
[Deprecated default feature] When this feature flag is enabled, Lambda will create new inline policies with AddToRolePolicy.
1402
1402
The purpose of this is to prevent lambda from creating a dependency on the Default Policy Statement.
1403
1403
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.
1404
+
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.
1405
+
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.
1406
+
We recommend to unset the feature flag if already set which will restore the original behavior.
0 commit comments