@pcg-x-aws/cdk-iamuserwithaccesskey 1.2.114 → 2.0.0-alpha.1
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/.jsii +3 -3
- package/API.md +1 -406
- package/lib/index.d.ts +1 -1
- package/lib/index.js +12 -9
- package/package.json +1 -1
package/.jsii
CHANGED
|
@@ -8940,7 +8940,7 @@
|
|
|
8940
8940
|
"types": {
|
|
8941
8941
|
"@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey": {
|
|
8942
8942
|
"assembly": "@pcg-x-aws/cdk-iamuserwithaccesskey",
|
|
8943
|
-
"base": "
|
|
8943
|
+
"base": "constructs.Construct",
|
|
8944
8944
|
"docs": {
|
|
8945
8945
|
"remarks": "The properties as for normal IAM Users.",
|
|
8946
8946
|
"stability": "stable",
|
|
@@ -9063,6 +9063,6 @@
|
|
|
9063
9063
|
"symbolId": "src/index:IamUserWithAccessKeyProps"
|
|
9064
9064
|
}
|
|
9065
9065
|
},
|
|
9066
|
-
"version": "
|
|
9067
|
-
"fingerprint": "
|
|
9066
|
+
"version": "2.0.0-alpha.1",
|
|
9067
|
+
"fingerprint": "t1g+9+8ltqXb9tHQIPZAiZL+7n8D+9McsVE/o8Z7bDo="
|
|
9068
9068
|
}
|
package/API.md
CHANGED
|
@@ -48,12 +48,6 @@ new IamUserWithAccessKey(scope: Construct, id: string, props?: IamUserWithAccess
|
|
|
48
48
|
| --- | --- |
|
|
49
49
|
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
50
50
|
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.with">with</a></code> | Applies one or more mixins to this construct. |
|
|
51
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.applyRemovalPolicy">applyRemovalPolicy</a></code> | Apply the given removal policy to this resource. |
|
|
52
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.addManagedPolicy">addManagedPolicy</a></code> | Attaches a managed policy to the user. |
|
|
53
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.addToGroup">addToGroup</a></code> | Adds this user to a group. |
|
|
54
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.addToPolicy">addToPolicy</a></code> | Add to the policy of this principal. |
|
|
55
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.addToPrincipalPolicy">addToPrincipalPolicy</a></code> | Adds an IAM statement to the default policy. |
|
|
56
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.attachInlinePolicy">attachInlinePolicy</a></code> | Attaches a policy to this user. |
|
|
57
51
|
|
|
58
52
|
---
|
|
59
53
|
|
|
@@ -82,99 +76,7 @@ constructs.
|
|
|
82
76
|
|
|
83
77
|
- *Type:* ...constructs.IMixin[]
|
|
84
78
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
##### `applyRemovalPolicy` <a name="applyRemovalPolicy" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.applyRemovalPolicy"></a>
|
|
88
|
-
|
|
89
|
-
```typescript
|
|
90
|
-
public applyRemovalPolicy(policy: RemovalPolicy): void
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
Apply the given removal policy to this resource.
|
|
94
|
-
|
|
95
|
-
The Removal Policy controls what happens to this resource when it stops
|
|
96
|
-
being managed by CloudFormation, either because you've removed it from the
|
|
97
|
-
CDK application or because you've made a change that requires the resource
|
|
98
|
-
to be replaced.
|
|
99
|
-
|
|
100
|
-
The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
|
|
101
|
-
account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
|
|
102
|
-
|
|
103
|
-
###### `policy`<sup>Required</sup> <a name="policy" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.applyRemovalPolicy.parameter.policy"></a>
|
|
104
|
-
|
|
105
|
-
- *Type:* aws-cdk-lib.RemovalPolicy
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
##### `addManagedPolicy` <a name="addManagedPolicy" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.addManagedPolicy"></a>
|
|
110
|
-
|
|
111
|
-
```typescript
|
|
112
|
-
public addManagedPolicy(policy: IManagedPolicy): void
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Attaches a managed policy to the user.
|
|
116
|
-
|
|
117
|
-
###### `policy`<sup>Required</sup> <a name="policy" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.addManagedPolicy.parameter.policy"></a>
|
|
118
|
-
|
|
119
|
-
- *Type:* aws-cdk-lib.aws_iam.IManagedPolicy
|
|
120
|
-
|
|
121
|
-
The managed policy to attach.
|
|
122
|
-
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
##### `addToGroup` <a name="addToGroup" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.addToGroup"></a>
|
|
126
|
-
|
|
127
|
-
```typescript
|
|
128
|
-
public addToGroup(group: IGroup): void
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
Adds this user to a group.
|
|
132
|
-
|
|
133
|
-
###### `group`<sup>Required</sup> <a name="group" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.addToGroup.parameter.group"></a>
|
|
134
|
-
|
|
135
|
-
- *Type:* aws-cdk-lib.aws_iam.IGroup
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
##### `addToPolicy` <a name="addToPolicy" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.addToPolicy"></a>
|
|
140
|
-
|
|
141
|
-
```typescript
|
|
142
|
-
public addToPolicy(statement: PolicyStatement): boolean
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Add to the policy of this principal.
|
|
146
|
-
|
|
147
|
-
###### `statement`<sup>Required</sup> <a name="statement" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.addToPolicy.parameter.statement"></a>
|
|
148
|
-
|
|
149
|
-
- *Type:* aws-cdk-lib.aws_iam.PolicyStatement
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
##### `addToPrincipalPolicy` <a name="addToPrincipalPolicy" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.addToPrincipalPolicy"></a>
|
|
154
|
-
|
|
155
|
-
```typescript
|
|
156
|
-
public addToPrincipalPolicy(statement: PolicyStatement): AddToPrincipalPolicyResult
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
Adds an IAM statement to the default policy.
|
|
160
|
-
|
|
161
|
-
###### `statement`<sup>Required</sup> <a name="statement" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.addToPrincipalPolicy.parameter.statement"></a>
|
|
162
|
-
|
|
163
|
-
- *Type:* aws-cdk-lib.aws_iam.PolicyStatement
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
##### `attachInlinePolicy` <a name="attachInlinePolicy" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.attachInlinePolicy"></a>
|
|
168
|
-
|
|
169
|
-
```typescript
|
|
170
|
-
public attachInlinePolicy(policy: Policy): void
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
Attaches a policy to this user.
|
|
174
|
-
|
|
175
|
-
###### `policy`<sup>Required</sup> <a name="policy" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.attachInlinePolicy.parameter.policy"></a>
|
|
176
|
-
|
|
177
|
-
- *Type:* aws-cdk-lib.aws_iam.Policy
|
|
79
|
+
The mixins to apply.
|
|
178
80
|
|
|
179
81
|
---
|
|
180
82
|
|
|
@@ -183,11 +85,6 @@ Attaches a policy to this user.
|
|
|
183
85
|
| **Name** | **Description** |
|
|
184
86
|
| --- | --- |
|
|
185
87
|
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
|
|
186
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.isOwnedResource">isOwnedResource</a></code> | Returns true if the construct was created by CDK, and false otherwise. |
|
|
187
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.isResource">isResource</a></code> | Check whether the given construct is a Resource. |
|
|
188
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserArn">fromUserArn</a></code> | Import an existing user given a user ARN. |
|
|
189
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserAttributes">fromUserAttributes</a></code> | Import an existing user given user attributes. |
|
|
190
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserName">fromUserName</a></code> | Import an existing user given a username. |
|
|
191
88
|
|
|
192
89
|
---
|
|
193
90
|
|
|
@@ -223,161 +120,11 @@ Any object.
|
|
|
223
120
|
|
|
224
121
|
---
|
|
225
122
|
|
|
226
|
-
##### `isOwnedResource` <a name="isOwnedResource" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.isOwnedResource"></a>
|
|
227
|
-
|
|
228
|
-
```typescript
|
|
229
|
-
import { IamUserWithAccessKey } from '@pcg-x-aws/cdk-iamuserwithaccesskey'
|
|
230
|
-
|
|
231
|
-
IamUserWithAccessKey.isOwnedResource(construct: IConstruct)
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
Returns true if the construct was created by CDK, and false otherwise.
|
|
235
|
-
|
|
236
|
-
###### `construct`<sup>Required</sup> <a name="construct" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.isOwnedResource.parameter.construct"></a>
|
|
237
|
-
|
|
238
|
-
- *Type:* constructs.IConstruct
|
|
239
|
-
|
|
240
|
-
---
|
|
241
|
-
|
|
242
|
-
##### `isResource` <a name="isResource" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.isResource"></a>
|
|
243
|
-
|
|
244
|
-
```typescript
|
|
245
|
-
import { IamUserWithAccessKey } from '@pcg-x-aws/cdk-iamuserwithaccesskey'
|
|
246
|
-
|
|
247
|
-
IamUserWithAccessKey.isResource(construct: IConstruct)
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
Check whether the given construct is a Resource.
|
|
251
|
-
|
|
252
|
-
###### `construct`<sup>Required</sup> <a name="construct" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.isResource.parameter.construct"></a>
|
|
253
|
-
|
|
254
|
-
- *Type:* constructs.IConstruct
|
|
255
|
-
|
|
256
|
-
---
|
|
257
|
-
|
|
258
|
-
##### `fromUserArn` <a name="fromUserArn" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserArn"></a>
|
|
259
|
-
|
|
260
|
-
```typescript
|
|
261
|
-
import { IamUserWithAccessKey } from '@pcg-x-aws/cdk-iamuserwithaccesskey'
|
|
262
|
-
|
|
263
|
-
IamUserWithAccessKey.fromUserArn(scope: Construct, id: string, userArn: string)
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
Import an existing user given a user ARN.
|
|
267
|
-
|
|
268
|
-
If the ARN comes from a Token, the User cannot have a path; if so, any attempt
|
|
269
|
-
to reference its username will fail.
|
|
270
|
-
|
|
271
|
-
###### `scope`<sup>Required</sup> <a name="scope" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserArn.parameter.scope"></a>
|
|
272
|
-
|
|
273
|
-
- *Type:* constructs.Construct
|
|
274
|
-
|
|
275
|
-
construct scope.
|
|
276
|
-
|
|
277
|
-
---
|
|
278
|
-
|
|
279
|
-
###### `id`<sup>Required</sup> <a name="id" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserArn.parameter.id"></a>
|
|
280
|
-
|
|
281
|
-
- *Type:* string
|
|
282
|
-
|
|
283
|
-
construct id.
|
|
284
|
-
|
|
285
|
-
---
|
|
286
|
-
|
|
287
|
-
###### `userArn`<sup>Required</sup> <a name="userArn" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserArn.parameter.userArn"></a>
|
|
288
|
-
|
|
289
|
-
- *Type:* string
|
|
290
|
-
|
|
291
|
-
the ARN of an existing user to import.
|
|
292
|
-
|
|
293
|
-
---
|
|
294
|
-
|
|
295
|
-
##### `fromUserAttributes` <a name="fromUserAttributes" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserAttributes"></a>
|
|
296
|
-
|
|
297
|
-
```typescript
|
|
298
|
-
import { IamUserWithAccessKey } from '@pcg-x-aws/cdk-iamuserwithaccesskey'
|
|
299
|
-
|
|
300
|
-
IamUserWithAccessKey.fromUserAttributes(scope: Construct, id: string, attrs: UserAttributes)
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
Import an existing user given user attributes.
|
|
304
|
-
|
|
305
|
-
If the ARN comes from a Token, the User cannot have a path; if so, any attempt
|
|
306
|
-
to reference its username will fail.
|
|
307
|
-
|
|
308
|
-
###### `scope`<sup>Required</sup> <a name="scope" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserAttributes.parameter.scope"></a>
|
|
309
|
-
|
|
310
|
-
- *Type:* constructs.Construct
|
|
311
|
-
|
|
312
|
-
construct scope.
|
|
313
|
-
|
|
314
|
-
---
|
|
315
|
-
|
|
316
|
-
###### `id`<sup>Required</sup> <a name="id" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserAttributes.parameter.id"></a>
|
|
317
|
-
|
|
318
|
-
- *Type:* string
|
|
319
|
-
|
|
320
|
-
construct id.
|
|
321
|
-
|
|
322
|
-
---
|
|
323
|
-
|
|
324
|
-
###### `attrs`<sup>Required</sup> <a name="attrs" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserAttributes.parameter.attrs"></a>
|
|
325
|
-
|
|
326
|
-
- *Type:* aws-cdk-lib.aws_iam.UserAttributes
|
|
327
|
-
|
|
328
|
-
the attributes of the user to import.
|
|
329
|
-
|
|
330
|
-
---
|
|
331
|
-
|
|
332
|
-
##### `fromUserName` <a name="fromUserName" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserName"></a>
|
|
333
|
-
|
|
334
|
-
```typescript
|
|
335
|
-
import { IamUserWithAccessKey } from '@pcg-x-aws/cdk-iamuserwithaccesskey'
|
|
336
|
-
|
|
337
|
-
IamUserWithAccessKey.fromUserName(scope: Construct, id: string, userName: string)
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
Import an existing user given a username.
|
|
341
|
-
|
|
342
|
-
###### `scope`<sup>Required</sup> <a name="scope" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserName.parameter.scope"></a>
|
|
343
|
-
|
|
344
|
-
- *Type:* constructs.Construct
|
|
345
|
-
|
|
346
|
-
construct scope.
|
|
347
|
-
|
|
348
|
-
---
|
|
349
|
-
|
|
350
|
-
###### `id`<sup>Required</sup> <a name="id" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserName.parameter.id"></a>
|
|
351
|
-
|
|
352
|
-
- *Type:* string
|
|
353
|
-
|
|
354
|
-
construct id.
|
|
355
|
-
|
|
356
|
-
---
|
|
357
|
-
|
|
358
|
-
###### `userName`<sup>Required</sup> <a name="userName" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.fromUserName.parameter.userName"></a>
|
|
359
|
-
|
|
360
|
-
- *Type:* string
|
|
361
|
-
|
|
362
|
-
the username of the existing user to import.
|
|
363
|
-
|
|
364
|
-
---
|
|
365
|
-
|
|
366
123
|
#### Properties <a name="Properties" id="Properties"></a>
|
|
367
124
|
|
|
368
125
|
| **Name** | **Type** | **Description** |
|
|
369
126
|
| --- | --- | --- |
|
|
370
127
|
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
371
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.env">env</a></code> | <code>aws-cdk-lib.interfaces.ResourceEnvironment</code> | The environment this resource belongs to. |
|
|
372
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.stack">stack</a></code> | <code>aws-cdk-lib.Stack</code> | The stack in which this resource is defined. |
|
|
373
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.assumeRoleAction">assumeRoleAction</a></code> | <code>string</code> | When this Principal is used in an AssumeRole policy, the action to use. |
|
|
374
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | The principal to grant permissions to. |
|
|
375
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.policyFragment">policyFragment</a></code> | <code>aws-cdk-lib.aws_iam.PrincipalPolicyFragment</code> | Return the policy fragment that identifies this principal in a Policy. |
|
|
376
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.userArn">userArn</a></code> | <code>string</code> | An attribute that represents the user's ARN. |
|
|
377
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.userName">userName</a></code> | <code>string</code> | An attribute that represents the user name. |
|
|
378
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.userRef">userRef</a></code> | <code>aws-cdk-lib.interfaces.aws_iam.UserReference</code> | A reference to a User resource. |
|
|
379
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.permissionsBoundary">permissionsBoundary</a></code> | <code>aws-cdk-lib.aws_iam.IManagedPolicy</code> | Returns the permissions boundary attached to this user. |
|
|
380
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.principalAccount">principalAccount</a></code> | <code>string</code> | The AWS account ID of this principal. |
|
|
381
128
|
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.accessKey">accessKey</a></code> | <code>aws-cdk-lib.aws_iam.CfnAccessKey</code> | An attribute that represents the iam access_key. |
|
|
382
129
|
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.secret">secret</a></code> | <code>aws-cdk-lib.aws_secretsmanager.Secret</code> | An attribute that represents the secret. |
|
|
383
130
|
|
|
@@ -395,139 +142,6 @@ The tree node.
|
|
|
395
142
|
|
|
396
143
|
---
|
|
397
144
|
|
|
398
|
-
##### `env`<sup>Required</sup> <a name="env" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.env"></a>
|
|
399
|
-
|
|
400
|
-
```typescript
|
|
401
|
-
public readonly env: ResourceEnvironment;
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
- *Type:* aws-cdk-lib.interfaces.ResourceEnvironment
|
|
405
|
-
|
|
406
|
-
The environment this resource belongs to.
|
|
407
|
-
|
|
408
|
-
For resources that are created and managed in a Stack (those created by
|
|
409
|
-
creating new class instances like `new Role()`, `new Bucket()`, etc.), this
|
|
410
|
-
is always the same as the environment of the stack they belong to.
|
|
411
|
-
|
|
412
|
-
For referenced resources (those obtained from referencing methods like
|
|
413
|
-
`Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
|
|
414
|
-
different than the stack they were imported into.
|
|
415
|
-
|
|
416
|
-
---
|
|
417
|
-
|
|
418
|
-
##### `stack`<sup>Required</sup> <a name="stack" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.stack"></a>
|
|
419
|
-
|
|
420
|
-
```typescript
|
|
421
|
-
public readonly stack: Stack;
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
- *Type:* aws-cdk-lib.Stack
|
|
425
|
-
|
|
426
|
-
The stack in which this resource is defined.
|
|
427
|
-
|
|
428
|
-
---
|
|
429
|
-
|
|
430
|
-
##### `assumeRoleAction`<sup>Required</sup> <a name="assumeRoleAction" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.assumeRoleAction"></a>
|
|
431
|
-
|
|
432
|
-
```typescript
|
|
433
|
-
public readonly assumeRoleAction: string;
|
|
434
|
-
```
|
|
435
|
-
|
|
436
|
-
- *Type:* string
|
|
437
|
-
|
|
438
|
-
When this Principal is used in an AssumeRole policy, the action to use.
|
|
439
|
-
|
|
440
|
-
---
|
|
441
|
-
|
|
442
|
-
##### `grantPrincipal`<sup>Required</sup> <a name="grantPrincipal" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.grantPrincipal"></a>
|
|
443
|
-
|
|
444
|
-
```typescript
|
|
445
|
-
public readonly grantPrincipal: IPrincipal;
|
|
446
|
-
```
|
|
447
|
-
|
|
448
|
-
- *Type:* aws-cdk-lib.aws_iam.IPrincipal
|
|
449
|
-
|
|
450
|
-
The principal to grant permissions to.
|
|
451
|
-
|
|
452
|
-
---
|
|
453
|
-
|
|
454
|
-
##### `policyFragment`<sup>Required</sup> <a name="policyFragment" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.policyFragment"></a>
|
|
455
|
-
|
|
456
|
-
```typescript
|
|
457
|
-
public readonly policyFragment: PrincipalPolicyFragment;
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
- *Type:* aws-cdk-lib.aws_iam.PrincipalPolicyFragment
|
|
461
|
-
|
|
462
|
-
Return the policy fragment that identifies this principal in a Policy.
|
|
463
|
-
|
|
464
|
-
---
|
|
465
|
-
|
|
466
|
-
##### `userArn`<sup>Required</sup> <a name="userArn" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.userArn"></a>
|
|
467
|
-
|
|
468
|
-
```typescript
|
|
469
|
-
public readonly userArn: string;
|
|
470
|
-
```
|
|
471
|
-
|
|
472
|
-
- *Type:* string
|
|
473
|
-
|
|
474
|
-
An attribute that represents the user's ARN.
|
|
475
|
-
|
|
476
|
-
---
|
|
477
|
-
|
|
478
|
-
##### `userName`<sup>Required</sup> <a name="userName" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.userName"></a>
|
|
479
|
-
|
|
480
|
-
```typescript
|
|
481
|
-
public readonly userName: string;
|
|
482
|
-
```
|
|
483
|
-
|
|
484
|
-
- *Type:* string
|
|
485
|
-
|
|
486
|
-
An attribute that represents the user name.
|
|
487
|
-
|
|
488
|
-
---
|
|
489
|
-
|
|
490
|
-
##### `userRef`<sup>Required</sup> <a name="userRef" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.userRef"></a>
|
|
491
|
-
|
|
492
|
-
```typescript
|
|
493
|
-
public readonly userRef: UserReference;
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
- *Type:* aws-cdk-lib.interfaces.aws_iam.UserReference
|
|
497
|
-
|
|
498
|
-
A reference to a User resource.
|
|
499
|
-
|
|
500
|
-
---
|
|
501
|
-
|
|
502
|
-
##### `permissionsBoundary`<sup>Optional</sup> <a name="permissionsBoundary" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.permissionsBoundary"></a>
|
|
503
|
-
|
|
504
|
-
```typescript
|
|
505
|
-
public readonly permissionsBoundary: IManagedPolicy;
|
|
506
|
-
```
|
|
507
|
-
|
|
508
|
-
- *Type:* aws-cdk-lib.aws_iam.IManagedPolicy
|
|
509
|
-
|
|
510
|
-
Returns the permissions boundary attached to this user.
|
|
511
|
-
|
|
512
|
-
---
|
|
513
|
-
|
|
514
|
-
##### `principalAccount`<sup>Optional</sup> <a name="principalAccount" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.principalAccount"></a>
|
|
515
|
-
|
|
516
|
-
```typescript
|
|
517
|
-
public readonly principalAccount: string;
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
- *Type:* string
|
|
521
|
-
|
|
522
|
-
The AWS account ID of this principal.
|
|
523
|
-
|
|
524
|
-
Can be undefined when the account is not known
|
|
525
|
-
(for example, for service principals).
|
|
526
|
-
Can be a Token - in that case,
|
|
527
|
-
it's assumed to be AWS::AccountId.
|
|
528
|
-
|
|
529
|
-
---
|
|
530
|
-
|
|
531
145
|
##### `accessKey`<sup>Required</sup> <a name="accessKey" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.accessKey"></a>
|
|
532
146
|
|
|
533
147
|
```typescript
|
|
@@ -552,25 +166,6 @@ An attribute that represents the secret.
|
|
|
552
166
|
|
|
553
167
|
---
|
|
554
168
|
|
|
555
|
-
#### Constants <a name="Constants" id="Constants"></a>
|
|
556
|
-
|
|
557
|
-
| **Name** | **Type** | **Description** |
|
|
558
|
-
| --- | --- | --- |
|
|
559
|
-
| <code><a href="#@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.PROPERTY_INJECTION_ID">PROPERTY_INJECTION_ID</a></code> | <code>string</code> | Uniquely identifies this class. |
|
|
560
|
-
|
|
561
|
-
---
|
|
562
|
-
|
|
563
|
-
##### `PROPERTY_INJECTION_ID`<sup>Required</sup> <a name="PROPERTY_INJECTION_ID" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.PROPERTY_INJECTION_ID"></a>
|
|
564
|
-
|
|
565
|
-
```typescript
|
|
566
|
-
public readonly PROPERTY_INJECTION_ID: string;
|
|
567
|
-
```
|
|
568
|
-
|
|
569
|
-
- *Type:* string
|
|
570
|
-
|
|
571
|
-
Uniquely identifies this class.
|
|
572
|
-
|
|
573
|
-
---
|
|
574
169
|
|
|
575
170
|
## Structs <a name="Structs" id="Structs"></a>
|
|
576
171
|
|
package/lib/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface IamUserWithAccessKeyProps extends iam.UserProps {
|
|
|
16
16
|
/**
|
|
17
17
|
* An IAM User including an Access Key that will be stored in Secrets Manager. The properties as for normal IAM Users.
|
|
18
18
|
*/
|
|
19
|
-
export declare class IamUserWithAccessKey extends
|
|
19
|
+
export declare class IamUserWithAccessKey extends Construct {
|
|
20
20
|
/**
|
|
21
21
|
* An attribute that represents the iam access_key.
|
|
22
22
|
*
|
package/lib/index.js
CHANGED
|
@@ -6,26 +6,28 @@ const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
|
|
6
6
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
7
7
|
const iam = require("aws-cdk-lib/aws-iam");
|
|
8
8
|
const sm = require("aws-cdk-lib/aws-secretsmanager");
|
|
9
|
+
const constructs_1 = require("constructs");
|
|
9
10
|
/**
|
|
10
11
|
* An IAM User including an Access Key that will be stored in Secrets Manager. The properties as for normal IAM Users.
|
|
11
12
|
*/
|
|
12
|
-
class IamUserWithAccessKey extends
|
|
13
|
+
class IamUserWithAccessKey extends constructs_1.Construct {
|
|
13
14
|
constructor(scope, id, props) {
|
|
14
|
-
super(scope, id
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
super(scope, id);
|
|
16
|
+
const user = new iam.User(this, 'Resource', props);
|
|
17
|
+
this.accessKey = new iam.CfnAccessKey(this, 'AccessKey', {
|
|
18
|
+
userName: user.userName,
|
|
17
19
|
});
|
|
18
20
|
let UserSecretString = JSON.stringify({
|
|
19
21
|
Access_Key_Id: this.accessKey.ref,
|
|
20
22
|
Secret_Access_Key: aws_cdk_lib_1.Fn.getAtt(this.accessKey.logicalId, 'SecretAccessKey').toString(), //TODO: Check if this references the correct resource. AccessKey vs SecretAccessKey
|
|
21
23
|
});
|
|
22
24
|
if (props?.encryptionKey) {
|
|
23
|
-
this.secret = new sm.Secret(this,
|
|
25
|
+
this.secret = new sm.Secret(this, 'UserSecret', {
|
|
24
26
|
encryptionKey: props.encryptionKey,
|
|
25
27
|
});
|
|
26
28
|
}
|
|
27
29
|
else {
|
|
28
|
-
this.secret = new sm.Secret(this,
|
|
30
|
+
this.secret = new sm.Secret(this, 'UserSecret');
|
|
29
31
|
}
|
|
30
32
|
;
|
|
31
33
|
// We need to access the underlying cfn resource to set the secret string
|
|
@@ -35,11 +37,12 @@ class IamUserWithAccessKey extends iam.User {
|
|
|
35
37
|
cfnSecret.addOverride('Properties.GenerateSecretString', aws_cdk_lib_1.Fn.ref('AWS::NoValue'));
|
|
36
38
|
new aws_cdk_lib_1.CfnOutput(this, 'SecretArn', {
|
|
37
39
|
value: this.secret.secretArn.toString(),
|
|
38
|
-
|
|
40
|
+
// Construct id alone collides across stacks; uniqueId is stable per construct path.
|
|
41
|
+
exportName: aws_cdk_lib_1.Names.uniqueId(this),
|
|
39
42
|
});
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
exports.IamUserWithAccessKey = IamUserWithAccessKey;
|
|
43
46
|
_a = JSII_RTTI_SYMBOL_1;
|
|
44
|
-
IamUserWithAccessKey[_a] = { fqn: "@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey", version: "
|
|
45
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
47
|
+
IamUserWithAccessKey[_a] = { fqn: "@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey", version: "2.0.0-alpha.1" };
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJz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