-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(amplify): support cache configuration for app (#31381)
### Issue # (if applicable) N/A ### Reason for this change On August 13, 2024, Amplify released improvements to caching efficiency for applications. Ref: https://aws.amazon.com/jp/blogs/mobile/cdn-caching-improvements-for-better-app-performance-with-aws-amplify-hosting/ To support this feature, add cache configuration for app ### Description of changes Add `cacheConfigType` property to `App` class ### Description of how you validated changes Add unit tests and integ test. ### 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*
- Loading branch information
Showing
12 changed files
with
594 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...e-config.js.snapshot/amplifyappcachecofigintegDefaultTestDeployAssert14075C62.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...config.js.snapshot/amplifyappcachecofigintegDefaultTestDeployAssert14075C62.template.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...fy-alpha/test/integ.app-cache-config.js.snapshot/cdk-amplify-app-cache-config.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
88 changes: 88 additions & 0 deletions
88
...-alpha/test/integ.app-cache-config.js.snapshot/cdk-amplify-app-cache-config.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"Resources": { | ||
"AppRole1AF9B530": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRole", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "amplify.amazonaws.com" | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} | ||
} | ||
}, | ||
"AppF1B96344": { | ||
"Type": "AWS::Amplify::App", | ||
"Properties": { | ||
"BasicAuthConfig": { | ||
"EnableBasicAuth": false | ||
}, | ||
"CacheConfig": { | ||
"Type": "AMPLIFY_MANAGED_NO_COOKIES" | ||
}, | ||
"IAMServiceRole": { | ||
"Fn::GetAtt": [ | ||
"AppRole1AF9B530", | ||
"Arn" | ||
] | ||
}, | ||
"Name": "App", | ||
"Platform": "WEB" | ||
} | ||
}, | ||
"AppmainF505BAED": { | ||
"Type": "AWS::Amplify::Branch", | ||
"Properties": { | ||
"AppId": { | ||
"Fn::GetAtt": [ | ||
"AppF1B96344", | ||
"AppId" | ||
] | ||
}, | ||
"BranchName": "main", | ||
"EnableAutoBuild": true, | ||
"EnablePullRequestPreview": true | ||
} | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
packages/@aws-cdk/aws-amplify-alpha/test/integ.app-cache-config.js.snapshot/cdk.out
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
packages/@aws-cdk/aws-amplify-alpha/test/integ.app-cache-config.js.snapshot/integ.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.