Skip to content

Commit cbefa91

Browse files
committed
Add single cdk Deploy policy
1 parent 736f988 commit cbefa91

File tree

2 files changed

+62
-21
lines changed

2 files changed

+62
-21
lines changed

README.md

Lines changed: 62 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -114,27 +114,75 @@ If you have cloned this notebook into SageMaker Studio, you will need to add add
114114

115115
![\[AB Testing Pipeline Execution Role\]](docs/ab-testing-pipeline-execution-role.png)
116116

117-
Browse to the [IAM](https://console.aws.amazon.com/iam) section in the console, and find this role. Then attach the following managed policies.
118-
119-
* `AmazonAPIGatewayAdministrator`
120-
* `AmazonDynamoDBFullAccess`
121-
* `AmazonKinesisFirehoseFullAccess`
122-
* `CloudWatchEventsFullAccess`
123-
* `AWSCloudFormationFullAccess`
124-
* `AWSLambda_FullAccess`
125-
* `AWSServiceCatalogAdminFullAccess`
117+
Browse to the [IAM](https://console.aws.amazon.com/iam) section in the console, and find this role.
126118

127119
Then, click the **Add inline policy** link, switch to to the **JSON** tab, and paste the following inline policy:
128120

129121
```
130122
{
131123
"Version": "2012-10-17",
132124
"Statement": [
125+
{
126+
"Effect": "Allow",
127+
"Action": [
128+
"apigateway:*"
129+
],
130+
"Resource": "arn:aws:apigateway:*::/*"
131+
},
132+
{
133+
"Action": [
134+
"dynamodb:*"
135+
],
136+
"Effect": "Allow",
137+
"Resource": "arn:aws:dynamodb:*:*:table/ab-testing-*"
138+
},
139+
{
140+
"Action": [
141+
"lambda:*"
142+
],
143+
"Effect": "Allow",
144+
"Resource": [
145+
"arn:aws:lambda:*:*:function:ab-testing-api-*",
146+
"arn:aws:lambda:*:*:layer:*"
147+
]
148+
},
149+
{
150+
"Action": [
151+
"firehose:*"
152+
],
153+
"Effect": "Allow",
154+
"Resource": "arn:aws:firehose:*:*:deliverystream/ab-testing-*"
155+
},
156+
{
157+
"Action": [
158+
"s3:*"
159+
],
160+
"Effect": "Allow",
161+
"Resource": [
162+
"arn:aws:s3:::cdktoolkit-*",
163+
"arn:aws:s3:::ab-testing-api-*"
164+
]
165+
},
166+
{
167+
"Action": [
168+
"cloudformation:*",
169+
"servicecatalog:*",
170+
"events:*"
171+
],
172+
"Effect": "Allow",
173+
"Resource": "*"
174+
},
175+
{
176+
"Effect": "Allow",
177+
"Action": [
178+
"logs:*"
179+
],
180+
"Resource": "arn:aws:logs:**:*:log-group:ab-testing-api-*"
181+
},
133182
{
134183
"Effect": "Allow",
135184
"Action": [
136185
"iam:CreateRole",
137-
"iam:PassRole",
138186
"iam:DeleteRole"
139187
],
140188
"Resource": "arn:aws:iam::*:role/ab-testing-api-*"
@@ -143,30 +191,23 @@ Then, click the **Add inline policy** link, switch to to the **JSON** tab, and p
143191
"Effect": "Allow",
144192
"Action": [
145193
"iam:GetRole",
194+
"iam:PassRole",
195+
"iam:getRolePolicy",
146196
"iam:AttachRolePolicy",
147197
"iam:PutRolePolicy",
148198
"iam:DetachRolePolicy",
149199
"iam:DeleteRolePolicy"
150200
],
151201
"Resource": [
152202
"arn:aws:iam::*:role/ab-testing-api-*",
153-
"arn:aws:iam::*:role/service-role/AmazonSageMakerServiceCatalogProductsLaunchRole"
203+
"arn:aws:iam::*:role/service-role/AmazonSageMaker*"
154204
]
155-
},
156-
{
157-
"Effect": "Allow",
158-
"Action": [
159-
"logs:PutRetentionPolicy"
160-
],
161-
"Resource": "arn:aws:logs:**:*:log-group:ab-testing-api-*"
162205
}
163206
]
164207
}
165208
```
166209

167-
Click **Review policy** and provide the name `CDK-CreateRolePolicy` then click **Create policy**
168-
169-
![\[AB Testing Pipeline Execution Role\]](docs/ab-testing-pipeline-iam-role.png)
210+
Click **Review policy** and provide the name `CDK-DeployPolicy` then click **Create policy**
170211

171212
You should now be able to list the stacks by running:
172213

-60.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)