@pcg-x-aws/cdk-iamuserwithaccesskey 2.0.0-alpha.0 → 2.0.0-alpha.10
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 +11 -11
- package/API.md +409 -4
- package/lib/index.d.ts +8 -7
- package/lib/index.js +14 -14
- package/package.json +1 -1
package/.jsii
CHANGED
|
@@ -8907,7 +8907,7 @@
|
|
|
8907
8907
|
"stability": "stable"
|
|
8908
8908
|
},
|
|
8909
8909
|
"homepage": "https://github.com/pcg-x-aws/cdk-iamuserwithaccesskey.git",
|
|
8910
|
-
"jsiiVersion": "5.9.
|
|
8910
|
+
"jsiiVersion": "5.9.39 (build cdf85b4)",
|
|
8911
8911
|
"keywords": [
|
|
8912
8912
|
"Access Key",
|
|
8913
8913
|
"IAM",
|
|
@@ -8940,11 +8940,11 @@
|
|
|
8940
8940
|
"types": {
|
|
8941
8941
|
"@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey": {
|
|
8942
8942
|
"assembly": "@pcg-x-aws/cdk-iamuserwithaccesskey",
|
|
8943
|
-
"base": "
|
|
8943
|
+
"base": "aws-cdk-lib.aws_iam.User",
|
|
8944
8944
|
"docs": {
|
|
8945
|
-
"remarks": "
|
|
8945
|
+
"remarks": "Extends {@link iam.User}; pass the same properties you would to `new iam.User(...)`.",
|
|
8946
8946
|
"stability": "stable",
|
|
8947
|
-
"summary": "An IAM
|
|
8947
|
+
"summary": "An IAM user with an access key whose material is stored in Secrets Manager."
|
|
8948
8948
|
},
|
|
8949
8949
|
"fqn": "@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey",
|
|
8950
8950
|
"initializer": {
|
|
@@ -8953,7 +8953,7 @@
|
|
|
8953
8953
|
},
|
|
8954
8954
|
"locationInModule": {
|
|
8955
8955
|
"filename": "src/index.ts",
|
|
8956
|
-
"line":
|
|
8956
|
+
"line": 37
|
|
8957
8957
|
},
|
|
8958
8958
|
"parameters": [
|
|
8959
8959
|
{
|
|
@@ -8980,7 +8980,7 @@
|
|
|
8980
8980
|
"kind": "class",
|
|
8981
8981
|
"locationInModule": {
|
|
8982
8982
|
"filename": "src/index.ts",
|
|
8983
|
-
"line":
|
|
8983
|
+
"line": 23
|
|
8984
8984
|
},
|
|
8985
8985
|
"name": "IamUserWithAccessKey",
|
|
8986
8986
|
"properties": [
|
|
@@ -8995,7 +8995,7 @@
|
|
|
8995
8995
|
"immutable": true,
|
|
8996
8996
|
"locationInModule": {
|
|
8997
8997
|
"filename": "src/index.ts",
|
|
8998
|
-
"line":
|
|
8998
|
+
"line": 29
|
|
8999
8999
|
},
|
|
9000
9000
|
"name": "accessKey",
|
|
9001
9001
|
"type": {
|
|
@@ -9013,7 +9013,7 @@
|
|
|
9013
9013
|
"immutable": true,
|
|
9014
9014
|
"locationInModule": {
|
|
9015
9015
|
"filename": "src/index.ts",
|
|
9016
|
-
"line":
|
|
9016
|
+
"line": 35
|
|
9017
9017
|
},
|
|
9018
9018
|
"name": "secret",
|
|
9019
9019
|
"type": {
|
|
@@ -9028,7 +9028,7 @@
|
|
|
9028
9028
|
"datatype": true,
|
|
9029
9029
|
"docs": {
|
|
9030
9030
|
"stability": "stable",
|
|
9031
|
-
"summary": "Properties for
|
|
9031
|
+
"summary": "Properties for {@link IamUserWithAccessKey}: all {@link iam.UserProps} plus optional secret encryption."
|
|
9032
9032
|
},
|
|
9033
9033
|
"fqn": "@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKeyProps",
|
|
9034
9034
|
"interfaces": [
|
|
@@ -9063,6 +9063,6 @@
|
|
|
9063
9063
|
"symbolId": "src/index:IamUserWithAccessKeyProps"
|
|
9064
9064
|
}
|
|
9065
9065
|
},
|
|
9066
|
-
"version": "2.0.0-alpha.
|
|
9067
|
-
"fingerprint": "
|
|
9066
|
+
"version": "2.0.0-alpha.10",
|
|
9067
|
+
"fingerprint": "djihidkqEOSTIPt7tv4PfXE6O4Bo9+BWvt+XNtiWnlw="
|
|
9068
9068
|
}
|
package/API.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
### IamUserWithAccessKey <a name="IamUserWithAccessKey" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey"></a>
|
|
6
6
|
|
|
7
|
-
An IAM
|
|
7
|
+
An IAM user with an access key whose material is stored in Secrets Manager.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Extends {@link iam.User}; pass the same properties you would to `new iam.User(...)`.
|
|
10
10
|
|
|
11
11
|
#### Initializers <a name="Initializers" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.Initializer"></a>
|
|
12
12
|
|
|
@@ -48,6 +48,12 @@ 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. |
|
|
51
57
|
|
|
52
58
|
---
|
|
53
59
|
|
|
@@ -76,7 +82,99 @@ constructs.
|
|
|
76
82
|
|
|
77
83
|
- *Type:* ...constructs.IMixin[]
|
|
78
84
|
|
|
79
|
-
|
|
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
|
|
80
178
|
|
|
81
179
|
---
|
|
82
180
|
|
|
@@ -85,6 +183,11 @@ The mixins to apply.
|
|
|
85
183
|
| **Name** | **Description** |
|
|
86
184
|
| --- | --- |
|
|
87
185
|
| <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. |
|
|
88
191
|
|
|
89
192
|
---
|
|
90
193
|
|
|
@@ -120,11 +223,161 @@ Any object.
|
|
|
120
223
|
|
|
121
224
|
---
|
|
122
225
|
|
|
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
|
+
|
|
123
366
|
#### Properties <a name="Properties" id="Properties"></a>
|
|
124
367
|
|
|
125
368
|
| **Name** | **Type** | **Description** |
|
|
126
369
|
| --- | --- | --- |
|
|
127
370
|
| <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. |
|
|
128
381
|
| <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. |
|
|
129
382
|
| <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. |
|
|
130
383
|
|
|
@@ -142,6 +395,139 @@ The tree node.
|
|
|
142
395
|
|
|
143
396
|
---
|
|
144
397
|
|
|
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
|
+
|
|
145
531
|
##### `accessKey`<sup>Required</sup> <a name="accessKey" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey.property.accessKey"></a>
|
|
146
532
|
|
|
147
533
|
```typescript
|
|
@@ -166,12 +552,31 @@ An attribute that represents the secret.
|
|
|
166
552
|
|
|
167
553
|
---
|
|
168
554
|
|
|
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
|
+
---
|
|
169
574
|
|
|
170
575
|
## Structs <a name="Structs" id="Structs"></a>
|
|
171
576
|
|
|
172
577
|
### IamUserWithAccessKeyProps <a name="IamUserWithAccessKeyProps" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKeyProps"></a>
|
|
173
578
|
|
|
174
|
-
Properties for
|
|
579
|
+
Properties for {@link IamUserWithAccessKey}: all {@link iam.UserProps} plus optional secret encryption.
|
|
175
580
|
|
|
176
581
|
#### Initializer <a name="Initializer" id="@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKeyProps.Initializer"></a>
|
|
177
582
|
|
package/lib/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as kms from 'aws-cdk-lib/aws-kms';
|
|
|
3
3
|
import * as sm from 'aws-cdk-lib/aws-secretsmanager';
|
|
4
4
|
import { Construct } from 'constructs';
|
|
5
5
|
/**
|
|
6
|
-
* Properties for
|
|
6
|
+
* Properties for {@link IamUserWithAccessKey}: all {@link iam.UserProps} plus optional secret encryption.
|
|
7
7
|
*/
|
|
8
8
|
export interface IamUserWithAccessKeyProps extends iam.UserProps {
|
|
9
9
|
/**
|
|
@@ -14,9 +14,10 @@ export interface IamUserWithAccessKeyProps extends iam.UserProps {
|
|
|
14
14
|
readonly encryptionKey?: kms.IKey | undefined;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* An IAM
|
|
17
|
+
* An IAM user with an access key whose material is stored in Secrets Manager.
|
|
18
|
+
* Extends {@link iam.User}; pass the same properties you would to `new iam.User(...)`.
|
|
18
19
|
*/
|
|
19
|
-
export declare class IamUserWithAccessKey extends
|
|
20
|
+
export declare class IamUserWithAccessKey extends iam.User {
|
|
20
21
|
/**
|
|
21
22
|
* An attribute that represents the iam access_key.
|
|
22
23
|
*
|
|
@@ -24,10 +25,10 @@ export declare class IamUserWithAccessKey extends Construct {
|
|
|
24
25
|
*/
|
|
25
26
|
readonly accessKey: iam.CfnAccessKey;
|
|
26
27
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
* An attribute that represents the secret.
|
|
29
|
+
*
|
|
30
|
+
* @attribute true
|
|
31
|
+
*/
|
|
31
32
|
readonly secret: sm.Secret;
|
|
32
33
|
constructor(scope: Construct, id: string, props?: IamUserWithAccessKeyProps);
|
|
33
34
|
}
|
package/lib/index.js
CHANGED
|
@@ -6,42 +6,42 @@ 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");
|
|
10
9
|
/**
|
|
11
|
-
* An IAM
|
|
10
|
+
* An IAM user with an access key whose material is stored in Secrets Manager.
|
|
11
|
+
* Extends {@link iam.User}; pass the same properties you would to `new iam.User(...)`.
|
|
12
12
|
*/
|
|
13
|
-
class IamUserWithAccessKey extends
|
|
13
|
+
class IamUserWithAccessKey extends iam.User {
|
|
14
14
|
constructor(scope, id, props) {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const { encryptionKey, ...userProps } = props ?? {};
|
|
16
|
+
super(scope, id, userProps);
|
|
17
17
|
this.accessKey = new iam.CfnAccessKey(this, 'AccessKey', {
|
|
18
|
-
userName:
|
|
18
|
+
userName: this.userName,
|
|
19
19
|
});
|
|
20
|
-
|
|
20
|
+
const userSecretString = JSON.stringify({
|
|
21
21
|
Access_Key_Id: this.accessKey.ref,
|
|
22
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
|
|
23
23
|
});
|
|
24
|
-
if (
|
|
24
|
+
if (encryptionKey) {
|
|
25
25
|
this.secret = new sm.Secret(this, 'UserSecret', {
|
|
26
|
-
encryptionKey
|
|
26
|
+
encryptionKey,
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
30
|
this.secret = new sm.Secret(this, 'UserSecret');
|
|
31
31
|
}
|
|
32
|
-
;
|
|
33
32
|
// We need to access the underlying cfn resource to set the secret string
|
|
34
33
|
const cfnSecret = this.secret.node.defaultChild;
|
|
35
|
-
cfnSecret.secretString =
|
|
34
|
+
cfnSecret.secretString = userSecretString;
|
|
36
35
|
// We need a raw override because otherwise cdk always expects a secretStringGenerator object
|
|
37
36
|
cfnSecret.addOverride('Properties.GenerateSecretString', aws_cdk_lib_1.Fn.ref('AWS::NoValue'));
|
|
38
37
|
new aws_cdk_lib_1.CfnOutput(this, 'SecretArn', {
|
|
39
38
|
value: this.secret.secretArn.toString(),
|
|
40
|
-
|
|
39
|
+
// Construct id alone collides across stacks; uniqueId is stable per construct path.
|
|
40
|
+
exportName: aws_cdk_lib_1.Names.uniqueId(this),
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
exports.IamUserWithAccessKey = IamUserWithAccessKey;
|
|
45
45
|
_a = JSII_RTTI_SYMBOL_1;
|
|
46
|
-
IamUserWithAccessKey[_a] = { fqn: "@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey", version: "2.0.0-alpha.
|
|
47
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
46
|
+
IamUserWithAccessKey[_a] = { fqn: "@pcg-x-aws/cdk-iamuserwithaccesskey.IamUserWithAccessKey", version: "2.0.0-alpha.10" };
|
|
47
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSw2Q0FBbUQ7QUFDbkQsMkNBQTJDO0FBRTNDLHFEQUFxRDtBQWVyRDs7O0dBR0c7QUFDSCxNQUFhLG9CQUFxQixTQUFRLEdBQUcsQ0FBQyxJQUFJO0lBY2hELFlBQVksS0FBZ0IsRUFBRSxFQUFVLEVBQUUsS0FBaUM7UUFDekUsTUFBTSxFQUFFLGFBQWEsRUFBRSxHQUFHLFNBQVMsRUFBRSxH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