aws-cdk-github-oidc 2.4.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/API.md CHANGED
@@ -1,124 +1,1106 @@
1
- # API Reference <a name="API Reference"></a>
1
+ # API Reference <a name="API Reference" id="api-reference"></a>
2
2
 
3
- ## Constructs <a name="Constructs"></a>
3
+ ## Constructs <a name="Constructs" id="Constructs"></a>
4
4
 
5
- ### GithubActionsIdentityProvider <a name="aws-cdk-github-oidc.GithubActionsIdentityProvider"></a>
5
+ ### GithubActionsIdentityProvider <a name="GithubActionsIdentityProvider" id="aws-cdk-github-oidc.GithubActionsIdentityProvider"></a>
6
6
 
7
- - *Implements:* [`aws-cdk-github-oidc.IGithubActionsIdentityProvider`](#aws-cdk-github-oidc.IGithubActionsIdentityProvider)
7
+ - *Implements:* <a href="#aws-cdk-github-oidc.IGithubActionsIdentityProvider">IGithubActionsIdentityProvider</a>
8
8
 
9
9
  Github Actions as OpenID Connect Identity Provider for AWS IAM. There can be only one (per AWS Account).
10
10
 
11
11
  Use `fromAccount` to retrieve a reference to existing Github OIDC provider.
12
12
 
13
- > https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services
13
+ Uses the native CloudFormation resource AWS::IAM::OIDCProvider (no Lambda functions).
14
14
 
15
- #### Initializers <a name="aws-cdk-github-oidc.GithubActionsIdentityProvider.Initializer"></a>
15
+ > [https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services)
16
+
17
+ #### Initializers <a name="Initializers" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.Initializer"></a>
18
+
19
+ ```typescript
20
+ import { GithubActionsIdentityProvider } from 'aws-cdk-github-oidc'
21
+
22
+ new GithubActionsIdentityProvider(scope: Construct, id: string)
23
+ ```
24
+
25
+ | **Name** | **Type** | **Description** |
26
+ | --- | --- | --- |
27
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | CDK Stack or Construct to which the provider is assigned to. |
28
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.Initializer.parameter.id">id</a></code> | <code>string</code> | CDK Construct ID given to the construct. |
29
+
30
+ ---
31
+
32
+ ##### `scope`<sup>Required</sup> <a name="scope" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.Initializer.parameter.scope"></a>
33
+
34
+ - *Type:* constructs.Construct
35
+
36
+ CDK Stack or Construct to which the provider is assigned to.
37
+
38
+ ---
39
+
40
+ ##### `id`<sup>Required</sup> <a name="id" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.Initializer.parameter.id"></a>
41
+
42
+ - *Type:* string
43
+
44
+ CDK Construct ID given to the construct.
45
+
46
+ ---
47
+
48
+ #### Methods <a name="Methods" id="Methods"></a>
49
+
50
+ | **Name** | **Description** |
51
+ | --- | --- |
52
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.toString">toString</a></code> | Returns a string representation of this construct. |
53
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.applyRemovalPolicy">applyRemovalPolicy</a></code> | Apply the given removal policy to this resource. |
54
+
55
+ ---
56
+
57
+ ##### `toString` <a name="toString" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.toString"></a>
58
+
59
+ ```typescript
60
+ public toString(): string
61
+ ```
62
+
63
+ Returns a string representation of this construct.
64
+
65
+ ##### `applyRemovalPolicy` <a name="applyRemovalPolicy" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.applyRemovalPolicy"></a>
66
+
67
+ ```typescript
68
+ public applyRemovalPolicy(policy: RemovalPolicy): void
69
+ ```
70
+
71
+ Apply the given removal policy to this resource.
72
+
73
+ The Removal Policy controls what happens to this resource when it stops
74
+ being managed by CloudFormation, either because you've removed it from the
75
+ CDK application or because you've made a change that requires the resource
76
+ to be replaced.
77
+
78
+ The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
79
+ account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
80
+
81
+ ###### `policy`<sup>Required</sup> <a name="policy" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.applyRemovalPolicy.parameter.policy"></a>
82
+
83
+ - *Type:* aws-cdk-lib.RemovalPolicy
84
+
85
+ ---
86
+
87
+ #### Static Functions <a name="Static Functions" id="Static Functions"></a>
88
+
89
+ | **Name** | **Description** |
90
+ | --- | --- |
91
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
92
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.isOwnedResource">isOwnedResource</a></code> | Returns true if the construct was created by CDK, and false otherwise. |
93
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.isResource">isResource</a></code> | Check whether the given construct is a Resource. |
94
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.fromOidcProviderArn">fromOidcProviderArn</a></code> | Imports an Open ID connect provider from an ARN. |
95
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.fromAccount">fromAccount</a></code> | Retrieve a reference to existing Github OIDC provider in your AWS account. |
96
+
97
+ ---
98
+
99
+ ##### `isConstruct` <a name="isConstruct" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.isConstruct"></a>
100
+
101
+ ```typescript
102
+ import { GithubActionsIdentityProvider } from 'aws-cdk-github-oidc'
103
+
104
+ GithubActionsIdentityProvider.isConstruct(x: any)
105
+ ```
106
+
107
+ Checks if `x` is a construct.
108
+
109
+ Use this method instead of `instanceof` to properly detect `Construct`
110
+ instances, even when the construct library is symlinked.
111
+
112
+ Explanation: in JavaScript, multiple copies of the `constructs` library on
113
+ disk are seen as independent, completely different libraries. As a
114
+ consequence, the class `Construct` in each copy of the `constructs` library
115
+ is seen as a different class, and an instance of one class will not test as
116
+ `instanceof` the other class. `npm install` will not create installations
117
+ like this, but users may manually symlink construct libraries together or
118
+ use a monorepo tool: in those cases, multiple copies of the `constructs`
119
+ library can be accidentally installed, and `instanceof` will behave
120
+ unpredictably. It is safest to avoid using `instanceof`, and using
121
+ this type-testing method instead.
122
+
123
+ ###### `x`<sup>Required</sup> <a name="x" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.isConstruct.parameter.x"></a>
124
+
125
+ - *Type:* any
126
+
127
+ Any object.
128
+
129
+ ---
130
+
131
+ ##### `isOwnedResource` <a name="isOwnedResource" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.isOwnedResource"></a>
132
+
133
+ ```typescript
134
+ import { GithubActionsIdentityProvider } from 'aws-cdk-github-oidc'
135
+
136
+ GithubActionsIdentityProvider.isOwnedResource(construct: IConstruct)
137
+ ```
138
+
139
+ Returns true if the construct was created by CDK, and false otherwise.
140
+
141
+ ###### `construct`<sup>Required</sup> <a name="construct" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.isOwnedResource.parameter.construct"></a>
142
+
143
+ - *Type:* constructs.IConstruct
144
+
145
+ ---
146
+
147
+ ##### `isResource` <a name="isResource" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.isResource"></a>
148
+
149
+ ```typescript
150
+ import { GithubActionsIdentityProvider } from 'aws-cdk-github-oidc'
151
+
152
+ GithubActionsIdentityProvider.isResource(construct: IConstruct)
153
+ ```
154
+
155
+ Check whether the given construct is a Resource.
156
+
157
+ ###### `construct`<sup>Required</sup> <a name="construct" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.isResource.parameter.construct"></a>
158
+
159
+ - *Type:* constructs.IConstruct
160
+
161
+ ---
162
+
163
+ ##### `fromOidcProviderArn` <a name="fromOidcProviderArn" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.fromOidcProviderArn"></a>
164
+
165
+ ```typescript
166
+ import { GithubActionsIdentityProvider } from 'aws-cdk-github-oidc'
167
+
168
+ GithubActionsIdentityProvider.fromOidcProviderArn(scope: Construct, id: string, oidcProviderArn: string)
169
+ ```
170
+
171
+ Imports an Open ID connect provider from an ARN.
172
+
173
+ ###### `scope`<sup>Required</sup> <a name="scope" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.fromOidcProviderArn.parameter.scope"></a>
174
+
175
+ - *Type:* constructs.Construct
176
+
177
+ The definition scope.
178
+
179
+ ---
180
+
181
+ ###### `id`<sup>Required</sup> <a name="id" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.fromOidcProviderArn.parameter.id"></a>
182
+
183
+ - *Type:* string
184
+
185
+ ID of the construct.
186
+
187
+ ---
188
+
189
+ ###### `oidcProviderArn`<sup>Required</sup> <a name="oidcProviderArn" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.fromOidcProviderArn.parameter.oidcProviderArn"></a>
190
+
191
+ - *Type:* string
192
+
193
+ the ARN to import.
194
+
195
+ ---
196
+
197
+ ##### `fromAccount` <a name="fromAccount" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.fromAccount"></a>
198
+
199
+ ```typescript
200
+ import { GithubActionsIdentityProvider } from 'aws-cdk-github-oidc'
201
+
202
+ GithubActionsIdentityProvider.fromAccount(scope: Construct, id: string)
203
+ ```
204
+
205
+ Retrieve a reference to existing Github OIDC provider in your AWS account.
206
+
207
+ An AWS account can only have single Github OIDC provider configured into it,
208
+ so internally the reference is made by constructing the ARN from AWS
209
+ Account ID & Github issuer URL.
210
+
211
+ *Example*
212
+
213
+ ```typescript
214
+ GithubActionsIdentityProvider.fromAccount(scope, "GithubProvider");
215
+ ```
216
+
217
+
218
+ ###### `scope`<sup>Required</sup> <a name="scope" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.fromAccount.parameter.scope"></a>
219
+
220
+ - *Type:* constructs.Construct
221
+
222
+ CDK Stack or Construct to which the provider is assigned to.
223
+
224
+ ---
225
+
226
+ ###### `id`<sup>Required</sup> <a name="id" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.fromAccount.parameter.id"></a>
227
+
228
+ - *Type:* string
229
+
230
+ CDK Construct ID given to the construct.
231
+
232
+ ---
233
+
234
+ #### Properties <a name="Properties" id="Properties"></a>
235
+
236
+ | **Name** | **Type** | **Description** |
237
+ | --- | --- | --- |
238
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
239
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.property.env">env</a></code> | <code>aws-cdk-lib.ResourceEnvironment</code> | The environment this resource belongs to. |
240
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.property.stack">stack</a></code> | <code>aws-cdk-lib.Stack</code> | The stack in which this resource is defined. |
241
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.property.oidcProviderArn">oidcProviderArn</a></code> | <code>string</code> | The Amazon Resource Name (ARN) of the Native IAM OpenID Connect provider. |
242
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.property.oidcProviderIssuer">oidcProviderIssuer</a></code> | <code>string</code> | The issuer for the Native OIDC Provider. |
243
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.property.oidcProviderRef">oidcProviderRef</a></code> | <code>aws-cdk-lib.aws_iam.OIDCProviderReference</code> | A reference to a OIDCProvider resource. |
244
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.property.oidcProviderThumbprints">oidcProviderThumbprints</a></code> | <code>string</code> | The thumbprints configured for this provider. |
245
+
246
+ ---
247
+
248
+ ##### `node`<sup>Required</sup> <a name="node" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.property.node"></a>
249
+
250
+ ```typescript
251
+ public readonly node: Node;
252
+ ```
253
+
254
+ - *Type:* constructs.Node
255
+
256
+ The tree node.
257
+
258
+ ---
259
+
260
+ ##### `env`<sup>Required</sup> <a name="env" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.property.env"></a>
261
+
262
+ ```typescript
263
+ public readonly env: ResourceEnvironment;
264
+ ```
265
+
266
+ - *Type:* aws-cdk-lib.ResourceEnvironment
267
+
268
+ The environment this resource belongs to.
269
+
270
+ For resources that are created and managed by the CDK
271
+ (generally, those created by creating new class instances like Role, Bucket, etc.),
272
+ this is always the same as the environment of the stack they belong to;
273
+ however, for imported resources
274
+ (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
275
+ that might be different than the stack they were imported into.
276
+
277
+ ---
278
+
279
+ ##### `stack`<sup>Required</sup> <a name="stack" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.property.stack"></a>
280
+
281
+ ```typescript
282
+ public readonly stack: Stack;
283
+ ```
284
+
285
+ - *Type:* aws-cdk-lib.Stack
286
+
287
+ The stack in which this resource is defined.
288
+
289
+ ---
290
+
291
+ ##### `oidcProviderArn`<sup>Required</sup> <a name="oidcProviderArn" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.property.oidcProviderArn"></a>
292
+
293
+ ```typescript
294
+ public readonly oidcProviderArn: string;
295
+ ```
296
+
297
+ - *Type:* string
298
+
299
+ The Amazon Resource Name (ARN) of the Native IAM OpenID Connect provider.
300
+
301
+ ---
302
+
303
+ ##### `oidcProviderIssuer`<sup>Required</sup> <a name="oidcProviderIssuer" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.property.oidcProviderIssuer"></a>
304
+
305
+ ```typescript
306
+ public readonly oidcProviderIssuer: string;
307
+ ```
308
+
309
+ - *Type:* string
310
+
311
+ The issuer for the Native OIDC Provider.
312
+
313
+ ---
314
+
315
+ ##### `oidcProviderRef`<sup>Required</sup> <a name="oidcProviderRef" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.property.oidcProviderRef"></a>
316
+
317
+ ```typescript
318
+ public readonly oidcProviderRef: OIDCProviderReference;
319
+ ```
320
+
321
+ - *Type:* aws-cdk-lib.aws_iam.OIDCProviderReference
322
+
323
+ A reference to a OIDCProvider resource.
324
+
325
+ ---
326
+
327
+ ##### `oidcProviderThumbprints`<sup>Required</sup> <a name="oidcProviderThumbprints" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.property.oidcProviderThumbprints"></a>
328
+
329
+ ```typescript
330
+ public readonly oidcProviderThumbprints: string;
331
+ ```
332
+
333
+ - *Type:* string
334
+
335
+ The thumbprints configured for this provider.
336
+
337
+ ---
338
+
339
+ #### Constants <a name="Constants" id="Constants"></a>
340
+
341
+ | **Name** | **Type** | **Description** |
342
+ | --- | --- | --- |
343
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.property.PROPERTY_INJECTION_ID">PROPERTY_INJECTION_ID</a></code> | <code>string</code> | Uniquely identifies this class. |
344
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider.property.issuer">issuer</a></code> | <code>string</code> | *No description.* |
345
+
346
+ ---
347
+
348
+ ##### `PROPERTY_INJECTION_ID`<sup>Required</sup> <a name="PROPERTY_INJECTION_ID" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.property.PROPERTY_INJECTION_ID"></a>
349
+
350
+ ```typescript
351
+ public readonly PROPERTY_INJECTION_ID: string;
352
+ ```
353
+
354
+ - *Type:* string
355
+
356
+ Uniquely identifies this class.
357
+
358
+ ---
359
+
360
+ ##### `issuer`<sup>Required</sup> <a name="issuer" id="aws-cdk-github-oidc.GithubActionsIdentityProvider.property.issuer"></a>
361
+
362
+ ```typescript
363
+ public readonly issuer: string;
364
+ ```
365
+
366
+ - *Type:* string
367
+
368
+ ---
369
+
370
+ ### GithubActionsRole <a name="GithubActionsRole" id="aws-cdk-github-oidc.GithubActionsRole"></a>
371
+
372
+ Define an IAM Role that can be assumed by Github Actions workflow via Github OpenID Connect Identity Provider.
373
+
374
+ Besides `GithubConfiguration`, you may pass in any `iam.RoleProps` except `assumedBy`
375
+ which will be defined by this construct (CDK will fail if you do).
376
+
377
+ *Example*
378
+
379
+ ```typescript
380
+ const uploadRole = new GithubActionsRole(scope, "UploadRole", {
381
+ provider: GithubActionsIdentityProvider.fromAccount(scope, "GithubProvider"),
382
+ owner: 'octo-org',
383
+ repo: 'octo-repo',
384
+ filter: 'ref:refs/tags/v*',
385
+ roleName: 'MyUploadRole',
386
+ });
387
+
388
+ myBucket.grantWrite(uploadRole);
389
+ ```
390
+
391
+
392
+ #### Initializers <a name="Initializers" id="aws-cdk-github-oidc.GithubActionsRole.Initializer"></a>
393
+
394
+ ```typescript
395
+ import { GithubActionsRole } from 'aws-cdk-github-oidc'
396
+
397
+ new GithubActionsRole(scope: Construct, id: string, props: GithubActionsRoleProps)
398
+ ```
399
+
400
+ | **Name** | **Type** | **Description** |
401
+ | --- | --- | --- |
402
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
403
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
404
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.Initializer.parameter.props">props</a></code> | <code><a href="#aws-cdk-github-oidc.GithubActionsRoleProps">GithubActionsRoleProps</a></code> | *No description.* |
405
+
406
+ ---
407
+
408
+ ##### `scope`<sup>Required</sup> <a name="scope" id="aws-cdk-github-oidc.GithubActionsRole.Initializer.parameter.scope"></a>
409
+
410
+ - *Type:* constructs.Construct
411
+
412
+ ---
413
+
414
+ ##### `id`<sup>Required</sup> <a name="id" id="aws-cdk-github-oidc.GithubActionsRole.Initializer.parameter.id"></a>
415
+
416
+ - *Type:* string
417
+
418
+ ---
419
+
420
+ ##### `props`<sup>Required</sup> <a name="props" id="aws-cdk-github-oidc.GithubActionsRole.Initializer.parameter.props"></a>
421
+
422
+ - *Type:* <a href="#aws-cdk-github-oidc.GithubActionsRoleProps">GithubActionsRoleProps</a>
423
+
424
+ ---
425
+
426
+ #### Methods <a name="Methods" id="Methods"></a>
427
+
428
+ | **Name** | **Description** |
429
+ | --- | --- |
430
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.toString">toString</a></code> | Returns a string representation of this construct. |
431
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.applyRemovalPolicy">applyRemovalPolicy</a></code> | Skip applyRemovalPolicy if role synthesis is prevented by customizeRoles. |
432
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.addManagedPolicy">addManagedPolicy</a></code> | Attaches a managed policy to this role. |
433
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.addToPolicy">addToPolicy</a></code> | Add to the policy of this principal. |
434
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.addToPrincipalPolicy">addToPrincipalPolicy</a></code> | Adds a permission to the role's default policy document. |
435
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.attachInlinePolicy">attachInlinePolicy</a></code> | Attaches a policy to this role. |
436
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.grant">grant</a></code> | Grant the actions defined in actions to the identity Principal on this resource. |
437
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.grantAssumeRole">grantAssumeRole</a></code> | Grant permissions to the given principal to assume this role. |
438
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.grantPassRole">grantPassRole</a></code> | Grant permissions to the given principal to pass this role. |
439
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.withoutPolicyUpdates">withoutPolicyUpdates</a></code> | Return a copy of this Role object whose Policies will not be updated. |
440
+
441
+ ---
442
+
443
+ ##### `toString` <a name="toString" id="aws-cdk-github-oidc.GithubActionsRole.toString"></a>
444
+
445
+ ```typescript
446
+ public toString(): string
447
+ ```
448
+
449
+ Returns a string representation of this construct.
450
+
451
+ ##### `applyRemovalPolicy` <a name="applyRemovalPolicy" id="aws-cdk-github-oidc.GithubActionsRole.applyRemovalPolicy"></a>
452
+
453
+ ```typescript
454
+ public applyRemovalPolicy(policy: RemovalPolicy): void
455
+ ```
456
+
457
+ Skip applyRemovalPolicy if role synthesis is prevented by customizeRoles.
458
+
459
+ Because in this case, this construct does not have a CfnResource in the tree.
460
+
461
+ ###### `policy`<sup>Required</sup> <a name="policy" id="aws-cdk-github-oidc.GithubActionsRole.applyRemovalPolicy.parameter.policy"></a>
462
+
463
+ - *Type:* aws-cdk-lib.RemovalPolicy
464
+
465
+ RemovalPolicy.
466
+
467
+ ---
468
+
469
+ ##### `addManagedPolicy` <a name="addManagedPolicy" id="aws-cdk-github-oidc.GithubActionsRole.addManagedPolicy"></a>
470
+
471
+ ```typescript
472
+ public addManagedPolicy(policy: IManagedPolicy): void
473
+ ```
474
+
475
+ Attaches a managed policy to this role.
476
+
477
+ ###### `policy`<sup>Required</sup> <a name="policy" id="aws-cdk-github-oidc.GithubActionsRole.addManagedPolicy.parameter.policy"></a>
478
+
479
+ - *Type:* aws-cdk-lib.aws_iam.IManagedPolicy
480
+
481
+ The the managed policy to attach.
482
+
483
+ ---
484
+
485
+ ##### `addToPolicy` <a name="addToPolicy" id="aws-cdk-github-oidc.GithubActionsRole.addToPolicy"></a>
486
+
487
+ ```typescript
488
+ public addToPolicy(statement: PolicyStatement): boolean
489
+ ```
490
+
491
+ Add to the policy of this principal.
492
+
493
+ ###### `statement`<sup>Required</sup> <a name="statement" id="aws-cdk-github-oidc.GithubActionsRole.addToPolicy.parameter.statement"></a>
494
+
495
+ - *Type:* aws-cdk-lib.aws_iam.PolicyStatement
496
+
497
+ ---
498
+
499
+ ##### `addToPrincipalPolicy` <a name="addToPrincipalPolicy" id="aws-cdk-github-oidc.GithubActionsRole.addToPrincipalPolicy"></a>
500
+
501
+ ```typescript
502
+ public addToPrincipalPolicy(statement: PolicyStatement): AddToPrincipalPolicyResult
503
+ ```
504
+
505
+ Adds a permission to the role's default policy document.
506
+
507
+ If there is no default policy attached to this role, it will be created.
508
+
509
+ ###### `statement`<sup>Required</sup> <a name="statement" id="aws-cdk-github-oidc.GithubActionsRole.addToPrincipalPolicy.parameter.statement"></a>
510
+
511
+ - *Type:* aws-cdk-lib.aws_iam.PolicyStatement
512
+
513
+ The permission statement to add to the policy document.
514
+
515
+ ---
516
+
517
+ ##### `attachInlinePolicy` <a name="attachInlinePolicy" id="aws-cdk-github-oidc.GithubActionsRole.attachInlinePolicy"></a>
518
+
519
+ ```typescript
520
+ public attachInlinePolicy(policy: Policy): void
521
+ ```
522
+
523
+ Attaches a policy to this role.
524
+
525
+ ###### `policy`<sup>Required</sup> <a name="policy" id="aws-cdk-github-oidc.GithubActionsRole.attachInlinePolicy.parameter.policy"></a>
526
+
527
+ - *Type:* aws-cdk-lib.aws_iam.Policy
528
+
529
+ The policy to attach.
530
+
531
+ ---
532
+
533
+ ##### `grant` <a name="grant" id="aws-cdk-github-oidc.GithubActionsRole.grant"></a>
534
+
535
+ ```typescript
536
+ public grant(grantee: IPrincipal, actions: ...string[]): Grant
537
+ ```
538
+
539
+ Grant the actions defined in actions to the identity Principal on this resource.
540
+
541
+ ###### `grantee`<sup>Required</sup> <a name="grantee" id="aws-cdk-github-oidc.GithubActionsRole.grant.parameter.grantee"></a>
542
+
543
+ - *Type:* aws-cdk-lib.aws_iam.IPrincipal
544
+
545
+ ---
546
+
547
+ ###### `actions`<sup>Required</sup> <a name="actions" id="aws-cdk-github-oidc.GithubActionsRole.grant.parameter.actions"></a>
548
+
549
+ - *Type:* ...string[]
550
+
551
+ ---
552
+
553
+ ##### `grantAssumeRole` <a name="grantAssumeRole" id="aws-cdk-github-oidc.GithubActionsRole.grantAssumeRole"></a>
554
+
555
+ ```typescript
556
+ public grantAssumeRole(identity: IPrincipal): Grant
557
+ ```
558
+
559
+ Grant permissions to the given principal to assume this role.
560
+
561
+ ###### `identity`<sup>Required</sup> <a name="identity" id="aws-cdk-github-oidc.GithubActionsRole.grantAssumeRole.parameter.identity"></a>
562
+
563
+ - *Type:* aws-cdk-lib.aws_iam.IPrincipal
564
+
565
+ ---
566
+
567
+ ##### `grantPassRole` <a name="grantPassRole" id="aws-cdk-github-oidc.GithubActionsRole.grantPassRole"></a>
568
+
569
+ ```typescript
570
+ public grantPassRole(identity: IPrincipal): Grant
571
+ ```
572
+
573
+ Grant permissions to the given principal to pass this role.
574
+
575
+ ###### `identity`<sup>Required</sup> <a name="identity" id="aws-cdk-github-oidc.GithubActionsRole.grantPassRole.parameter.identity"></a>
576
+
577
+ - *Type:* aws-cdk-lib.aws_iam.IPrincipal
578
+
579
+ ---
580
+
581
+ ##### `withoutPolicyUpdates` <a name="withoutPolicyUpdates" id="aws-cdk-github-oidc.GithubActionsRole.withoutPolicyUpdates"></a>
582
+
583
+ ```typescript
584
+ public withoutPolicyUpdates(options?: WithoutPolicyUpdatesOptions): IRole
585
+ ```
586
+
587
+ Return a copy of this Role object whose Policies will not be updated.
588
+
589
+ Use the object returned by this method if you want this Role to be used by
590
+ a construct without it automatically updating the Role's Policies.
591
+
592
+ If you do, you are responsible for adding the correct statements to the
593
+ Role's policies yourself.
594
+
595
+ ###### `options`<sup>Optional</sup> <a name="options" id="aws-cdk-github-oidc.GithubActionsRole.withoutPolicyUpdates.parameter.options"></a>
596
+
597
+ - *Type:* aws-cdk-lib.aws_iam.WithoutPolicyUpdatesOptions
598
+
599
+ ---
600
+
601
+ #### Static Functions <a name="Static Functions" id="Static Functions"></a>
602
+
603
+ | **Name** | **Description** |
604
+ | --- | --- |
605
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
606
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.isOwnedResource">isOwnedResource</a></code> | Returns true if the construct was created by CDK, and false otherwise. |
607
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.isResource">isResource</a></code> | Check whether the given construct is a Resource. |
608
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.customizeRoles">customizeRoles</a></code> | Customize the creation of IAM roles within the given scope. |
609
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.fromLookup">fromLookup</a></code> | Lookup an existing Role. |
610
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.fromRoleArn">fromRoleArn</a></code> | Import an external role by ARN. |
611
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.fromRoleName">fromRoleName</a></code> | Import an external role by name. |
612
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.isRole">isRole</a></code> | Return whether the given object is a Role. |
613
+
614
+ ---
615
+
616
+ ##### `isConstruct` <a name="isConstruct" id="aws-cdk-github-oidc.GithubActionsRole.isConstruct"></a>
617
+
618
+ ```typescript
619
+ import { GithubActionsRole } from 'aws-cdk-github-oidc'
620
+
621
+ GithubActionsRole.isConstruct(x: any)
622
+ ```
623
+
624
+ Checks if `x` is a construct.
625
+
626
+ Use this method instead of `instanceof` to properly detect `Construct`
627
+ instances, even when the construct library is symlinked.
628
+
629
+ Explanation: in JavaScript, multiple copies of the `constructs` library on
630
+ disk are seen as independent, completely different libraries. As a
631
+ consequence, the class `Construct` in each copy of the `constructs` library
632
+ is seen as a different class, and an instance of one class will not test as
633
+ `instanceof` the other class. `npm install` will not create installations
634
+ like this, but users may manually symlink construct libraries together or
635
+ use a monorepo tool: in those cases, multiple copies of the `constructs`
636
+ library can be accidentally installed, and `instanceof` will behave
637
+ unpredictably. It is safest to avoid using `instanceof`, and using
638
+ this type-testing method instead.
639
+
640
+ ###### `x`<sup>Required</sup> <a name="x" id="aws-cdk-github-oidc.GithubActionsRole.isConstruct.parameter.x"></a>
641
+
642
+ - *Type:* any
643
+
644
+ Any object.
645
+
646
+ ---
647
+
648
+ ##### `isOwnedResource` <a name="isOwnedResource" id="aws-cdk-github-oidc.GithubActionsRole.isOwnedResource"></a>
649
+
650
+ ```typescript
651
+ import { GithubActionsRole } from 'aws-cdk-github-oidc'
652
+
653
+ GithubActionsRole.isOwnedResource(construct: IConstruct)
654
+ ```
655
+
656
+ Returns true if the construct was created by CDK, and false otherwise.
657
+
658
+ ###### `construct`<sup>Required</sup> <a name="construct" id="aws-cdk-github-oidc.GithubActionsRole.isOwnedResource.parameter.construct"></a>
659
+
660
+ - *Type:* constructs.IConstruct
661
+
662
+ ---
663
+
664
+ ##### `isResource` <a name="isResource" id="aws-cdk-github-oidc.GithubActionsRole.isResource"></a>
665
+
666
+ ```typescript
667
+ import { GithubActionsRole } from 'aws-cdk-github-oidc'
668
+
669
+ GithubActionsRole.isResource(construct: IConstruct)
670
+ ```
671
+
672
+ Check whether the given construct is a Resource.
673
+
674
+ ###### `construct`<sup>Required</sup> <a name="construct" id="aws-cdk-github-oidc.GithubActionsRole.isResource.parameter.construct"></a>
675
+
676
+ - *Type:* constructs.IConstruct
677
+
678
+ ---
679
+
680
+ ##### `customizeRoles` <a name="customizeRoles" id="aws-cdk-github-oidc.GithubActionsRole.customizeRoles"></a>
16
681
 
17
682
  ```typescript
18
- import { GithubActionsIdentityProvider } from 'aws-cdk-github-oidc'
683
+ import { GithubActionsRole } from 'aws-cdk-github-oidc'
19
684
 
20
- new GithubActionsIdentityProvider(scope: Construct, id: string)
685
+ GithubActionsRole.customizeRoles(scope: Construct, options?: CustomizeRolesOptions)
21
686
  ```
22
687
 
23
- ##### `scope`<sup>Required</sup> <a name="aws-cdk-github-oidc.GithubActionsIdentityProvider.parameter.scope"></a>
688
+ Customize the creation of IAM roles within the given scope.
24
689
 
25
- - *Type:* [`constructs.Construct`](#constructs.Construct)
690
+ It is recommended that you **do not** use this method and instead allow
691
+ CDK to manage role creation. This should only be used
692
+ in environments where CDK applications are not allowed to created IAM roles.
26
693
 
27
- CDK Stack or Construct to which the provider is assigned to.
694
+ This can be used to prevent the CDK application from creating roles
695
+ within the given scope and instead replace the references to the roles with
696
+ precreated role names. A report will be synthesized in the cloud assembly (i.e. cdk.out)
697
+ that will contain the list of IAM roles that would have been created along with the
698
+ IAM policy statements that the role should contain. This report can then be used
699
+ to create the IAM roles outside of CDK and then the created role names can be provided
700
+ in `usePrecreatedRoles`.
701
+
702
+ *Example*
703
+
704
+ ```typescript
705
+ declare const app: App;
706
+ iam.Role.customizeRoles(app, {
707
+ usePrecreatedRoles: {
708
+ 'ConstructPath/To/Role': 'my-precreated-role-name',
709
+ },
710
+ });
711
+ ```
712
+
713
+
714
+ ###### `scope`<sup>Required</sup> <a name="scope" id="aws-cdk-github-oidc.GithubActionsRole.customizeRoles.parameter.scope"></a>
715
+
716
+ - *Type:* constructs.Construct
717
+
718
+ construct scope to customize role creation.
28
719
 
29
720
  ---
30
721
 
31
- ##### `id`<sup>Required</sup> <a name="aws-cdk-github-oidc.GithubActionsIdentityProvider.parameter.id"></a>
722
+ ###### `options`<sup>Optional</sup> <a name="options" id="aws-cdk-github-oidc.GithubActionsRole.customizeRoles.parameter.options"></a>
32
723
 
33
- - *Type:* `string`
724
+ - *Type:* aws-cdk-lib.aws_iam.CustomizeRolesOptions
34
725
 
35
- CDK Construct ID given to the construct.
726
+ options for configuring role creation.
727
+
728
+ ---
729
+
730
+ ##### `fromLookup` <a name="fromLookup" id="aws-cdk-github-oidc.GithubActionsRole.fromLookup"></a>
731
+
732
+ ```typescript
733
+ import { GithubActionsRole } from 'aws-cdk-github-oidc'
734
+
735
+ GithubActionsRole.fromLookup(scope: Construct, id: string, options: RoleLookupOptions)
736
+ ```
737
+
738
+ Lookup an existing Role.
739
+
740
+ ###### `scope`<sup>Required</sup> <a name="scope" id="aws-cdk-github-oidc.GithubActionsRole.fromLookup.parameter.scope"></a>
741
+
742
+ - *Type:* constructs.Construct
743
+
744
+ ---
745
+
746
+ ###### `id`<sup>Required</sup> <a name="id" id="aws-cdk-github-oidc.GithubActionsRole.fromLookup.parameter.id"></a>
747
+
748
+ - *Type:* string
36
749
 
37
750
  ---
38
751
 
752
+ ###### `options`<sup>Required</sup> <a name="options" id="aws-cdk-github-oidc.GithubActionsRole.fromLookup.parameter.options"></a>
753
+
754
+ - *Type:* aws-cdk-lib.aws_iam.RoleLookupOptions
39
755
 
40
- #### Static Functions <a name="Static Functions"></a>
756
+ ---
41
757
 
42
- ##### `fromAccount` <a name="aws-cdk-github-oidc.GithubActionsIdentityProvider.fromAccount"></a>
758
+ ##### `fromRoleArn` <a name="fromRoleArn" id="aws-cdk-github-oidc.GithubActionsRole.fromRoleArn"></a>
43
759
 
44
760
  ```typescript
45
- import { GithubActionsIdentityProvider } from 'aws-cdk-github-oidc'
761
+ import { GithubActionsRole } from 'aws-cdk-github-oidc'
46
762
 
47
- GithubActionsIdentityProvider.fromAccount(scope: Construct, id: string)
763
+ GithubActionsRole.fromRoleArn(scope: Construct, id: string, roleArn: string, options?: FromRoleArnOptions)
48
764
  ```
49
765
 
50
- ###### `scope`<sup>Required</sup> <a name="aws-cdk-github-oidc.GithubActionsIdentityProvider.parameter.scope"></a>
766
+ Import an external role by ARN.
51
767
 
52
- - *Type:* [`constructs.Construct`](#constructs.Construct)
768
+ If the imported Role ARN is a Token (such as a
769
+ `CfnParameter.valueAsString` or a `Fn.importValue()`) *and* the referenced
770
+ role has a `path` (like `arn:...:role/AdminRoles/Alice`), the
771
+ `roleName` property will not resolve to the correct value. Instead it
772
+ will resolve to the first path component. We unfortunately cannot express
773
+ the correct calculation of the full path name as a CloudFormation
774
+ expression. In this scenario the Role ARN should be supplied without the
775
+ `path` in order to resolve the correct role resource.
53
776
 
54
- CDK Stack or Construct to which the provider is assigned to.
777
+ ###### `scope`<sup>Required</sup> <a name="scope" id="aws-cdk-github-oidc.GithubActionsRole.fromRoleArn.parameter.scope"></a>
778
+
779
+ - *Type:* constructs.Construct
780
+
781
+ construct scope.
55
782
 
56
783
  ---
57
784
 
58
- ###### `id`<sup>Required</sup> <a name="aws-cdk-github-oidc.GithubActionsIdentityProvider.parameter.id"></a>
785
+ ###### `id`<sup>Required</sup> <a name="id" id="aws-cdk-github-oidc.GithubActionsRole.fromRoleArn.parameter.id"></a>
59
786
 
60
- - *Type:* `string`
787
+ - *Type:* string
61
788
 
62
- CDK Construct ID given to the construct.
789
+ construct id.
63
790
 
64
791
  ---
65
792
 
793
+ ###### `roleArn`<sup>Required</sup> <a name="roleArn" id="aws-cdk-github-oidc.GithubActionsRole.fromRoleArn.parameter.roleArn"></a>
794
+
795
+ - *Type:* string
796
+
797
+ the ARN of the role to import.
66
798
 
67
- #### Constants <a name="Constants"></a>
799
+ ---
800
+
801
+ ###### `options`<sup>Optional</sup> <a name="options" id="aws-cdk-github-oidc.GithubActionsRole.fromRoleArn.parameter.options"></a>
68
802
 
69
- ##### `issuer` <a name="aws-cdk-github-oidc.GithubActionsIdentityProvider.property.issuer"></a>
803
+ - *Type:* aws-cdk-lib.aws_iam.FromRoleArnOptions
70
804
 
71
- - *Type:* `string`
805
+ allow customizing the behavior of the returned role.
72
806
 
73
807
  ---
74
808
 
75
- ### GithubActionsRole <a name="aws-cdk-github-oidc.GithubActionsRole"></a>
809
+ ##### `fromRoleName` <a name="fromRoleName" id="aws-cdk-github-oidc.GithubActionsRole.fromRoleName"></a>
76
810
 
77
- Define an IAM Role that can be assumed by Github Actions workflow via Github OpenID Connect Identity Provider.
811
+ ```typescript
812
+ import { GithubActionsRole } from 'aws-cdk-github-oidc'
78
813
 
79
- Besides `GithubConfiguration`, you may pass in any `iam.RoleProps` except `assumedBy`
80
- which will be defined by this construct (CDK will fail if you do).
814
+ GithubActionsRole.fromRoleName(scope: Construct, id: string, roleName: string, options?: FromRoleNameOptions)
815
+ ```
816
+
817
+ Import an external role by name.
818
+
819
+ The imported role is assumed to exist in the same account as the account
820
+ the scope's containing Stack is being deployed to.
821
+
822
+ ###### `scope`<sup>Required</sup> <a name="scope" id="aws-cdk-github-oidc.GithubActionsRole.fromRoleName.parameter.scope"></a>
823
+
824
+ - *Type:* constructs.Construct
825
+
826
+ construct scope.
827
+
828
+ ---
829
+
830
+ ###### `id`<sup>Required</sup> <a name="id" id="aws-cdk-github-oidc.GithubActionsRole.fromRoleName.parameter.id"></a>
831
+
832
+ - *Type:* string
833
+
834
+ construct id.
835
+
836
+ ---
837
+
838
+ ###### `roleName`<sup>Required</sup> <a name="roleName" id="aws-cdk-github-oidc.GithubActionsRole.fromRoleName.parameter.roleName"></a>
839
+
840
+ - *Type:* string
841
+
842
+ the name of the role to import.
843
+
844
+ ---
845
+
846
+ ###### `options`<sup>Optional</sup> <a name="options" id="aws-cdk-github-oidc.GithubActionsRole.fromRoleName.parameter.options"></a>
847
+
848
+ - *Type:* aws-cdk-lib.aws_iam.FromRoleNameOptions
849
+
850
+ allow customizing the behavior of the returned role.
81
851
 
82
- #### Initializers <a name="aws-cdk-github-oidc.GithubActionsRole.Initializer"></a>
852
+ ---
853
+
854
+ ##### `isRole` <a name="isRole" id="aws-cdk-github-oidc.GithubActionsRole.isRole"></a>
83
855
 
84
856
  ```typescript
85
857
  import { GithubActionsRole } from 'aws-cdk-github-oidc'
86
858
 
87
- new GithubActionsRole(scope: Construct, id: string, props: GithubActionsRoleProps)
859
+ GithubActionsRole.isRole(x: any)
860
+ ```
861
+
862
+ Return whether the given object is a Role.
863
+
864
+ ###### `x`<sup>Required</sup> <a name="x" id="aws-cdk-github-oidc.GithubActionsRole.isRole.parameter.x"></a>
865
+
866
+ - *Type:* any
867
+
868
+ ---
869
+
870
+ #### Properties <a name="Properties" id="Properties"></a>
871
+
872
+ | **Name** | **Type** | **Description** |
873
+ | --- | --- | --- |
874
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
875
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.property.env">env</a></code> | <code>aws-cdk-lib.ResourceEnvironment</code> | The environment this resource belongs to. |
876
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.property.stack">stack</a></code> | <code>aws-cdk-lib.Stack</code> | The stack in which this resource is defined. |
877
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.property.assumeRoleAction">assumeRoleAction</a></code> | <code>string</code> | When this Principal is used in an AssumeRole policy, the action to use. |
878
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | The principal to grant permissions to. |
879
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.property.policyFragment">policyFragment</a></code> | <code>aws-cdk-lib.aws_iam.PrincipalPolicyFragment</code> | Returns the role. |
880
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.property.roleArn">roleArn</a></code> | <code>string</code> | Returns the ARN of this role. |
881
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.property.roleId">roleId</a></code> | <code>string</code> | Returns the stable and unique string identifying the role. |
882
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.property.roleName">roleName</a></code> | <code>string</code> | Returns the name of the role. |
883
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.property.roleRef">roleRef</a></code> | <code>aws-cdk-lib.aws_iam.RoleReference</code> | A reference to a Role resource. |
884
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.property.assumeRolePolicy">assumeRolePolicy</a></code> | <code>aws-cdk-lib.aws_iam.PolicyDocument</code> | The assume role policy document associated with this role. |
885
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.property.permissionsBoundary">permissionsBoundary</a></code> | <code>aws-cdk-lib.aws_iam.IManagedPolicy</code> | Returns the permissions boundary attached to this role. |
886
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.property.principalAccount">principalAccount</a></code> | <code>string</code> | The AWS account ID of this principal. |
887
+
888
+ ---
889
+
890
+ ##### `node`<sup>Required</sup> <a name="node" id="aws-cdk-github-oidc.GithubActionsRole.property.node"></a>
891
+
892
+ ```typescript
893
+ public readonly node: Node;
894
+ ```
895
+
896
+ - *Type:* constructs.Node
897
+
898
+ The tree node.
899
+
900
+ ---
901
+
902
+ ##### `env`<sup>Required</sup> <a name="env" id="aws-cdk-github-oidc.GithubActionsRole.property.env"></a>
903
+
904
+ ```typescript
905
+ public readonly env: ResourceEnvironment;
906
+ ```
907
+
908
+ - *Type:* aws-cdk-lib.ResourceEnvironment
909
+
910
+ The environment this resource belongs to.
911
+
912
+ For resources that are created and managed by the CDK
913
+ (generally, those created by creating new class instances like Role, Bucket, etc.),
914
+ this is always the same as the environment of the stack they belong to;
915
+ however, for imported resources
916
+ (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
917
+ that might be different than the stack they were imported into.
918
+
919
+ ---
920
+
921
+ ##### `stack`<sup>Required</sup> <a name="stack" id="aws-cdk-github-oidc.GithubActionsRole.property.stack"></a>
922
+
923
+ ```typescript
924
+ public readonly stack: Stack;
925
+ ```
926
+
927
+ - *Type:* aws-cdk-lib.Stack
928
+
929
+ The stack in which this resource is defined.
930
+
931
+ ---
932
+
933
+ ##### `assumeRoleAction`<sup>Required</sup> <a name="assumeRoleAction" id="aws-cdk-github-oidc.GithubActionsRole.property.assumeRoleAction"></a>
934
+
935
+ ```typescript
936
+ public readonly assumeRoleAction: string;
937
+ ```
938
+
939
+ - *Type:* string
940
+
941
+ When this Principal is used in an AssumeRole policy, the action to use.
942
+
943
+ ---
944
+
945
+ ##### `grantPrincipal`<sup>Required</sup> <a name="grantPrincipal" id="aws-cdk-github-oidc.GithubActionsRole.property.grantPrincipal"></a>
946
+
947
+ ```typescript
948
+ public readonly grantPrincipal: IPrincipal;
88
949
  ```
89
950
 
90
- ##### `scope`<sup>Required</sup> <a name="aws-cdk-github-oidc.GithubActionsRole.parameter.scope"></a>
951
+ - *Type:* aws-cdk-lib.aws_iam.IPrincipal
91
952
 
92
- - *Type:* [`constructs.Construct`](#constructs.Construct)
953
+ The principal to grant permissions to.
93
954
 
94
955
  ---
95
956
 
96
- ##### `id`<sup>Required</sup> <a name="aws-cdk-github-oidc.GithubActionsRole.parameter.id"></a>
957
+ ##### `policyFragment`<sup>Required</sup> <a name="policyFragment" id="aws-cdk-github-oidc.GithubActionsRole.property.policyFragment"></a>
97
958
 
98
- - *Type:* `string`
959
+ ```typescript
960
+ public readonly policyFragment: PrincipalPolicyFragment;
961
+ ```
962
+
963
+ - *Type:* aws-cdk-lib.aws_iam.PrincipalPolicyFragment
964
+
965
+ Returns the role.
966
+
967
+ ---
968
+
969
+ ##### `roleArn`<sup>Required</sup> <a name="roleArn" id="aws-cdk-github-oidc.GithubActionsRole.property.roleArn"></a>
970
+
971
+ ```typescript
972
+ public readonly roleArn: string;
973
+ ```
974
+
975
+ - *Type:* string
976
+
977
+ Returns the ARN of this role.
978
+
979
+ ---
980
+
981
+ ##### `roleId`<sup>Required</sup> <a name="roleId" id="aws-cdk-github-oidc.GithubActionsRole.property.roleId"></a>
982
+
983
+ ```typescript
984
+ public readonly roleId: string;
985
+ ```
986
+
987
+ - *Type:* string
988
+
989
+ Returns the stable and unique string identifying the role.
990
+
991
+ For example,
992
+ AIDAJQABLZS4A3QDU576Q.
993
+
994
+ ---
995
+
996
+ ##### `roleName`<sup>Required</sup> <a name="roleName" id="aws-cdk-github-oidc.GithubActionsRole.property.roleName"></a>
997
+
998
+ ```typescript
999
+ public readonly roleName: string;
1000
+ ```
1001
+
1002
+ - *Type:* string
1003
+
1004
+ Returns the name of the role.
1005
+
1006
+ ---
1007
+
1008
+ ##### `roleRef`<sup>Required</sup> <a name="roleRef" id="aws-cdk-github-oidc.GithubActionsRole.property.roleRef"></a>
1009
+
1010
+ ```typescript
1011
+ public readonly roleRef: RoleReference;
1012
+ ```
1013
+
1014
+ - *Type:* aws-cdk-lib.aws_iam.RoleReference
1015
+
1016
+ A reference to a Role resource.
1017
+
1018
+ ---
1019
+
1020
+ ##### `assumeRolePolicy`<sup>Optional</sup> <a name="assumeRolePolicy" id="aws-cdk-github-oidc.GithubActionsRole.property.assumeRolePolicy"></a>
1021
+
1022
+ ```typescript
1023
+ public readonly assumeRolePolicy: PolicyDocument;
1024
+ ```
1025
+
1026
+ - *Type:* aws-cdk-lib.aws_iam.PolicyDocument
1027
+
1028
+ The assume role policy document associated with this role.
1029
+
1030
+ ---
1031
+
1032
+ ##### `permissionsBoundary`<sup>Optional</sup> <a name="permissionsBoundary" id="aws-cdk-github-oidc.GithubActionsRole.property.permissionsBoundary"></a>
1033
+
1034
+ ```typescript
1035
+ public readonly permissionsBoundary: IManagedPolicy;
1036
+ ```
1037
+
1038
+ - *Type:* aws-cdk-lib.aws_iam.IManagedPolicy
1039
+
1040
+ Returns the permissions boundary attached to this role.
1041
+
1042
+ ---
1043
+
1044
+ ##### `principalAccount`<sup>Optional</sup> <a name="principalAccount" id="aws-cdk-github-oidc.GithubActionsRole.property.principalAccount"></a>
1045
+
1046
+ ```typescript
1047
+ public readonly principalAccount: string;
1048
+ ```
1049
+
1050
+ - *Type:* string
1051
+
1052
+ The AWS account ID of this principal.
1053
+
1054
+ Can be undefined when the account is not known
1055
+ (for example, for service principals).
1056
+ Can be a Token - in that case,
1057
+ it's assumed to be AWS::AccountId.
99
1058
 
100
1059
  ---
101
1060
 
102
- ##### `props`<sup>Required</sup> <a name="aws-cdk-github-oidc.GithubActionsRole.parameter.props"></a>
1061
+ #### Constants <a name="Constants" id="Constants"></a>
103
1062
 
104
- - *Type:* [`aws-cdk-github-oidc.GithubActionsRoleProps`](#aws-cdk-github-oidc.GithubActionsRoleProps)
1063
+ | **Name** | **Type** | **Description** |
1064
+ | --- | --- | --- |
1065
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRole.property.PROPERTY_INJECTION_ID">PROPERTY_INJECTION_ID</a></code> | <code>string</code> | Uniquely identifies this class. |
105
1066
 
106
1067
  ---
107
1068
 
1069
+ ##### `PROPERTY_INJECTION_ID`<sup>Required</sup> <a name="PROPERTY_INJECTION_ID" id="aws-cdk-github-oidc.GithubActionsRole.property.PROPERTY_INJECTION_ID"></a>
108
1070
 
1071
+ ```typescript
1072
+ public readonly PROPERTY_INJECTION_ID: string;
1073
+ ```
109
1074
 
1075
+ - *Type:* string
110
1076
 
1077
+ Uniquely identifies this class.
1078
+
1079
+ ---
111
1080
 
112
- ## Structs <a name="Structs"></a>
1081
+ ## Structs <a name="Structs" id="Structs"></a>
113
1082
 
114
- ### GithubActionsRoleProps <a name="aws-cdk-github-oidc.GithubActionsRoleProps"></a>
1083
+ ### GithubActionsRoleProps <a name="GithubActionsRoleProps" id="aws-cdk-github-oidc.GithubActionsRoleProps"></a>
115
1084
 
116
1085
  Props that define the IAM Role that can be assumed by Github Actions workflow via Github OpenID Connect Identity Provider.
117
1086
 
118
1087
  Besides `GithubConfiguration`, you may pass in any `iam.RoleProps` except `assumedBy`
119
1088
  which will be defined by this construct (CDK will fail if you do).
120
1089
 
121
- #### Initializer <a name="[object Object].Initializer"></a>
1090
+ *Example*
1091
+
1092
+ ```typescript
1093
+ {
1094
+ provider: GithubActionsIdentityProvider.fromAccount(scope, "GithubProvider"),
1095
+ owner: 'octo-org',
1096
+ repo: 'octo-repo',
1097
+ filter: 'ref:refs/tags/v*',
1098
+ roleName: 'MyDeployRole',
1099
+ }
1100
+ ```
1101
+
1102
+
1103
+ #### Initializer <a name="Initializer" id="aws-cdk-github-oidc.GithubActionsRoleProps.Initializer"></a>
122
1104
 
123
1105
  ```typescript
124
1106
  import { GithubActionsRoleProps } from 'aws-cdk-github-oidc'
@@ -126,25 +1108,51 @@ import { GithubActionsRoleProps } from 'aws-cdk-github-oidc'
126
1108
  const githubActionsRoleProps: GithubActionsRoleProps = { ... }
127
1109
  ```
128
1110
 
129
- ##### `owner`<sup>Required</sup> <a name="aws-cdk-github-oidc.GithubActionsRoleProps.property.owner"></a>
1111
+ #### Properties <a name="Properties" id="Properties"></a>
1112
+
1113
+ | **Name** | **Type** | **Description** |
1114
+ | --- | --- | --- |
1115
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRoleProps.property.owner">owner</a></code> | <code>string</code> | Repository owner (organization or username). |
1116
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRoleProps.property.provider">provider</a></code> | <code><a href="#aws-cdk-github-oidc.IGithubActionsIdentityProvider">IGithubActionsIdentityProvider</a></code> | Reference to Github OpenID Connect Provider configured in AWS IAM. |
1117
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRoleProps.property.repo">repo</a></code> | <code>string</code> | Repository name (slug) without the owner. |
1118
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRoleProps.property.filter">filter</a></code> | <code>string</code> | Subject condition filter, appended after `repo:${owner}/${repo}:` string in IAM Role trust relationship. |
1119
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRoleProps.property.description">description</a></code> | <code>string</code> | A description of the role. |
1120
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRoleProps.property.externalIds">externalIds</a></code> | <code>string[]</code> | List of IDs that the role assumer needs to provide one of when assuming this role. |
1121
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRoleProps.property.inlinePolicies">inlinePolicies</a></code> | <code>{[ key: string ]: aws-cdk-lib.aws_iam.PolicyDocument}</code> | A list of named policies to inline into this role. |
1122
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRoleProps.property.managedPolicies">managedPolicies</a></code> | <code>aws-cdk-lib.aws_iam.IManagedPolicy[]</code> | A list of managed policies associated with this role. |
1123
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRoleProps.property.maxSessionDuration">maxSessionDuration</a></code> | <code>aws-cdk-lib.Duration</code> | The maximum session duration that you want to set for the specified role. |
1124
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRoleProps.property.path">path</a></code> | <code>string</code> | The path associated with this role. |
1125
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRoleProps.property.permissionsBoundary">permissionsBoundary</a></code> | <code>aws-cdk-lib.aws_iam.IManagedPolicy</code> | AWS supports permissions boundaries for IAM entities (users or roles). |
1126
+ | <code><a href="#aws-cdk-github-oidc.GithubActionsRoleProps.property.roleName">roleName</a></code> | <code>string</code> | A name for the IAM role. |
1127
+
1128
+ ---
1129
+
1130
+ ##### `owner`<sup>Required</sup> <a name="owner" id="aws-cdk-github-oidc.GithubActionsRoleProps.property.owner"></a>
130
1131
 
131
1132
  ```typescript
132
1133
  public readonly owner: string;
133
1134
  ```
134
1135
 
135
- - *Type:* `string`
1136
+ - *Type:* string
136
1137
 
137
1138
  Repository owner (organization or username).
138
1139
 
139
1140
  ---
140
1141
 
141
- ##### `provider`<sup>Required</sup> <a name="aws-cdk-github-oidc.GithubActionsRoleProps.property.provider"></a>
1142
+ *Example*
1143
+
1144
+ ```typescript
1145
+ 'octo-org'
1146
+ ```
1147
+
1148
+
1149
+ ##### `provider`<sup>Required</sup> <a name="provider" id="aws-cdk-github-oidc.GithubActionsRoleProps.property.provider"></a>
142
1150
 
143
1151
  ```typescript
144
1152
  public readonly provider: IGithubActionsIdentityProvider;
145
1153
  ```
146
1154
 
147
- - *Type:* [`aws-cdk-github-oidc.IGithubActionsIdentityProvider`](#aws-cdk-github-oidc.IGithubActionsIdentityProvider)
1155
+ - *Type:* <a href="#aws-cdk-github-oidc.IGithubActionsIdentityProvider">IGithubActionsIdentityProvider</a>
148
1156
 
149
1157
  Reference to Github OpenID Connect Provider configured in AWS IAM.
150
1158
 
@@ -154,42 +1162,57 @@ There can be only one (per AWS Account).
154
1162
 
155
1163
  ---
156
1164
 
157
- ##### `repo`<sup>Required</sup> <a name="aws-cdk-github-oidc.GithubActionsRoleProps.property.repo"></a>
1165
+ ##### `repo`<sup>Required</sup> <a name="repo" id="aws-cdk-github-oidc.GithubActionsRoleProps.property.repo"></a>
158
1166
 
159
1167
  ```typescript
160
1168
  public readonly repo: string;
161
1169
  ```
162
1170
 
163
- - *Type:* `string`
1171
+ - *Type:* string
164
1172
 
165
1173
  Repository name (slug) without the owner.
166
1174
 
167
1175
  ---
168
1176
 
169
- ##### `filter`<sup>Optional</sup> <a name="aws-cdk-github-oidc.GithubActionsRoleProps.property.filter"></a>
1177
+ *Example*
170
1178
 
171
1179
  ```typescript
172
- public readonly filter: string;
1180
+ 'octo-repo'
173
1181
  ```
174
1182
 
175
- - *Type:* `string`
176
- - *Default:* '*'
177
1183
 
178
- You may use this value to only allow Github to assume the role on specific branches, tags, environments, pull requests etc.
1184
+ ##### `filter`<sup>Optional</sup> <a name="filter" id="aws-cdk-github-oidc.GithubActionsRoleProps.property.filter"></a>
1185
+
1186
+ ```typescript
1187
+ public readonly filter: string;
1188
+ ```
1189
+
1190
+ - *Type:* string
1191
+ - *Default:* '*' You may use this value to only allow Github to assume the role on specific branches, tags, environments, pull requests etc.
179
1192
 
180
1193
  Subject condition filter, appended after `repo:${owner}/${repo}:` string in IAM Role trust relationship.
181
1194
 
182
- > https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#examples
1195
+ > [https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#examples](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#examples)
183
1196
 
184
1197
  ---
185
1198
 
186
- ##### `description`<sup>Optional</sup> <a name="aws-cdk-github-oidc.GithubActionsRoleProps.property.description"></a>
1199
+ *Example*
1200
+
1201
+ ```typescript
1202
+ 'ref:refs/tags/v*'
1203
+ 'ref:refs/heads/demo-branch'
1204
+ 'pull_request'
1205
+ 'environment:Production'
1206
+ ```
1207
+
1208
+
1209
+ ##### `description`<sup>Optional</sup> <a name="description" id="aws-cdk-github-oidc.GithubActionsRoleProps.property.description"></a>
187
1210
 
188
1211
  ```typescript
189
1212
  public readonly description: string;
190
1213
  ```
191
1214
 
192
- - *Type:* `string`
1215
+ - *Type:* string
193
1216
  - *Default:* No description.
194
1217
 
195
1218
  A description of the role.
@@ -198,13 +1221,13 @@ It can be up to 1000 characters long.
198
1221
 
199
1222
  ---
200
1223
 
201
- ##### `externalIds`<sup>Optional</sup> <a name="aws-cdk-github-oidc.GithubActionsRoleProps.property.externalIds"></a>
1224
+ ##### `externalIds`<sup>Optional</sup> <a name="externalIds" id="aws-cdk-github-oidc.GithubActionsRoleProps.property.externalIds"></a>
202
1225
 
203
1226
  ```typescript
204
1227
  public readonly externalIds: string[];
205
1228
  ```
206
1229
 
207
- - *Type:* `string`[]
1230
+ - *Type:* string[]
208
1231
  - *Default:* No external ID required
209
1232
 
210
1233
  List of IDs that the role assumer needs to provide one of when assuming this role.
@@ -214,13 +1237,13 @@ AssumeRole operation will fail.
214
1237
 
215
1238
  ---
216
1239
 
217
- ##### `inlinePolicies`<sup>Optional</sup> <a name="aws-cdk-github-oidc.GithubActionsRoleProps.property.inlinePolicies"></a>
1240
+ ##### `inlinePolicies`<sup>Optional</sup> <a name="inlinePolicies" id="aws-cdk-github-oidc.GithubActionsRoleProps.property.inlinePolicies"></a>
218
1241
 
219
1242
  ```typescript
220
1243
  public readonly inlinePolicies: {[ key: string ]: PolicyDocument};
221
1244
  ```
222
1245
 
223
- - *Type:* {[ key: string ]: [`aws-cdk-lib.aws_iam.PolicyDocument`](#aws-cdk-lib.aws_iam.PolicyDocument)}
1246
+ - *Type:* {[ key: string ]: aws-cdk-lib.aws_iam.PolicyDocument}
224
1247
  - *Default:* No policy is inlined in the Role resource.
225
1248
 
226
1249
  A list of named policies to inline into this role.
@@ -232,13 +1255,13 @@ dependencies that could otherwise be introduced).
232
1255
 
233
1256
  ---
234
1257
 
235
- ##### `managedPolicies`<sup>Optional</sup> <a name="aws-cdk-github-oidc.GithubActionsRoleProps.property.managedPolicies"></a>
1258
+ ##### `managedPolicies`<sup>Optional</sup> <a name="managedPolicies" id="aws-cdk-github-oidc.GithubActionsRoleProps.property.managedPolicies"></a>
236
1259
 
237
1260
  ```typescript
238
1261
  public readonly managedPolicies: IManagedPolicy[];
239
1262
  ```
240
1263
 
241
- - *Type:* [`aws-cdk-lib.aws_iam.IManagedPolicy`](#aws-cdk-lib.aws_iam.IManagedPolicy)[]
1264
+ - *Type:* aws-cdk-lib.aws_iam.IManagedPolicy[]
242
1265
  - *Default:* No managed policies.
243
1266
 
244
1267
  A list of managed policies associated with this role.
@@ -248,13 +1271,13 @@ You can add managed policies later using
248
1271
 
249
1272
  ---
250
1273
 
251
- ##### `maxSessionDuration`<sup>Optional</sup> <a name="aws-cdk-github-oidc.GithubActionsRoleProps.property.maxSessionDuration"></a>
1274
+ ##### `maxSessionDuration`<sup>Optional</sup> <a name="maxSessionDuration" id="aws-cdk-github-oidc.GithubActionsRoleProps.property.maxSessionDuration"></a>
252
1275
 
253
1276
  ```typescript
254
1277
  public readonly maxSessionDuration: Duration;
255
1278
  ```
256
1279
 
257
- - *Type:* [`aws-cdk-lib.Duration`](#aws-cdk-lib.Duration)
1280
+ - *Type:* aws-cdk-lib.Duration
258
1281
  - *Default:* Duration.hours(1)
259
1282
 
260
1283
  The maximum session duration that you want to set for the specified role.
@@ -276,13 +1299,13 @@ but does not apply when you use those operations to create a console URL.
276
1299
 
277
1300
  ---
278
1301
 
279
- ##### `path`<sup>Optional</sup> <a name="aws-cdk-github-oidc.GithubActionsRoleProps.property.path"></a>
1302
+ ##### `path`<sup>Optional</sup> <a name="path" id="aws-cdk-github-oidc.GithubActionsRoleProps.property.path"></a>
280
1303
 
281
1304
  ```typescript
282
1305
  public readonly path: string;
283
1306
  ```
284
1307
 
285
- - *Type:* `string`
1308
+ - *Type:* string
286
1309
  - *Default:* /
287
1310
 
288
1311
  The path associated with this role.
@@ -292,13 +1315,13 @@ Friendly Names and Paths in IAM User Guide.
292
1315
 
293
1316
  ---
294
1317
 
295
- ##### `permissionsBoundary`<sup>Optional</sup> <a name="aws-cdk-github-oidc.GithubActionsRoleProps.property.permissionsBoundary"></a>
1318
+ ##### `permissionsBoundary`<sup>Optional</sup> <a name="permissionsBoundary" id="aws-cdk-github-oidc.GithubActionsRoleProps.property.permissionsBoundary"></a>
296
1319
 
297
1320
  ```typescript
298
1321
  public readonly permissionsBoundary: IManagedPolicy;
299
1322
  ```
300
1323
 
301
- - *Type:* [`aws-cdk-lib.aws_iam.IManagedPolicy`](#aws-cdk-lib.aws_iam.IManagedPolicy)
1324
+ - *Type:* aws-cdk-lib.aws_iam.IManagedPolicy
302
1325
  - *Default:* No permissions boundary.
303
1326
 
304
1327
  AWS supports permissions boundaries for IAM entities (users or roles).
@@ -313,15 +1336,14 @@ permissions boundaries.
313
1336
 
314
1337
  ---
315
1338
 
316
- ##### `roleName`<sup>Optional</sup> <a name="aws-cdk-github-oidc.GithubActionsRoleProps.property.roleName"></a>
1339
+ ##### `roleName`<sup>Optional</sup> <a name="roleName" id="aws-cdk-github-oidc.GithubActionsRoleProps.property.roleName"></a>
317
1340
 
318
1341
  ```typescript
319
1342
  public readonly roleName: string;
320
1343
  ```
321
1344
 
322
- - *Type:* `string`
323
- - *Default:* AWS CloudFormation generates a unique physical ID and uses that ID
324
- for the role name.
1345
+ - *Type:* string
1346
+ - *Default:* AWS CloudFormation generates a unique physical ID and uses that ID for the role name.
325
1347
 
326
1348
  A name for the IAM role.
327
1349
 
@@ -338,11 +1360,11 @@ Acknowledging IAM Resources in AWS CloudFormation Templates.
338
1360
 
339
1361
  ---
340
1362
 
341
- ### GithubConfiguration <a name="aws-cdk-github-oidc.GithubConfiguration"></a>
1363
+ ### GithubConfiguration <a name="GithubConfiguration" id="aws-cdk-github-oidc.GithubConfiguration"></a>
342
1364
 
343
1365
  Github related configuration that forms the trust policy for this IAM Role.
344
1366
 
345
- #### Initializer <a name="[object Object].Initializer"></a>
1367
+ #### Initializer <a name="Initializer" id="aws-cdk-github-oidc.GithubConfiguration.Initializer"></a>
346
1368
 
347
1369
  ```typescript
348
1370
  import { GithubConfiguration } from 'aws-cdk-github-oidc'
@@ -350,25 +1372,43 @@ import { GithubConfiguration } from 'aws-cdk-github-oidc'
350
1372
  const githubConfiguration: GithubConfiguration = { ... }
351
1373
  ```
352
1374
 
353
- ##### `owner`<sup>Required</sup> <a name="aws-cdk-github-oidc.GithubConfiguration.property.owner"></a>
1375
+ #### Properties <a name="Properties" id="Properties"></a>
1376
+
1377
+ | **Name** | **Type** | **Description** |
1378
+ | --- | --- | --- |
1379
+ | <code><a href="#aws-cdk-github-oidc.GithubConfiguration.property.owner">owner</a></code> | <code>string</code> | Repository owner (organization or username). |
1380
+ | <code><a href="#aws-cdk-github-oidc.GithubConfiguration.property.provider">provider</a></code> | <code><a href="#aws-cdk-github-oidc.IGithubActionsIdentityProvider">IGithubActionsIdentityProvider</a></code> | Reference to Github OpenID Connect Provider configured in AWS IAM. |
1381
+ | <code><a href="#aws-cdk-github-oidc.GithubConfiguration.property.repo">repo</a></code> | <code>string</code> | Repository name (slug) without the owner. |
1382
+ | <code><a href="#aws-cdk-github-oidc.GithubConfiguration.property.filter">filter</a></code> | <code>string</code> | Subject condition filter, appended after `repo:${owner}/${repo}:` string in IAM Role trust relationship. |
1383
+
1384
+ ---
1385
+
1386
+ ##### `owner`<sup>Required</sup> <a name="owner" id="aws-cdk-github-oidc.GithubConfiguration.property.owner"></a>
354
1387
 
355
1388
  ```typescript
356
1389
  public readonly owner: string;
357
1390
  ```
358
1391
 
359
- - *Type:* `string`
1392
+ - *Type:* string
360
1393
 
361
1394
  Repository owner (organization or username).
362
1395
 
363
1396
  ---
364
1397
 
365
- ##### `provider`<sup>Required</sup> <a name="aws-cdk-github-oidc.GithubConfiguration.property.provider"></a>
1398
+ *Example*
1399
+
1400
+ ```typescript
1401
+ 'octo-org'
1402
+ ```
1403
+
1404
+
1405
+ ##### `provider`<sup>Required</sup> <a name="provider" id="aws-cdk-github-oidc.GithubConfiguration.property.provider"></a>
366
1406
 
367
1407
  ```typescript
368
1408
  public readonly provider: IGithubActionsIdentityProvider;
369
1409
  ```
370
1410
 
371
- - *Type:* [`aws-cdk-github-oidc.IGithubActionsIdentityProvider`](#aws-cdk-github-oidc.IGithubActionsIdentityProvider)
1411
+ - *Type:* <a href="#aws-cdk-github-oidc.IGithubActionsIdentityProvider">IGithubActionsIdentityProvider</a>
372
1412
 
373
1413
  Reference to Github OpenID Connect Provider configured in AWS IAM.
374
1414
 
@@ -378,45 +1418,57 @@ There can be only one (per AWS Account).
378
1418
 
379
1419
  ---
380
1420
 
381
- ##### `repo`<sup>Required</sup> <a name="aws-cdk-github-oidc.GithubConfiguration.property.repo"></a>
1421
+ ##### `repo`<sup>Required</sup> <a name="repo" id="aws-cdk-github-oidc.GithubConfiguration.property.repo"></a>
382
1422
 
383
1423
  ```typescript
384
1424
  public readonly repo: string;
385
1425
  ```
386
1426
 
387
- - *Type:* `string`
1427
+ - *Type:* string
388
1428
 
389
1429
  Repository name (slug) without the owner.
390
1430
 
391
1431
  ---
392
1432
 
393
- ##### `filter`<sup>Optional</sup> <a name="aws-cdk-github-oidc.GithubConfiguration.property.filter"></a>
1433
+ *Example*
394
1434
 
395
1435
  ```typescript
396
- public readonly filter: string;
1436
+ 'octo-repo'
397
1437
  ```
398
1438
 
399
- - *Type:* `string`
400
- - *Default:* '*'
401
1439
 
402
- You may use this value to only allow Github to assume the role on specific branches, tags, environments, pull requests etc.
1440
+ ##### `filter`<sup>Optional</sup> <a name="filter" id="aws-cdk-github-oidc.GithubConfiguration.property.filter"></a>
1441
+
1442
+ ```typescript
1443
+ public readonly filter: string;
1444
+ ```
1445
+
1446
+ - *Type:* string
1447
+ - *Default:* '*' You may use this value to only allow Github to assume the role on specific branches, tags, environments, pull requests etc.
403
1448
 
404
1449
  Subject condition filter, appended after `repo:${owner}/${repo}:` string in IAM Role trust relationship.
405
1450
 
406
- > https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#examples
1451
+ > [https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#examples](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#examples)
407
1452
 
408
1453
  ---
409
1454
 
410
- ### RoleProps <a name="aws-cdk-github-oidc.RoleProps"></a>
1455
+ *Example*
411
1456
 
412
- Properties for defining an IAM Role.
1457
+ ```typescript
1458
+ 'ref:refs/tags/v*'
1459
+ 'ref:refs/heads/demo-branch'
1460
+ 'pull_request'
1461
+ 'environment:Production'
1462
+ ```
1463
+
1464
+
1465
+ ### RoleProps <a name="RoleProps" id="aws-cdk-github-oidc.RoleProps"></a>
413
1466
 
414
- These are copied fron @aws-cdk/aws-iam, but since JSII does not support
415
- TypeScript <Partial<iam.RoleProps>> (or Omit), we have to do this stupid thing.
1467
+ Properties for defining an IAM Role.
416
1468
 
417
- Basically exactly the same as source, but with assumedBy removed.
1469
+ These are copied fron
418
1470
 
419
- #### Initializer <a name="[object Object].Initializer"></a>
1471
+ #### Initializer <a name="Initializer" id="aws-cdk-github-oidc.RoleProps.Initializer"></a>
420
1472
 
421
1473
  ```typescript
422
1474
  import { RoleProps } from 'aws-cdk-github-oidc'
@@ -424,13 +1476,28 @@ import { RoleProps } from 'aws-cdk-github-oidc'
424
1476
  const roleProps: RoleProps = { ... }
425
1477
  ```
426
1478
 
427
- ##### `description`<sup>Optional</sup> <a name="aws-cdk-github-oidc.RoleProps.property.description"></a>
1479
+ #### Properties <a name="Properties" id="Properties"></a>
1480
+
1481
+ | **Name** | **Type** | **Description** |
1482
+ | --- | --- | --- |
1483
+ | <code><a href="#aws-cdk-github-oidc.RoleProps.property.description">description</a></code> | <code>string</code> | A description of the role. |
1484
+ | <code><a href="#aws-cdk-github-oidc.RoleProps.property.externalIds">externalIds</a></code> | <code>string[]</code> | List of IDs that the role assumer needs to provide one of when assuming this role. |
1485
+ | <code><a href="#aws-cdk-github-oidc.RoleProps.property.inlinePolicies">inlinePolicies</a></code> | <code>{[ key: string ]: aws-cdk-lib.aws_iam.PolicyDocument}</code> | A list of named policies to inline into this role. |
1486
+ | <code><a href="#aws-cdk-github-oidc.RoleProps.property.managedPolicies">managedPolicies</a></code> | <code>aws-cdk-lib.aws_iam.IManagedPolicy[]</code> | A list of managed policies associated with this role. |
1487
+ | <code><a href="#aws-cdk-github-oidc.RoleProps.property.maxSessionDuration">maxSessionDuration</a></code> | <code>aws-cdk-lib.Duration</code> | The maximum session duration that you want to set for the specified role. |
1488
+ | <code><a href="#aws-cdk-github-oidc.RoleProps.property.path">path</a></code> | <code>string</code> | The path associated with this role. |
1489
+ | <code><a href="#aws-cdk-github-oidc.RoleProps.property.permissionsBoundary">permissionsBoundary</a></code> | <code>aws-cdk-lib.aws_iam.IManagedPolicy</code> | AWS supports permissions boundaries for IAM entities (users or roles). |
1490
+ | <code><a href="#aws-cdk-github-oidc.RoleProps.property.roleName">roleName</a></code> | <code>string</code> | A name for the IAM role. |
1491
+
1492
+ ---
1493
+
1494
+ ##### `description`<sup>Optional</sup> <a name="description" id="aws-cdk-github-oidc.RoleProps.property.description"></a>
428
1495
 
429
1496
  ```typescript
430
1497
  public readonly description: string;
431
1498
  ```
432
1499
 
433
- - *Type:* `string`
1500
+ - *Type:* string
434
1501
  - *Default:* No description.
435
1502
 
436
1503
  A description of the role.
@@ -439,13 +1506,13 @@ It can be up to 1000 characters long.
439
1506
 
440
1507
  ---
441
1508
 
442
- ##### `externalIds`<sup>Optional</sup> <a name="aws-cdk-github-oidc.RoleProps.property.externalIds"></a>
1509
+ ##### `externalIds`<sup>Optional</sup> <a name="externalIds" id="aws-cdk-github-oidc.RoleProps.property.externalIds"></a>
443
1510
 
444
1511
  ```typescript
445
1512
  public readonly externalIds: string[];
446
1513
  ```
447
1514
 
448
- - *Type:* `string`[]
1515
+ - *Type:* string[]
449
1516
  - *Default:* No external ID required
450
1517
 
451
1518
  List of IDs that the role assumer needs to provide one of when assuming this role.
@@ -455,13 +1522,13 @@ AssumeRole operation will fail.
455
1522
 
456
1523
  ---
457
1524
 
458
- ##### `inlinePolicies`<sup>Optional</sup> <a name="aws-cdk-github-oidc.RoleProps.property.inlinePolicies"></a>
1525
+ ##### `inlinePolicies`<sup>Optional</sup> <a name="inlinePolicies" id="aws-cdk-github-oidc.RoleProps.property.inlinePolicies"></a>
459
1526
 
460
1527
  ```typescript
461
1528
  public readonly inlinePolicies: {[ key: string ]: PolicyDocument};
462
1529
  ```
463
1530
 
464
- - *Type:* {[ key: string ]: [`aws-cdk-lib.aws_iam.PolicyDocument`](#aws-cdk-lib.aws_iam.PolicyDocument)}
1531
+ - *Type:* {[ key: string ]: aws-cdk-lib.aws_iam.PolicyDocument}
465
1532
  - *Default:* No policy is inlined in the Role resource.
466
1533
 
467
1534
  A list of named policies to inline into this role.
@@ -473,13 +1540,13 @@ dependencies that could otherwise be introduced).
473
1540
 
474
1541
  ---
475
1542
 
476
- ##### `managedPolicies`<sup>Optional</sup> <a name="aws-cdk-github-oidc.RoleProps.property.managedPolicies"></a>
1543
+ ##### `managedPolicies`<sup>Optional</sup> <a name="managedPolicies" id="aws-cdk-github-oidc.RoleProps.property.managedPolicies"></a>
477
1544
 
478
1545
  ```typescript
479
1546
  public readonly managedPolicies: IManagedPolicy[];
480
1547
  ```
481
1548
 
482
- - *Type:* [`aws-cdk-lib.aws_iam.IManagedPolicy`](#aws-cdk-lib.aws_iam.IManagedPolicy)[]
1549
+ - *Type:* aws-cdk-lib.aws_iam.IManagedPolicy[]
483
1550
  - *Default:* No managed policies.
484
1551
 
485
1552
  A list of managed policies associated with this role.
@@ -489,13 +1556,13 @@ You can add managed policies later using
489
1556
 
490
1557
  ---
491
1558
 
492
- ##### `maxSessionDuration`<sup>Optional</sup> <a name="aws-cdk-github-oidc.RoleProps.property.maxSessionDuration"></a>
1559
+ ##### `maxSessionDuration`<sup>Optional</sup> <a name="maxSessionDuration" id="aws-cdk-github-oidc.RoleProps.property.maxSessionDuration"></a>
493
1560
 
494
1561
  ```typescript
495
1562
  public readonly maxSessionDuration: Duration;
496
1563
  ```
497
1564
 
498
- - *Type:* [`aws-cdk-lib.Duration`](#aws-cdk-lib.Duration)
1565
+ - *Type:* aws-cdk-lib.Duration
499
1566
  - *Default:* Duration.hours(1)
500
1567
 
501
1568
  The maximum session duration that you want to set for the specified role.
@@ -517,13 +1584,13 @@ but does not apply when you use those operations to create a console URL.
517
1584
 
518
1585
  ---
519
1586
 
520
- ##### `path`<sup>Optional</sup> <a name="aws-cdk-github-oidc.RoleProps.property.path"></a>
1587
+ ##### `path`<sup>Optional</sup> <a name="path" id="aws-cdk-github-oidc.RoleProps.property.path"></a>
521
1588
 
522
1589
  ```typescript
523
1590
  public readonly path: string;
524
1591
  ```
525
1592
 
526
- - *Type:* `string`
1593
+ - *Type:* string
527
1594
  - *Default:* /
528
1595
 
529
1596
  The path associated with this role.
@@ -533,13 +1600,13 @@ Friendly Names and Paths in IAM User Guide.
533
1600
 
534
1601
  ---
535
1602
 
536
- ##### `permissionsBoundary`<sup>Optional</sup> <a name="aws-cdk-github-oidc.RoleProps.property.permissionsBoundary"></a>
1603
+ ##### `permissionsBoundary`<sup>Optional</sup> <a name="permissionsBoundary" id="aws-cdk-github-oidc.RoleProps.property.permissionsBoundary"></a>
537
1604
 
538
1605
  ```typescript
539
1606
  public readonly permissionsBoundary: IManagedPolicy;
540
1607
  ```
541
1608
 
542
- - *Type:* [`aws-cdk-lib.aws_iam.IManagedPolicy`](#aws-cdk-lib.aws_iam.IManagedPolicy)
1609
+ - *Type:* aws-cdk-lib.aws_iam.IManagedPolicy
543
1610
  - *Default:* No permissions boundary.
544
1611
 
545
1612
  AWS supports permissions boundaries for IAM entities (users or roles).
@@ -554,15 +1621,14 @@ permissions boundaries.
554
1621
 
555
1622
  ---
556
1623
 
557
- ##### `roleName`<sup>Optional</sup> <a name="aws-cdk-github-oidc.RoleProps.property.roleName"></a>
1624
+ ##### `roleName`<sup>Optional</sup> <a name="roleName" id="aws-cdk-github-oidc.RoleProps.property.roleName"></a>
558
1625
 
559
1626
  ```typescript
560
1627
  public readonly roleName: string;
561
1628
  ```
562
1629
 
563
- - *Type:* `string`
564
- - *Default:* AWS CloudFormation generates a unique physical ID and uses that ID
565
- for the role name.
1630
+ - *Type:* string
1631
+ - *Default:* AWS CloudFormation generates a unique physical ID and uses that ID for the role name.
566
1632
 
567
1633
  A name for the IAM role.
568
1634
 
@@ -580,38 +1646,49 @@ Acknowledging IAM Resources in AWS CloudFormation Templates.
580
1646
  ---
581
1647
 
582
1648
 
583
- ## Protocols <a name="Protocols"></a>
1649
+ ## Protocols <a name="Protocols" id="Protocols"></a>
584
1650
 
585
- ### IGithubActionsIdentityProvider <a name="aws-cdk-github-oidc.IGithubActionsIdentityProvider"></a>
1651
+ ### IGithubActionsIdentityProvider <a name="IGithubActionsIdentityProvider" id="aws-cdk-github-oidc.IGithubActionsIdentityProvider"></a>
586
1652
 
587
- - *Extends:* [`aws-cdk-lib.aws_iam.IOpenIdConnectProvider`](#aws-cdk-lib.aws_iam.IOpenIdConnectProvider)
1653
+ - *Extends:* aws-cdk-lib.aws_iam.IOidcProvider
588
1654
 
589
- - *Implemented By:* [`aws-cdk-github-oidc.GithubActionsIdentityProvider`](#aws-cdk-github-oidc.GithubActionsIdentityProvider), [`aws-cdk-github-oidc.IGithubActionsIdentityProvider`](#aws-cdk-github-oidc.IGithubActionsIdentityProvider)
1655
+ - *Implemented By:* <a href="#aws-cdk-github-oidc.GithubActionsIdentityProvider">GithubActionsIdentityProvider</a>, <a href="#aws-cdk-github-oidc.IGithubActionsIdentityProvider">IGithubActionsIdentityProvider</a>
590
1656
 
591
1657
  Describes a Github OpenID Connect Identity Provider for AWS IAM.
592
1658
 
593
1659
 
594
- #### Properties <a name="Properties"></a>
1660
+ #### Properties <a name="Properties" id="Properties"></a>
1661
+
1662
+ | **Name** | **Type** | **Description** |
1663
+ | --- | --- | --- |
1664
+ | <code><a href="#aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
1665
+ | <code><a href="#aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.env">env</a></code> | <code>aws-cdk-lib.ResourceEnvironment</code> | The environment this resource belongs to. |
1666
+ | <code><a href="#aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.stack">stack</a></code> | <code>aws-cdk-lib.Stack</code> | The stack in which this resource is defined. |
1667
+ | <code><a href="#aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.oidcProviderRef">oidcProviderRef</a></code> | <code>aws-cdk-lib.aws_iam.OIDCProviderReference</code> | A reference to a OIDCProvider resource. |
1668
+ | <code><a href="#aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.oidcProviderArn">oidcProviderArn</a></code> | <code>string</code> | The Amazon Resource Name (ARN) of the IAM OpenID Connect provider. |
1669
+ | <code><a href="#aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.oidcProviderIssuer">oidcProviderIssuer</a></code> | <code>string</code> | The issuer for OIDC Provider. |
1670
+
1671
+ ---
595
1672
 
596
- ##### `node`<sup>Required</sup> <a name="aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.node"></a>
1673
+ ##### `node`<sup>Required</sup> <a name="node" id="aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.node"></a>
597
1674
 
598
1675
  ```typescript
599
1676
  public readonly node: Node;
600
1677
  ```
601
1678
 
602
- - *Type:* [`constructs.Node`](#constructs.Node)
1679
+ - *Type:* constructs.Node
603
1680
 
604
1681
  The tree node.
605
1682
 
606
1683
  ---
607
1684
 
608
- ##### `env`<sup>Required</sup> <a name="aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.env"></a>
1685
+ ##### `env`<sup>Required</sup> <a name="env" id="aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.env"></a>
609
1686
 
610
1687
  ```typescript
611
1688
  public readonly env: ResourceEnvironment;
612
1689
  ```
613
1690
 
614
- - *Type:* [`aws-cdk-lib.ResourceEnvironment`](#aws-cdk-lib.ResourceEnvironment)
1691
+ - *Type:* aws-cdk-lib.ResourceEnvironment
615
1692
 
616
1693
  The environment this resource belongs to.
617
1694
 
@@ -624,37 +1701,49 @@ that might be different than the stack they were imported into.
624
1701
 
625
1702
  ---
626
1703
 
627
- ##### `stack`<sup>Required</sup> <a name="aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.stack"></a>
1704
+ ##### `stack`<sup>Required</sup> <a name="stack" id="aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.stack"></a>
628
1705
 
629
1706
  ```typescript
630
1707
  public readonly stack: Stack;
631
1708
  ```
632
1709
 
633
- - *Type:* [`aws-cdk-lib.Stack`](#aws-cdk-lib.Stack)
1710
+ - *Type:* aws-cdk-lib.Stack
634
1711
 
635
1712
  The stack in which this resource is defined.
636
1713
 
637
1714
  ---
638
1715
 
639
- ##### `openIdConnectProviderArn`<sup>Required</sup> <a name="aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.openIdConnectProviderArn"></a>
1716
+ ##### `oidcProviderRef`<sup>Required</sup> <a name="oidcProviderRef" id="aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.oidcProviderRef"></a>
1717
+
1718
+ ```typescript
1719
+ public readonly oidcProviderRef: OIDCProviderReference;
1720
+ ```
1721
+
1722
+ - *Type:* aws-cdk-lib.aws_iam.OIDCProviderReference
1723
+
1724
+ A reference to a OIDCProvider resource.
1725
+
1726
+ ---
1727
+
1728
+ ##### `oidcProviderArn`<sup>Required</sup> <a name="oidcProviderArn" id="aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.oidcProviderArn"></a>
640
1729
 
641
1730
  ```typescript
642
- public readonly openIdConnectProviderArn: string;
1731
+ public readonly oidcProviderArn: string;
643
1732
  ```
644
1733
 
645
- - *Type:* `string`
1734
+ - *Type:* string
646
1735
 
647
1736
  The Amazon Resource Name (ARN) of the IAM OpenID Connect provider.
648
1737
 
649
1738
  ---
650
1739
 
651
- ##### `openIdConnectProviderIssuer`<sup>Required</sup> <a name="aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.openIdConnectProviderIssuer"></a>
1740
+ ##### `oidcProviderIssuer`<sup>Required</sup> <a name="oidcProviderIssuer" id="aws-cdk-github-oidc.IGithubActionsIdentityProvider.property.oidcProviderIssuer"></a>
652
1741
 
653
1742
  ```typescript
654
- public readonly openIdConnectProviderIssuer: string;
1743
+ public readonly oidcProviderIssuer: string;
655
1744
  ```
656
1745
 
657
- - *Type:* `string`
1746
+ - *Type:* string
658
1747
 
659
1748
  The issuer for OIDC Provider.
660
1749