Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(aws-cloudfront): deprecated property prevents CDKv2 users from using trusted signers #19837

Closed
1 of 2 tasks
kfritz opened this issue Apr 8, 2022 · 2 comments · Fixed by #19839
Closed
1 of 2 tasks
Assignees
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@kfritz
Copy link

kfritz commented Apr 8, 2022

Describe the feature

AWS CloudFront provides two mechanisms for restricting access with signed requests: key groups and AWS accounts. The CloudFront developer guide clearly recommends using key groups, as there are numerous advantages to doing so. That said, CloudFront continues to support signing by AWS accounts.

PR #12847 added support for CloudFront's preferred trusted key group mechanism to the CDK Construct Library. As part of this PR, a @deprecated annotation was added to the trustedSigners property with a message to discourage its use. As part of the CDKv2 launch, all @deprecated properties are being excluded, leaving no path for users of CDKv2 to use AWS accounts as trusted signers without escape hatches.

I propose removing the @deprecated annotation from the trustedSigners property. Instead, we can replace it with a code comment that merely dissuades its usage. This will restore it to CDKv2 and allow consumers to use this feature if they still need to, at least until CloudFront decides to officially end support for it.

Use Case

As a developer who maintains a CloudFront distribution in CDK, I am blocked from upgrading to CDKv2 because my distribution is secured using AWS account trusted signers. Though trusted key pairs are preferred, I cannot immediately transition to using them because the AWS account that signs URLs to my website is owned by another entity.

Proposed Solution

I propose replacing line 377 of web-distribution.ts. Instead of using an @deprecated annotation, we can simply use a code comment to discourage use of this property. If something like a @discouraged annotation existed, that would be preferable; however, I am not aware of anything like that in the CDK repository.

This will not result in a breaking change to CDKv2. Rather, it would be strictly additive.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.20.0

Environment details (OS name and version, etc.)

Amazon Linux 2

@kfritz kfritz added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Apr 8, 2022
@github-actions github-actions bot added the @aws-cdk/aws-cloudfront Related to Amazon CloudFront label Apr 8, 2022
@vgonzalo
Copy link
Contributor

vgonzalo commented Apr 8, 2022

Just to add to this discussion: KeyGroups require the public key in the CloudFront distribution's account, but this is a problem when the keys are managed by a central account (a common use case in large organizations) and they are periodically rotated, if a rotation happens then the distribution's account will need to create a new KeyGroup for the new public key and assign it to the distribution, which is a process hard to automate with a high risk of downtime. Also KeyGroups can't be shared because they don't have ARN.

@mergify mergify bot closed this as completed in #19839 Apr 9, 2022
mergify bot pushed a commit that referenced this issue Apr 9, 2022
Some services still use the deprecated `trustedSigners` property, which is preventing teams which depend on those services from upgrading to V2. This change adds `trustedSigners` back into V2, but leaves it marked as `@deprecated`. 

Closes #19837

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

github-actions bot commented Apr 9, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

otaviomacedo pushed a commit that referenced this issue Apr 11, 2022
Some services still use the deprecated `trustedSigners` property, which is preventing teams which depend on those services from upgrading to V2. This change adds `trustedSigners` back into V2, but leaves it marked as `@deprecated`. 

Closes #19837

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
StevePotter pushed a commit to StevePotter/aws-cdk that referenced this issue Apr 27, 2022
Some services still use the deprecated `trustedSigners` property, which is preventing teams which depend on those services from upgrading to V2. This change adds `trustedSigners` back into V2, but leaves it marked as `@deprecated`. 

Closes aws#19837

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants