Skip to content

Commit c8f2646

Browse files
authored
feat(appconfig): add grantReadConfig method to Environment Construct (#30180)
### Issue # (if applicable) Closes #28585 ### Reason for this change To simplify policy configuration for AppConfig Environments. ### Description of changes add grantReadConfig method to Environment Construct ### Description of how you validated changes Add unit test and integ tests ### 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 4bf6fad commit c8f2646

File tree

12 files changed

+723
-36
lines changed

12 files changed

+723
-36
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment-grant.js.snapshot/appconfigenvironmentDefaultTestDeployAssert75BD28E7.assets.json

Lines changed: 19 additions & 0 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-appconfig/test/integ.environment-grant.js.snapshot/appconfigenvironmentDefaultTestDeployAssert75BD28E7.template.json

Lines changed: 36 additions & 0 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-appconfig/test/integ.environment-grant.js.snapshot/aws-appconfig-environment-grant.assets.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
"Resources": {
3+
"MyApplicationForEnv1F597ED9": {
4+
"Type": "AWS::AppConfig::Application",
5+
"Properties": {
6+
"Name": "AppForEnvTest"
7+
}
8+
},
9+
"MyEnvironment465E4DEA": {
10+
"Type": "AWS::AppConfig::Environment",
11+
"Properties": {
12+
"ApplicationId": {
13+
"Ref": "MyApplicationForEnv1F597ED9"
14+
},
15+
"Name": "awsappconfigenvironmentgrant-MyEnvironment-6CC47125"
16+
}
17+
},
18+
"MyUserDC45028B": {
19+
"Type": "AWS::IAM::User"
20+
},
21+
"MyUserDefaultPolicy7B897426": {
22+
"Type": "AWS::IAM::Policy",
23+
"Properties": {
24+
"PolicyDocument": {
25+
"Statement": [
26+
{
27+
"Action": [
28+
"appconfig:GetLatestConfiguration",
29+
"appconfig:StartConfigurationSession"
30+
],
31+
"Effect": "Allow",
32+
"Resource": {
33+
"Fn::Join": [
34+
"",
35+
[
36+
"arn:",
37+
{
38+
"Ref": "AWS::Partition"
39+
},
40+
":appconfig:",
41+
{
42+
"Ref": "AWS::Region"
43+
},
44+
":",
45+
{
46+
"Ref": "AWS::AccountId"
47+
},
48+
":application/",
49+
{
50+
"Ref": "MyApplicationForEnv1F597ED9"
51+
},
52+
"/environment/",
53+
{
54+
"Ref": "MyEnvironment465E4DEA"
55+
},
56+
"/configuration/*"
57+
]
58+
]
59+
}
60+
}
61+
],
62+
"Version": "2012-10-17"
63+
},
64+
"PolicyName": "MyUserDefaultPolicy7B897426",
65+
"Users": [
66+
{
67+
"Ref": "MyUserDC45028B"
68+
}
69+
]
70+
}
71+
}
72+
},
73+
"Parameters": {
74+
"BootstrapVersion": {
75+
"Type": "AWS::SSM::Parameter::Value<String>",
76+
"Default": "/cdk-bootstrap/hnb659fds/version",
77+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
78+
}
79+
},
80+
"Rules": {
81+
"CheckBootstrapVersion": {
82+
"Assertions": [
83+
{
84+
"Assert": {
85+
"Fn::Not": [
86+
{
87+
"Fn::Contains": [
88+
[
89+
"1",
90+
"2",
91+
"3",
92+
"4",
93+
"5"
94+
],
95+
{
96+
"Ref": "BootstrapVersion"
97+
}
98+
]
99+
}
100+
]
101+
},
102+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
103+
}
104+
]
105+
}
106+
}
107+
}

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment-grant.js.snapshot/cdk.out

Lines changed: 1 addition & 0 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-appconfig/test/integ.environment-grant.js.snapshot/integ.json

Lines changed: 12 additions & 0 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-appconfig/test/integ.environment-grant.js.snapshot/manifest.json

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

0 commit comments

Comments
 (0)