Skip to content

Conversation

@mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Oct 24, 2025

Why

Enables safer CDK deployments by restricting changes to only specified resource types or properties, preventing accidental modifications to critical infrastructure.

What

Adds --allow-resource-changes option to deploy and diff commands with support for:

  • Resource type filtering (AWS::Lambda::Function)
  • Property-level filtering (AWS::Lambda::Function.Code.S3Key)
  • Wildcard patterns (AWS::Lambda::*)
cdk deploy --allow-resource-changes AWS::Lambda::Function.Code.S3Key

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

…ands

Add --allow-resource-changes option to restrict deployments to specific resource types or properties. This enables safer deployments by preventing unintended changes to critical resources.

- Add ResourceFilter API with pattern matching for resource types and properties
- Integrate validation into deploy and diff commands
- Support wildcard patterns (e.g., AWS::Lambda::*)
- Provide detailed violation messages with remediation guidance
- Include comprehensive unit tests and integration tests
@aws-cdk-automation aws-cdk-automation requested a review from a team October 24, 2025 13:40
@mrgrain mrgrain marked this pull request as draft October 24, 2025 13:40
@github-actions github-actions bot added the p2 label Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant