UNPKG

513 kBJSONView Raw
1{
2 "version": "2",
3 "toolVersion": "1.60.0",
4 "snippets": {
5 "edabba41c5da9d9ee34bd56c11f3da159cc14f27a29dc722a4daf6cacd2c1050": {
6 "translations": {
7 "python": {
8 "source": "role = Role(self, \"MyRole\",\n assumed_by=ServicePrincipal(\"sns.amazonaws.com\")\n)\n\nrole.add_to_policy(PolicyStatement(\n resources=[\"*\"],\n actions=[\"lambda:InvokeFunction\"]\n))",
9 "version": "2"
10 },
11 "csharp": {
12 "source": "Role role = new Role(this, \"MyRole\", new RoleProps {\n AssumedBy = new ServicePrincipal(\"sns.amazonaws.com\")\n});\n\nrole.AddToPolicy(new PolicyStatement(new PolicyStatementProps {\n Resources = new [] { \"*\" },\n Actions = new [] { \"lambda:InvokeFunction\" }\n}));",
13 "version": "1"
14 },
15 "java": {
16 "source": "Role role = Role.Builder.create(this, \"MyRole\")\n .assumedBy(new ServicePrincipal(\"sns.amazonaws.com\"))\n .build();\n\nrole.addToPolicy(PolicyStatement.Builder.create()\n .resources(List.of(\"*\"))\n .actions(List.of(\"lambda:InvokeFunction\"))\n .build());",
17 "version": "1"
18 },
19 "go": {
20 "source": "role := lib.NewRole(this, jsii.String(\"MyRole\"), &roleProps{\n\tassumedBy: *lib.NewServicePrincipal(jsii.String(\"sns.amazonaws.com\")),\n})\n\nrole.addToPolicy(lib.NewPolicyStatement(&policyStatementProps{\n\tresources: []*string{\n\t\tjsii.String(\"*\"),\n\t},\n\tactions: []*string{\n\t\tjsii.String(\"lambda:InvokeFunction\"),\n\t},\n}))",
21 "version": "1"
22 },
23 "$": {
24 "source": " const role = new Role(this, 'MyRole', {\n assumedBy: new ServicePrincipal('sns.amazonaws.com'),\n });\n\n role.addToPolicy(new PolicyStatement({\n resources: ['*'],\n actions: ['lambda:InvokeFunction'],\n }));",
25 "version": "0"
26 }
27 },
28 "location": {
29 "api": {
30 "api": "moduleReadme",
31 "moduleFqn": "@aws-cdk/aws-iam"
32 },
33 "field": {
34 "field": "markdown",
35 "line": 17
36 }
37 },
38 "didCompile": true,
39 "fqnsReferenced": [
40 "@aws-cdk/aws-iam.IPrincipal",
41 "@aws-cdk/aws-iam.PolicyStatement",
42 "@aws-cdk/aws-iam.PolicyStatementProps",
43 "@aws-cdk/aws-iam.Role",
44 "@aws-cdk/aws-iam.Role#addToPolicy",
45 "@aws-cdk/aws-iam.RoleProps",
46 "@aws-cdk/aws-iam.ServicePrincipal",
47 "constructs.Construct"
48 ],
49 "fullSource": "import * as constructs from 'constructs';\nimport { PolicyStatement, Role, ServicePrincipal } from '../lib';\n\n// keep this import separate from other imports to reduce chance for merge conflicts with v2-main\n// eslint-disable-next-line no-duplicate-imports, import/order\nimport { Construct } from '@aws-cdk/core';\n\nexport class ExampleConstruct extends Construct {\n constructor(scope: constructs.Construct, id: string) {\n super(scope, id);\n\n /// !show\n const role = new Role(this, 'MyRole', {\n assumedBy: new ServicePrincipal('sns.amazonaws.com'),\n });\n\n role.addToPolicy(new PolicyStatement({\n resources: ['*'],\n actions: ['lambda:InvokeFunction'],\n }));\n /// !hide\n }\n}\n",
50 "syntaxKindCounter": {
51 "10": 4,
52 "75": 9,
53 "104": 1,
54 "192": 2,
55 "193": 2,
56 "194": 1,
57 "196": 1,
58 "197": 3,
59 "225": 1,
60 "226": 1,
61 "242": 1,
62 "243": 1,
63 "281": 3
64 },
65 "fqnsFingerprint": "0097c36abcca2062ce3cb3a933268aaa973fe9cd2127ae577355c4ede846bd6a"
66 },
67 "38b37167723c4421f6f32a6cf5cb2af49ff47a60c0dcf3998015418ae0fc2a95": {
68 "translations": {
69 "python": {
70 "source": "user = User(self, \"MyUser\", password=cdk.SecretValue.unsafe_plain_text(\"1234\"))\ngroup = Group(self, \"MyGroup\")\n\npolicy = Policy(self, \"MyPolicy\")\npolicy.attach_to_user(user)\ngroup.attach_inline_policy(policy)",
71 "version": "2"
72 },
73 "csharp": {
74 "source": "User user = new User(this, \"MyUser\", new UserProps { Password = SecretValue.UnsafePlainText(\"1234\") });\nGroup group = new Group(this, \"MyGroup\");\n\nPolicy policy = new Policy(this, \"MyPolicy\");\npolicy.AttachToUser(user);\ngroup.AttachInlinePolicy(policy);",
75 "version": "1"
76 },
77 "java": {
78 "source": "User user = User.Builder.create(this, \"MyUser\").password(SecretValue.unsafePlainText(\"1234\")).build();\nGroup group = new Group(this, \"MyGroup\");\n\nPolicy policy = new Policy(this, \"MyPolicy\");\npolicy.attachToUser(user);\ngroup.attachInlinePolicy(policy);",
79 "version": "1"
80 },
81 "go": {
82 "source": "user := lib.NewUser(this, jsii.String(\"MyUser\"), &userProps{\n\tpassword: cdk.secretValue.unsafePlainText(jsii.String(\"1234\")),\n})\ngroup := lib.NewGroup(this, jsii.String(\"MyGroup\"))\n\npolicy := lib.NewPolicy(this, jsii.String(\"MyPolicy\"))\npolicy.attachToUser(user)\ngroup.attachInlinePolicy(policy)",
83 "version": "1"
84 },
85 "$": {
86 "source": " const user = new User(this, 'MyUser', { password: cdk.SecretValue.unsafePlainText('1234') });\n const group = new Group(this, 'MyGroup');\n\n const policy = new Policy(this, 'MyPolicy');\n policy.attachToUser(user);\n group.attachInlinePolicy(policy);",
87 "version": "0"
88 }
89 },
90 "location": {
91 "api": {
92 "api": "moduleReadme",
93 "moduleFqn": "@aws-cdk/aws-iam"
94 },
95 "field": {
96 "field": "markdown",
97 "line": 31
98 }
99 },
100 "didCompile": true,
101 "fqnsReferenced": [
102 "@aws-cdk/aws-iam.Group",
103 "@aws-cdk/aws-iam.IUser",
104 "@aws-cdk/aws-iam.Policy",
105 "@aws-cdk/aws-iam.Policy#attachToUser",
106 "@aws-cdk/aws-iam.User",
107 "@aws-cdk/aws-iam.UserProps",
108 "@aws-cdk/core.SecretValue",
109 "@aws-cdk/core.SecretValue#unsafePlainText",
110 "constructs.Construct"
111 ],
112 "fullSource": "import * as cdk from '@aws-cdk/core';\nimport * as constructs from 'constructs';\nimport { Group, Policy, User } from '../lib';\n\n// keep this import separate from other imports to reduce chance for merge conflicts with v2-main\n// eslint-disable-next-line no-duplicate-imports, import/order\nimport { Construct } from '@aws-cdk/core';\n\nexport class ExampleConstruct extends Construct {\n constructor(scope: constructs.Construct, id: string) {\n super(scope, id);\n\n /// !show\n const user = new User(this, 'MyUser', { password: cdk.SecretValue.unsafePlainText('1234') });\n const group = new Group(this, 'MyGroup');\n\n const policy = new Policy(this, 'MyPolicy');\n policy.attachToUser(user);\n group.attachInlinePolicy(policy);\n /// !hide\n }\n}\n",
113 "syntaxKindCounter": {
114 "10": 4,
115 "75": 16,
116 "104": 3,
117 "193": 1,
118 "194": 4,
119 "196": 3,
120 "197": 3,
121 "225": 3,
122 "226": 2,
123 "242": 3,
124 "243": 3,
125 "281": 1
126 },
127 "fqnsFingerprint": "13df7914459f4f8453db458eb281a08de7f32eb1d09e32f8cbdba51b7b8e92aa"
128 },
129 "fd41528b3cbd6b346e84f9eee59ae90ac0a3d9192aab58a04930b1ba8572c469": {
130 "translations": {
131 "python": {
132 "source": "group = Group(self, \"MyGroup\")\ngroup.add_managed_policy(ManagedPolicy.from_aws_managed_policy_name(\"AdministratorAccess\"))",
133 "version": "2"
134 },
135 "csharp": {
136 "source": "Group group = new Group(this, \"MyGroup\");\ngroup.AddManagedPolicy(ManagedPolicy.FromAwsManagedPolicyName(\"AdministratorAccess\"));",
137 "version": "1"
138 },
139 "java": {
140 "source": "Group group = new Group(this, \"MyGroup\");\ngroup.addManagedPolicy(ManagedPolicy.fromAwsManagedPolicyName(\"AdministratorAccess\"));",
141 "version": "1"
142 },
143 "go": {
144 "source": "group := lib.NewGroup(this, jsii.String(\"MyGroup\"))\ngroup.addManagedPolicy(lib.ManagedPolicy.fromAwsManagedPolicyName(jsii.String(\"AdministratorAccess\")))",
145 "version": "1"
146 },
147 "$": {
148 "source": "const group = new Group(this, 'MyGroup');\ngroup.addManagedPolicy(ManagedPolicy.fromAwsManagedPolicyName('AdministratorAccess'));",
149 "version": "0"
150 }
151 },
152 "location": {
153 "api": {
154 "api": "moduleReadme",
155 "moduleFqn": "@aws-cdk/aws-iam"
156 },
157 "field": {
158 "field": "markdown",
159 "line": 42
160 }
161 },
162 "didCompile": true,
163 "fqnsReferenced": [
164 "@aws-cdk/aws-iam.Group",
165 "@aws-cdk/aws-iam.Group#addManagedPolicy",
166 "@aws-cdk/aws-iam.IManagedPolicy",
167 "@aws-cdk/aws-iam.ManagedPolicy#fromAwsManagedPolicyName",
168 "constructs.Construct"
169 ],
170 "fullSource": "import * as constructs from 'constructs';\nimport { Group, ManagedPolicy } from '../lib';\n\n// keep this import separate from other imports to reduce chance for merge conflicts with v2-main\n// eslint-disable-next-line no-duplicate-imports, import/order\nimport { Construct } from '@aws-cdk/core';\n\nexport class ExampleConstruct extends Construct {\n constructor(scope: constructs.Construct, id: string) {\n super(scope, id);\n\n /// !show\n const group = new Group(this, 'MyGroup');\n group.addManagedPolicy(ManagedPolicy.fromAwsManagedPolicyName('AdministratorAccess'));\n /// !hide\n }\n}\n",
171 "syntaxKindCounter": {
172 "10": 2,
173 "75": 6,
174 "104": 1,
175 "194": 2,
176 "196": 2,
177 "197": 1,
178 "225": 1,
179 "226": 1,
180 "242": 1,
181 "243": 1
182 },
183 "fqnsFingerprint": "8cdbdfa4f1a0061979f1817be54bc9fda291cb5876955acbd179be2deb29b9f1"
184 },
185 "53fe6253cd9d35289ebc06b836e7a1a91e19da4c47eb8fb38cb71d6a6c99d5f3": {
186 "translations": {
187 "python": {
188 "source": "# fn: lambda.Function\n# table: dynamodb.Table\n\n\ntable.grant_write_data(fn)",
189 "version": "2"
190 },
191 "csharp": {
192 "source": "Function fn;\nTable table;\n\n\ntable.GrantWriteData(fn);",
193 "version": "1"
194 },
195 "java": {
196 "source": "Function fn;\nTable table;\n\n\ntable.grantWriteData(fn);",
197 "version": "1"
198 },
199 "go": {
200 "source": "var fn function\nvar table table\n\n\ntable.grantWriteData(fn)",
201 "version": "1"
202 },
203 "$": {
204 "source": "declare const fn: lambda.Function;\ndeclare const table: dynamodb.Table;\n\ntable.grantWriteData(fn);",
205 "version": "0"
206 }
207 },
208 "location": {
209 "api": {
210 "api": "moduleReadme",
211 "moduleFqn": "@aws-cdk/aws-iam"
212 },
213 "field": {
214 "field": "markdown",
215 "line": 51
216 }
217 },
218 "didCompile": true,
219 "fqnsReferenced": [
220 "@aws-cdk/aws-iam.IGrantable"
221 ],
222 "fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const fn: lambda.Function;\ndeclare const table: dynamodb.Table;\n/// !hide\n// Hoisted imports ended before !hide marker above\nimport { Construct } from 'constructs';\nimport { CustomResource, Stack } from '@aws-cdk/core';\nimport * as codepipeline from '@aws-cdk/aws-codepipeline';\nimport * as dynamodb from '@aws-cdk/aws-dynamodb';\nimport * as lambda from '@aws-cdk/aws-lambda';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\ntable.grantWriteData(fn);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
223 "syntaxKindCounter": {
224 "75": 9,
225 "130": 2,
226 "153": 2,
227 "169": 2,
228 "194": 1,
229 "196": 1,
230 "225": 2,
231 "226": 1,
232 "242": 2,
233 "243": 2,
234 "290": 1
235 },
236 "fqnsFingerprint": "1323b60ab94a88d4cf4c7c846ab0af5927a24713050028234cb9426c28ace47b"
237 },
238 "7808076bfee1b7971cc05930d4cebf8507933ada771a07e618c45d2a7dcf081f": {
239 "translations": {
240 "python": {
241 "source": "# fn: lambda.Function\n# table: dynamodb.Table\n\n\ntable.grant(fn, \"dynamodb:PutItem\")",
242 "version": "2"
243 },
244 "csharp": {
245 "source": "Function fn;\nTable table;\n\n\ntable.Grant(fn, \"dynamodb:PutItem\");",
246 "version": "1"
247 },
248 "java": {
249 "source": "Function fn;\nTable table;\n\n\ntable.grant(fn, \"dynamodb:PutItem\");",
250 "version": "1"
251 },
252 "go": {
253 "source": "var fn function\nvar table table\n\n\ntable.grant(fn, jsii.String(\"dynamodb:PutItem\"))",
254 "version": "1"
255 },
256 "$": {
257 "source": "declare const fn: lambda.Function;\ndeclare const table: dynamodb.Table;\n\ntable.grant(fn, 'dynamodb:PutItem');",
258 "version": "0"
259 }
260 },
261 "location": {
262 "api": {
263 "api": "moduleReadme",
264 "moduleFqn": "@aws-cdk/aws-iam"
265 },
266 "field": {
267 "field": "markdown",
268 "line": 60
269 }
270 },
271 "didCompile": true,
272 "fqnsReferenced": [
273 "@aws-cdk/aws-iam.IGrantable"
274 ],
275 "fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const fn: lambda.Function;\ndeclare const table: dynamodb.Table;\n/// !hide\n// Hoisted imports ended before !hide marker above\nimport { Construct } from 'constructs';\nimport { CustomResource, Stack } from '@aws-cdk/core';\nimport * as codepipeline from '@aws-cdk/aws-codepipeline';\nimport * as dynamodb from '@aws-cdk/aws-dynamodb';\nimport * as lambda from '@aws-cdk/aws-lambda';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\ntable.grant(fn, 'dynamodb:PutItem');\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
276 "syntaxKindCounter": {
277 "10": 1,
278 "75": 9,
279 "130": 2,
280 "153": 2,
281 "169": 2,
282 "194": 1,
283 "196": 1,
284 "225": 2,
285 "226": 1,
286 "242": 2,
287 "243": 2,
288 "290": 1
289 },
290 "fqnsFingerprint": "1323b60ab94a88d4cf4c7c846ab0af5927a24713050028234cb9426c28ace47b"
291 },
292 "1afb0ac33880703dd032b083bc9d22bacd2581ea5480e33204c5f6689bad8cef": {
293 "translations": {
294 "python": {
295 "source": "role = iam.Role(self, \"Role\",\n assumed_by=iam.ServicePrincipal(\"codepipeline.amazonaws.com\"),\n # custom description if desired\n description=\"This is a custom role...\"\n)\n\ncodepipeline.Pipeline(self, \"Pipeline\",\n # Give the Pipeline an immutable view of the Role\n role=role.without_policy_updates()\n)\n\n# You now have to manage the Role policies yourself\nrole.add_to_policy(iam.PolicyStatement(\n actions=[],\n resources=[]\n))",
296 "version": "2"
297 },
298 "csharp": {
299 "source": "Role role = new Role(this, \"Role\", new RoleProps {\n AssumedBy = new ServicePrincipal(\"codepipeline.amazonaws.com\"),\n // custom description if desired\n Description = \"This is a custom role...\"\n});\n\nnew Pipeline(this, \"Pipeline\", new PipelineProps {\n // Give the Pipeline an immutable view of the Role\n Role = role.WithoutPolicyUpdates()\n});\n\n// You now have to manage the Role policies yourself\nrole.AddToPolicy(new PolicyStatement(new PolicyStatementProps {\n Actions = new [] { },\n Resources = new [] { }\n}));",
300 "version": "1"
301 },
302 "java": {
303 "source": "Role role = Role.Builder.create(this, \"Role\")\n .assumedBy(new ServicePrincipal(\"codepipeline.amazonaws.com\"))\n // custom description if desired\n .description(\"This is a custom role...\")\n .build();\n\nPipeline.Builder.create(this, \"Pipeline\")\n // Give the Pipeline an immutable view of the Role\n .role(role.withoutPolicyUpdates())\n .build();\n\n// You now have to manage the Role policies yourself\nrole.addToPolicy(PolicyStatement.Builder.create()\n .actions(List.of())\n .resources(List.of())\n .build());",
304 "version": "1"
305 },
306 "go": {
307 "source": "role := iam.NewRole(this, jsii.String(\"Role\"), &roleProps{\n\tassumedBy: iam.NewServicePrincipal(jsii.String(\"codepipeline.amazonaws.com\")),\n\t// custom description if desired\n\tdescription: jsii.String(\"This is a custom role...\"),\n})\n\ncodepipeline.NewPipeline(this, jsii.String(\"Pipeline\"), &pipelineProps{\n\t// Give the Pipeline an immutable view of the Role\n\trole: role.withoutPolicyUpdates(),\n})\n\n// You now have to manage the Role policies yourself\nrole.addToPolicy(iam.NewPolicyStatement(&policyStatementProps{\n\tactions: []*string{\n\t},\n\tresources: []*string{\n\t},\n}))",
308 "version": "1"
309 },
310 "$": {
311 "source": "const role = new iam.Role(this, 'Role', {\n assumedBy: new iam.ServicePrincipal('codepipeline.amazonaws.com'),\n // custom description if desired\n description: 'This is a custom role...',\n});\n\nnew codepipeline.Pipeline(this, 'Pipeline', {\n // Give the Pipeline an immutable view of the Role\n role: role.withoutPolicyUpdates(),\n});\n\n// You now have to manage the Role policies yourself\nrole.addToPolicy(new iam.PolicyStatement({\n actions: [/* whatever actions you want */],\n resources: [/* whatever resources you intend to touch */],\n}));",
312 "version": "0"
313 }
314 },
315 "location": {
316 "api": {
317 "api": "moduleReadme",
318 "moduleFqn": "@aws-cdk/aws-iam"
319 },
320 "field": {
321 "field": "markdown",
322 "line": 108
323 }
324 },
325 "didCompile": true,
326 "fqnsReferenced": [
327 "@aws-cdk/aws-codepipeline.Pipeline",
328 "@aws-cdk/aws-codepipeline.PipelineProps",
329 "@aws-cdk/aws-iam.IPrincipal",
330 "@aws-cdk/aws-iam.IRole",
331 "@aws-cdk/aws-iam.PolicyStatement",
332 "@aws-cdk/aws-iam.PolicyStatementProps",
333 "@aws-cdk/aws-iam.Role",
334 "@aws-cdk/aws-iam.Role#addToPolicy",
335 "@aws-cdk/aws-iam.Role#withoutPolicyUpdates",
336 "@aws-cdk/aws-iam.RoleProps",
337 "@aws-cdk/aws-iam.ServicePrincipal",
338 "constructs.Construct"
339 ],
340 "fullSource": "import { Construct } from 'constructs';\nimport { CustomResource, Stack } from '@aws-cdk/core';\nimport * as codepipeline from '@aws-cdk/aws-codepipeline';\nimport * as dynamodb from '@aws-cdk/aws-dynamodb';\nimport * as lambda from '@aws-cdk/aws-lambda';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst role = new iam.Role(this, 'Role', {\n assumedBy: new iam.ServicePrincipal('codepipeline.amazonaws.com'),\n // custom description if desired\n description: 'This is a custom role...',\n});\n\nnew codepipeline.Pipeline(this, 'Pipeline', {\n // Give the Pipeline an immutable view of the Role\n role: role.withoutPolicyUpdates(),\n});\n\n// You now have to manage the Role policies yourself\nrole.addToPolicy(new iam.PolicyStatement({\n actions: [/* whatever actions you want */],\n resources: [/* whatever resources you intend to touch */],\n}));\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
341 "syntaxKindCounter": {
342 "10": 4,
343 "75": 18,
344 "104": 2,
345 "192": 2,
346 "193": 3,
347 "194": 6,
348 "196": 2,
349 "197": 4,
350 "225": 1,
351 "226": 2,
352 "242": 1,
353 "243": 1,
354 "281": 5
355 },
356 "fqnsFingerprint": "a5b1c3cfed5b10e83fe8c93baf71034d4933828a59e0f11361f35c6ceb4646c1"
357 },
358 "57f2aeb5a6ff0f3a68f45b3e37b6dcdc14ab44f9b3e7ab398a2cf91333033eba": {
359 "translations": {
360 "python": {
361 "source": "role = iam.Role.from_role_arn(self, \"Role\", \"arn:aws:iam::123456789012:role/MyExistingRole\",\n # Set 'mutable' to 'false' to use the role as-is and prevent adding new\n # policies to it. The default is 'true', which means the role may be\n # modified as part of the deployment.\n mutable=False\n)",
362 "version": "2"
363 },
364 "csharp": {
365 "source": "IRole role = Role.FromRoleArn(this, \"Role\", \"arn:aws:iam::123456789012:role/MyExistingRole\", new FromRoleArnOptions {\n // Set 'mutable' to 'false' to use the role as-is and prevent adding new\n // policies to it. The default is 'true', which means the role may be\n // modified as part of the deployment.\n Mutable = false\n});",
366 "version": "1"
367 },
368 "java": {
369 "source": "IRole role = Role.fromRoleArn(this, \"Role\", \"arn:aws:iam::123456789012:role/MyExistingRole\", FromRoleArnOptions.builder()\n // Set 'mutable' to 'false' to use the role as-is and prevent adding new\n // policies to it. The default is 'true', which means the role may be\n // modified as part of the deployment.\n .mutable(false)\n .build());",
370 "version": "1"
371 },
372 "go": {
373 "source": "role := iam.role.fromRoleArn(this, jsii.String(\"Role\"), jsii.String(\"arn:aws:iam::123456789012:role/MyExistingRole\"), &fromRoleArnOptions{\n\t// Set 'mutable' to 'false' to use the role as-is and prevent adding new\n\t// policies to it. The default is 'true', which means the role may be\n\t// modified as part of the deployment.\n\tmutable: jsii.Boolean(false),\n})",
374 "version": "1"
375 },
376 "$": {
377 "source": "const role = iam.Role.fromRoleArn(this, 'Role', 'arn:aws:iam::123456789012:role/MyExistingRole', {\n // Set 'mutable' to 'false' to use the role as-is and prevent adding new\n // policies to it. The default is 'true', which means the role may be\n // modified as part of the deployment.\n mutable: false,\n});",
378 "version": "0"
379 }
380 },
381 "location": {
382 "api": {
383 "api": "moduleReadme",
384 "moduleFqn": "@aws-cdk/aws-iam"
385 },
386 "field": {
387 "field": "markdown",
388 "line": 133
389 }
390 },
391 "didCompile": true,
392 "fqnsReferenced": [
393 "@aws-cdk/aws-iam.FromRoleArnOptions",
394 "@aws-cdk/aws-iam.IRole",
395 "@aws-cdk/aws-iam.Role",
396 "@aws-cdk/aws-iam.Role#fromRoleArn",
397 "constructs.Construct"
398 ],
399 "fullSource": "import { Construct } from 'constructs';\nimport { CustomResource, Stack } from '@aws-cdk/core';\nimport * as codepipeline from '@aws-cdk/aws-codepipeline';\nimport * as dynamodb from '@aws-cdk/aws-dynamodb';\nimport * as lambda from '@aws-cdk/aws-lambda';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst role = iam.Role.fromRoleArn(this, 'Role', 'arn:aws:iam::123456789012:role/MyExistingRole', {\n // Set 'mutable' to 'false' to use the role as-is and prevent adding new\n // policies to it. The default is 'true', which means the role may be\n // modified as part of the deployment.\n mutable: false,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
400 "syntaxKindCounter": {
401 "10": 2,
402 "75": 5,
403 "91": 1,
404 "104": 1,
405 "193": 1,
406 "194": 2,
407 "196": 1,
408 "225": 1,
409 "242": 1,
410 "243": 1,
411 "281": 1
412 },
413 "fqnsFingerprint": "d59ead6b111c144ce48ba250d04b67747510348aae95424e9fc5531d081fc7e7"
414 },
415 "30dbf807e3c41b86a361ec7acaa98d45dfca7cef387e09f959c509d44336d21f": {
416 "translations": {
417 "python": {
418 "source": "role = iam.Role(self, \"MyRole\",\n assumed_by=iam.AccountPrincipal(\"123456789012\"),\n external_ids=[\"SUPPLY-ME\"]\n)",
419 "version": "2"
420 },
421 "csharp": {
422 "source": "Role role = new Role(this, \"MyRole\", new RoleProps {\n AssumedBy = new AccountPrincipal(\"123456789012\"),\n ExternalIds = new [] { \"SUPPLY-ME\" }\n});",
423 "version": "1"
424 },
425 "java": {
426 "source": "Role role = Role.Builder.create(this, \"MyRole\")\n .assumedBy(new AccountPrincipal(\"123456789012\"))\n .externalIds(List.of(\"SUPPLY-ME\"))\n .build();",
427 "version": "1"
428 },
429 "go": {
430 "source": "role := iam.NewRole(this, jsii.String(\"MyRole\"), &roleProps{\n\tassumedBy: iam.NewAccountPrincipal(jsii.String(\"123456789012\")),\n\texternalIds: []*string{\n\t\tjsii.String(\"SUPPLY-ME\"),\n\t},\n})",
431 "version": "1"
432 },
433 "$": {
434 "source": "const role = new iam.Role(this, 'MyRole', {\n assumedBy: new iam.AccountPrincipal('123456789012'),\n externalIds: ['SUPPLY-ME'],\n});",
435 "version": "0"
436 }
437 },
438 "location": {
439 "api": {
440 "api": "moduleReadme",
441 "moduleFqn": "@aws-cdk/aws-iam"
442 },
443 "field": {
444 "field": "markdown",
445 "line": 148
446 }
447 },
448 "didCompile": true,
449 "fqnsReferenced": [
450 "@aws-cdk/aws-iam.AccountPrincipal",
451 "@aws-cdk/aws-iam.IPrincipal",
452 "@aws-cdk/aws-iam.Role",
453 "@aws-cdk/aws-iam.RoleProps",
454 "constructs.Construct"
455 ],
456 "fullSource": "import * as constructs from 'constructs';\nimport * as iam from '../lib';\n\n// keep this import separate from other imports to reduce chance for merge conflicts with v2-main\n// eslint-disable-next-line no-duplicate-imports, import/order\nimport { Construct } from '@aws-cdk/core';\n\nexport class ExampleConstruct extends Construct {\n constructor(scope: constructs.Construct, id: string) {\n super(scope, id);\n\n /// !show\n const role = new iam.Role(this, 'MyRole', {\n assumedBy: new iam.AccountPrincipal('123456789012'),\n externalIds: ['SUPPLY-ME'],\n });\n /// !hide\n\n Array.isArray(role);\n }\n}\n",
457 "syntaxKindCounter": {
458 "10": 3,
459 "75": 7,
460 "104": 1,
461 "192": 1,
462 "193": 1,
463 "194": 2,
464 "197": 2,
465 "225": 1,
466 "242": 1,
467 "243": 1,
468 "281": 2
469 },
470 "fqnsFingerprint": "1f8de24a0f27120fb3c9d517cd1c2e8e30670095fbfcd13299b8be26aaa36f71"
471 },
472 "fe5f92331f4a13ffac2fc300e8ef04d1348da847f50affdd14853f4495ca127f": {
473 "translations": {
474 "python": {
475 "source": "statement = iam.PolicyStatement()\nstatement.add_service_principal(\"cloudwatch.amazonaws.com\")\nstatement.add_service_principal(\"ec2.amazonaws.com\")\nstatement.add_arn_principal(\"arn:aws:boom:boom\")",
476 "version": "2"
477 },
478 "csharp": {
479 "source": "PolicyStatement statement = new PolicyStatement();\nstatement.AddServicePrincipal(\"cloudwatch.amazonaws.com\");\nstatement.AddServicePrincipal(\"ec2.amazonaws.com\");\nstatement.AddArnPrincipal(\"arn:aws:boom:boom\");",
480 "version": "1"
481 },
482 "java": {
483 "source": "PolicyStatement statement = new PolicyStatement();\nstatement.addServicePrincipal(\"cloudwatch.amazonaws.com\");\nstatement.addServicePrincipal(\"ec2.amazonaws.com\");\nstatement.addArnPrincipal(\"arn:aws:boom:boom\");",
484 "version": "1"
485 },
486 "go": {
487 "source": "statement := iam.NewPolicyStatement()\nstatement.addServicePrincipal(jsii.String(\"cloudwatch.amazonaws.com\"))\nstatement.addServicePrincipal(jsii.String(\"ec2.amazonaws.com\"))\nstatement.addArnPrincipal(jsii.String(\"arn:aws:boom:boom\"))",
488 "version": "1"
489 },
490 "$": {
491 "source": "const statement = new iam.PolicyStatement();\nstatement.addServicePrincipal('cloudwatch.amazonaws.com');\nstatement.addServicePrincipal('ec2.amazonaws.com');\nstatement.addArnPrincipal('arn:aws:boom:boom');",
492 "version": "0"
493 }
494 },
495 "location": {
496 "api": {
497 "api": "moduleReadme",
498 "moduleFqn": "@aws-cdk/aws-iam"
499 },
500 "field": {
501 "field": "markdown",
502 "line": 188
503 }
504 },
505 "didCompile": true,
506 "fqnsReferenced": [
507 "@aws-cdk/aws-iam.PolicyStatement",
508 "@aws-cdk/aws-iam.PolicyStatement#addArnPrincipal",
509 "@aws-cdk/aws-iam.PolicyStatement#addServicePrincipal"
510 ],
511 "fullSource": "import { Construct } from 'constructs';\nimport { CustomResource, Stack } from '@aws-cdk/core';\nimport * as codepipeline from '@aws-cdk/aws-codepipeline';\nimport * as dynamodb from '@aws-cdk/aws-dynamodb';\nimport * as lambda from '@aws-cdk/aws-lambda';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst statement = new iam.PolicyStatement();\nstatement.addServicePrincipal('cloudwatch.amazonaws.com');\nstatement.addServicePrincipal('ec2.amazonaws.com');\nstatement.addArnPrincipal('arn:aws:boom:boom');\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
512 "syntaxKindCounter": {
513 "10": 3,
514 "75": 9,
515 "194": 4,
516 "196": 3,
517 "197": 1,
518 "225": 1,
519 "226": 3,
520 "242": 1,
521 "243": 1
522 },
523 "fqnsFingerprint": "bb83b5ba714e8224519798a9b185ced6a3767f71b29aaf07e3381cb76da4a20b"
524 },
525 "93ab0d764e7e4d09aa521f42b8805b64417e055a8ad032f8cf6cdea622d1020b": {
526 "translations": {
527 "python": {
528 "source": "role = iam.Role(self, \"MyRole\",\n assumed_by=iam.CompositePrincipal(\n iam.ServicePrincipal(\"ec2.amazonaws.com\"),\n iam.AccountPrincipal(\"1818188181818187272\"))\n)",
529 "version": "2"
530 },
531 "csharp": {
532 "source": "Role role = new Role(this, \"MyRole\", new RoleProps {\n AssumedBy = new CompositePrincipal(\n new ServicePrincipal(\"ec2.amazonaws.com\"),\n new AccountPrincipal(\"1818188181818187272\"))\n});",
533 "version": "1"
534 },
535 "java": {
536 "source": "Role role = Role.Builder.create(this, \"MyRole\")\n .assumedBy(new CompositePrincipal(\n new ServicePrincipal(\"ec2.amazonaws.com\"),\n new AccountPrincipal(\"1818188181818187272\")))\n .build();",
537 "version": "1"
538 },
539 "go": {
540 "source": "role := iam.NewRole(this, jsii.String(\"MyRole\"), &roleProps{\n\tassumedBy: iam.NewCompositePrincipal(\n\tiam.NewServicePrincipal(jsii.String(\"ec2.amazonaws.com\")),\n\tiam.NewAccountPrincipal(jsii.String(\"1818188181818187272\"))),\n})",
541 "version": "1"
542 },
543 "$": {
544 "source": "const role = new iam.Role(this, 'MyRole', {\n assumedBy: new iam.CompositePrincipal(\n new iam.ServicePrincipal('ec2.amazonaws.com'),\n new iam.AccountPrincipal('1818188181818187272')\n ),\n});",
545 "version": "0"
546 }
547 },
548 "location": {
549 "api": {
550 "api": "moduleReadme",
551 "moduleFqn": "@aws-cdk/aws-iam"
552 },
553 "field": {
554 "field": "markdown",
555 "line": 208
556 }
557 },
558 "didCompile": true,
559 "fqnsReferenced": [
560 "@aws-cdk/aws-iam.AccountPrincipal",
561 "@aws-cdk/aws-iam.CompositePrincipal",
562 "@aws-cdk/aws-iam.IPrincipal",
563 "@aws-cdk/aws-iam.Role",
564 "@aws-cdk/aws-iam.RoleProps",
565 "@aws-cdk/aws-iam.ServicePrincipal",
566 "constructs.Construct"
567 ],
568 "fullSource": "import { Construct } from 'constructs';\nimport { CustomResource, Stack } from '@aws-cdk/core';\nimport * as codepipeline from '@aws-cdk/aws-codepipeline';\nimport * as dynamodb from '@aws-cdk/aws-dynamodb';\nimport * as lambda from '@aws-cdk/aws-lambda';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst role = new iam.Role(this, 'MyRole', {\n assumedBy: new iam.CompositePrincipal(\n new iam.ServicePrincipal('ec2.amazonaws.com'),\n new iam.AccountPrincipal('1818188181818187272')\n ),\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
569 "syntaxKindCounter": {
570 "10": 3,
571 "75": 10,
572 "104": 1,
573 "193": 1,
574 "194": 4,
575 "197": 4,
576 "225": 1,
577 "242": 1,
578 "243": 1,
579 "281": 1
580 },
581 "fqnsFingerprint": "812186ece47a914ecb7375bfaa4f63f69d0ca69652d78f2087c589de45b4c2af"
582 },
583 "d6447173e9537c5ebbcdf340d784ef18d92896f6badf647a84c615e69a62def5": {
584 "translations": {
585 "python": {
586 "source": "principal = iam.AccountPrincipal(\"123456789000\").with_conditions({\"StringEquals\": {\"foo\": \"baz\"}})",
587 "version": "2"
588 },
589 "csharp": {
590 "source": "PrincipalBase principal = new AccountPrincipal(\"123456789000\").WithConditions(new Dictionary<string, object> { { \"StringEquals\", new Dictionary<string, string> { { \"foo\", \"baz\" } } } });",
591 "version": "1"
592 },
593 "java": {
594 "source": "PrincipalBase principal = new AccountPrincipal(\"123456789000\").withConditions(Map.of(\"StringEquals\", Map.of(\"foo\", \"baz\")));",
595 "version": "1"
596 },
597 "go": {
598 "source": "principal := iam.NewAccountPrincipal(jsii.String(\"123456789000\")).withConditions(map[string]interface{}{\n\t\"StringEquals\": map[string]*string{\n\t\t\"foo\": jsii.String(\"baz\"),\n\t},\n})",
599 "version": "1"
600 },
601 "$": {
602 "source": "const principal = new iam.AccountPrincipal('123456789000')\n .withConditions({ StringEquals: { foo: \"baz\" } });",
603 "version": "0"
604 }
605 },
606 "location": {
607 "api": {
608 "api": "moduleReadme",
609 "moduleFqn": "@aws-cdk/aws-iam"
610 },
611 "field": {
612 "field": "markdown",
613 "line": 222
614 }
615 },
616 "didCompile": true,
617 "fqnsReferenced": [
618 "@aws-cdk/aws-iam.AccountPrincipal",
619 "@aws-cdk/aws-iam.PrincipalBase",
620 "@aws-cdk/aws-iam.PrincipalBase#withConditions"
621 ],
622 "fullSource": "import { Construct } from 'constructs';\nimport { CustomResource, Stack } from '@aws-cdk/core';\nimport * as codepipeline from '@aws-cdk/aws-codepipeline';\nimport * as dynamodb from '@aws-cdk/aws-dynamodb';\nimport * as lambda from '@aws-cdk/aws-lambda';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst principal = new iam.AccountPrincipal('123456789000')\n .withConditions({ StringEquals: { foo: \"baz\" } });\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
623 "syntaxKindCounter": {
624 "10": 2,
625 "75": 6,
626 "193": 2,
627 "194": 2,
628 "196": 1,