Skip to content

Commit

Permalink
feat(appconfig): add grantReadConfig method to Environment Construct (#…
Browse files Browse the repository at this point in the history
…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*
  • Loading branch information
mazyu36 committed May 29, 2024
1 parent 4bf6fad commit c8f2646
Show file tree
Hide file tree
Showing 12 changed files with 723 additions and 36 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"Resources": {
"MyApplicationForEnv1F597ED9": {
"Type": "AWS::AppConfig::Application",
"Properties": {
"Name": "AppForEnvTest"
}
},
"MyEnvironment465E4DEA": {
"Type": "AWS::AppConfig::Environment",
"Properties": {
"ApplicationId": {
"Ref": "MyApplicationForEnv1F597ED9"
},
"Name": "awsappconfigenvironmentgrant-MyEnvironment-6CC47125"
}
},
"MyUserDC45028B": {
"Type": "AWS::IAM::User"
},
"MyUserDefaultPolicy7B897426": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": [
"appconfig:GetLatestConfiguration",
"appconfig:StartConfigurationSession"
],
"Effect": "Allow",
"Resource": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":appconfig:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":application/",
{
"Ref": "MyApplicationForEnv1F597ED9"
},
"/environment/",
{
"Ref": "MyEnvironment465E4DEA"
},
"/configuration/*"
]
]
}
}
],
"Version": "2012-10-17"
},
"PolicyName": "MyUserDefaultPolicy7B897426",
"Users": [
{
"Ref": "MyUserDC45028B"
}
]
}
}
},
"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."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c8f2646

Please sign in to comment.