Skip to content

Conversation

@reedham-aws
Copy link

Issue # (if applicable)

N/a

Reason for this change

Current validation of fields for recent capacity provider additions in aws-lambda does not take into account unresolved tokens.

Description of changes

Added Token.isUnresolved() checks before all new validations. This ensures that validation only occurs when concrete values are provided, while still allowing tokens to pass through for CloudFormation resolution.

Describe any new or updated permissions being added

N/a

Description of how you validated changes

Changes should be only internal, validated that unit and integration tests continued to work.

Checklist


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

@github-actions github-actions bot added the p2 label Dec 2, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team December 2, 2025 21:32
@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Dec 2, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter fails with the following errors:

❌ Fixes must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

@kumvprat
Copy link
Contributor

kumvprat commented Dec 3, 2025

@reedham-aws Can we have some unit tests that cover the edge of these properties being provided as tokens instead of exact values ?

new lambda.CapacityProvider(stack, 'MyCapacityProvider', {
capacityProviderName: tokenName,
maxVCpuCount: cdk.Token.asNumber(tokenMaxVCpu),
subnets: tokenSubnets.map((id, i) => ec2.Subnet.fromSubnetId(stack, `TokenSubnet${i}`, id)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to have assertions on subnets and securityGroups values in the checks below ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants