Skip to content

Commit aaaa9cc

Browse files
authored
fix(signer): not correctly passing signingProfileName to CfnSigningProfile (#35033)
### Issue # (if applicable) Closes #35030. ### Reason for this change The `signingProfileName` property set in the AWS CDK's Signer module L2 construct is not being properly propagated to the generated L1 CloudFormation template. This causes AWS Signer profiles to be created without the specified name, which leads to unexpected behavior and difficulty in managing resources. ### Description of changes - Modified the `SigningProfile` class constructor to pass `this.physicalName` to the L1 `CfnSigningProfile` resource's `profileName` property - Updated unit tests to explicitly verify that the `ProfileName` property is correctly included in the CloudFormation template when `signingProfileName` is provided, and absent when not provided These changes ensure that when a user specifies a `signingProfileName`, it will be included in the generated CloudFormation template as the `ProfileName` property. The fix maintains backward compatibility and doesn't introduce any breaking changes to the API. ### Describe any new or updated permissions being added No new or updated IAM permissions are needed for this change. ### Description of how you validated changes - Updated existing unit tests to verify the fix - Verified that the existing integration test for SigningProfile with a name works correctly - Manually tested with a simple test application that uses SigningProfile with signingProfileName ### Why we need a FF to avoid BC If we had specified a `signingProfileName` in their SigningProfile construct, the CloudFormation template will now include this name as the ProfileName property. Previously, this name was ignored in the CloudFormation template, causing CloudFormation to auto-generate a name for the signing profile. Upon deployment with the updated CDK version, CloudFormation will detect this as a change and will: Create a new signing profile with the specified name. Delete the old signing profile that had an auto-generated name This replacement of the signing profile can break existing references to the profile and disrupt workflows that depend on the existing profile hence this PR introduced a FF to avoid this. ### 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*
1 parent 1efb764 commit aaaa9cc

15 files changed

+721
-180
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-signer/integ.signing-profile.js.snapshot/aws-cdk-signer-signing-profile.assets.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-signer/integ.signing-profile.js.snapshot/aws-cdk-signer-signing-profile.template.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@
1919
"Value": 60
2020
}
2121
}
22+
},
23+
"SigningProfileWithName6D0F168B": {
24+
"Type": "AWS::Signer::SigningProfile",
25+
"Properties": {
26+
"PlatformId": "AWSLambda-SHA384-ECDSA",
27+
"SignatureValidityPeriod": {
28+
"Type": "MONTHS",
29+
"Value": 135
30+
}
31+
}
2232
}
2333
},
2434
"Parameters": {

packages/@aws-cdk-testing/framework-integ/test/aws-signer/integ.signing-profile.js.snapshot/cdk.out

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-signer/integ.signing-profile.js.snapshot/cdkintegsignersigningprofileDefaultTestDeployAssertE50BA0E5.assets.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-signer/integ.signing-profile.js.snapshot/integ.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)