Skip to content

Commit 96b494d

Browse files
authored
docs(cloudfront): specify that cloudront does not support updating the key (#34676)
### Issue # (if applicable) Related to #15301. ### Reason for this change The error message returned by cloudformation when trying to update a public key is not helping user diagnose that the updating of certain fields of a PublicKey is not supported. ### Description of changes Updated the doc to reflect that updating the fields is not allowed. ### 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 3e53c2c commit 96b494d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/aws-cdk-lib/aws-cloudfront/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,14 @@ new cloudfront.KeyGroup(this, 'MyKeyGroup', {
12471247
});
12481248
```
12491249

1250+
When using a CloudFront PublicKey, only the `comment` field can be updated after creation. Fields such as `encodedKey` and `publicKeyName` are immutable, as outlined in the [API Reference](https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdatePublicKey.html). Attempting to modify these fields will result in an error:
1251+
```
1252+
Resource handler returned message: "Invalid request provided: AWS::CloudFront::PublicKey"
1253+
```
1254+
1255+
To update the `encodedKey`, you must change the logical ID of the public key resource in your template. This causes CloudFormation to create a new `cloudfront.PublicKey` resource and delete the old one during the next deployment.
1256+
1257+
12501258
See:
12511259

12521260
- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html>

0 commit comments

Comments
 (0)