VaporShell.SecretsManager.Classes.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
using namespace System
using namespace System.Collections
using namespace System.Collections.Generic
using namespace System.IO
using namespace System.Management.Automation
[CmdletBinding()]
Param()

Write-Verbose "Importing class 'SecretsManagerRotationScheduleRotationRules'"

class SecretsManagerRotationScheduleRotationRules : VSResourceProperty {
    hidden [string] $_vsFunctionName = 'Add-VSSecretsManagerRotationScheduleRotationRules'
    hidden [string] $_awsDocumentation = 'http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-rotationrules.html'

    hidden [object] $_automaticallyAfterDays

    [int] $AutomaticallyAfterDays

    hidden [void] _addAccessors() {
        $this | Add-Member -Force -MemberType ScriptProperty -Name AutomaticallyAfterDays -Value {
            $this._automaticallyAfterDays
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._automaticallyAfterDays = if ($cast = $value -as [int]) {
                $cast
            }
            else {
                $value
            }
        }
    }

    SecretsManagerRotationScheduleRotationRules() : base() {}
    SecretsManagerRotationScheduleRotationRules([IDictionary] $props) : base($props) {}
    SecretsManagerRotationScheduleRotationRules([psobject] $props) : base($props) {}
}

Write-Verbose "Importing class 'SecretsManagerRotationScheduleHostedRotationLambda'"

class SecretsManagerRotationScheduleHostedRotationLambda : VSResourceProperty {
    hidden [string] $_vsFunctionName = 'Add-VSSecretsManagerRotationScheduleHostedRotationLambda'
    hidden [string] $_awsDocumentation = 'http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-hostedrotationlambda.html'

    hidden [object] $_rotationType
    hidden [object] $_rotationLambdaName
    hidden [object] $_kmsKeyArn
    hidden [object] $_masterSecretArn
    hidden [object] $_vpcSecurityGroupIds
    hidden [object] $_masterSecretKmsKeyArn
    hidden [object] $_vpcSubnetIds

    [string] $RotationType
    [string] $RotationLambdaName
    [string] $KmsKeyArn
    [string] $MasterSecretArn
    [string] $VpcSecurityGroupIds
    [string] $MasterSecretKmsKeyArn
    [string] $VpcSubnetIds

    hidden [void] _addAccessors() {
        $this | Add-Member -Force -MemberType ScriptProperty -Name RotationType -Value {
            $this._rotationType
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._rotationType = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name RotationLambdaName -Value {
            $this._rotationLambdaName
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._rotationLambdaName = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name KmsKeyArn -Value {
            $this._kmsKeyArn
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._kmsKeyArn = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name MasterSecretArn -Value {
            $this._masterSecretArn
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._masterSecretArn = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name VpcSecurityGroupIds -Value {
            $this._vpcSecurityGroupIds
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._vpcSecurityGroupIds = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name MasterSecretKmsKeyArn -Value {
            $this._masterSecretKmsKeyArn
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._masterSecretKmsKeyArn = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name VpcSubnetIds -Value {
            $this._vpcSubnetIds
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._vpcSubnetIds = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
    }

    SecretsManagerRotationScheduleHostedRotationLambda() : base() {}
    SecretsManagerRotationScheduleHostedRotationLambda([IDictionary] $props) : base($props) {}
    SecretsManagerRotationScheduleHostedRotationLambda([psobject] $props) : base($props) {}
}

Write-Verbose "Importing class 'SecretsManagerSecretGenerateSecretString'"

class SecretsManagerSecretGenerateSecretString : VSResourceProperty {
    hidden [string] $_vsFunctionName = 'Add-VSSecretsManagerSecretGenerateSecretString'
    hidden [string] $_awsDocumentation = 'http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-secret-generatesecretstring.html'

    hidden [object] $_excludeUppercase
    hidden [object] $_requireEachIncludedType
    hidden [object] $_includeSpace
    hidden [object] $_excludeCharacters
    hidden [object] $_generateStringKey
    hidden [object] $_passwordLength
    hidden [object] $_excludePunctuation
    hidden [object] $_excludeLowercase
    hidden [object] $_secretStringTemplate
    hidden [object] $_excludeNumbers

    [bool] $ExcludeUppercase
    [bool] $RequireEachIncludedType
    [bool] $IncludeSpace
    [string] $ExcludeCharacters
    [string] $GenerateStringKey
    [int] $PasswordLength
    [bool] $ExcludePunctuation
    [bool] $ExcludeLowercase
    [string] $SecretStringTemplate
    [bool] $ExcludeNumbers

    hidden [void] _addAccessors() {
        $this | Add-Member -Force -MemberType ScriptProperty -Name ExcludeUppercase -Value {
            $this._excludeUppercase
        } -SecondValue {
            param([ValidateType(([bool], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._excludeUppercase = $value
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name RequireEachIncludedType -Value {
            $this._requireEachIncludedType
        } -SecondValue {
            param([ValidateType(([bool], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._requireEachIncludedType = $value
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name IncludeSpace -Value {
            $this._includeSpace
        } -SecondValue {
            param([ValidateType(([bool], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._includeSpace = $value
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name ExcludeCharacters -Value {
            $this._excludeCharacters
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._excludeCharacters = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name GenerateStringKey -Value {
            $this._generateStringKey
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._generateStringKey = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name PasswordLength -Value {
            $this._passwordLength
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._passwordLength = if ($cast = $value -as [int]) {
                $cast
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name ExcludePunctuation -Value {
            $this._excludePunctuation
        } -SecondValue {
            param([ValidateType(([bool], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._excludePunctuation = $value
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name ExcludeLowercase -Value {
            $this._excludeLowercase
        } -SecondValue {
            param([ValidateType(([bool], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._excludeLowercase = $value
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name SecretStringTemplate -Value {
            $this._secretStringTemplate
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._secretStringTemplate = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name ExcludeNumbers -Value {
            $this._excludeNumbers
        } -SecondValue {
            param([ValidateType(([bool], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this._excludeNumbers = $value
        }
    }

    SecretsManagerSecretGenerateSecretString() : base() {}
    SecretsManagerSecretGenerateSecretString([IDictionary] $props) : base($props) {}
    SecretsManagerSecretGenerateSecretString([psobject] $props) : base($props) {}
}

Write-Verbose "Importing class 'SecretsManagerRotationSchedule'"

class SecretsManagerRotationSchedule : VSResource {
    hidden [string] $_vsFunctionName = 'New-VSSecretsManagerRotationSchedule'
    hidden [string] $_awsDocumentation = 'http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-secretsmanager-rotationschedule.html'

    hidden [object] $_condition

    [string] $Type = 'AWS::SecretsManager::RotationSchedule'
    [string] $SecretId
    [SecretsManagerRotationScheduleHostedRotationLambda] $HostedRotationLambda
    [string] $RotationLambdaARN
    [SecretsManagerRotationScheduleRotationRules] $RotationRules
    [VSJson] $Metadata
    [UpdatePolicy] $UpdatePolicy
    [string] $Condition

    hidden [void] _addAccessors() {
        $this._addBaseAccessors()
        $this | Add-Member -Force -MemberType ScriptProperty -Name SecretId -Value {
            $this.Properties['SecretId']
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this.Properties['SecretId'] = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name HostedRotationLambda -Value {
            $this.Properties['HostedRotationLambda']
        } -SecondValue {
            param([ValidateType(([SecretsManagerRotationScheduleHostedRotationLambda], [string], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this.Properties['HostedRotationLambda'] = $value
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name RotationLambdaARN -Value {
            $this.Properties['RotationLambdaARN']
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this.Properties['RotationLambdaARN'] = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name RotationRules -Value {
            $this.Properties['RotationRules']
        } -SecondValue {
            param([ValidateType(([SecretsManagerRotationScheduleRotationRules], [string], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this.Properties['RotationRules'] = $value
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name Condition -Value {
            $this._condition
        } -SecondValue {
            param(
                [ValidateType(([string], [IntrinsicFunction], [ConditionFunction]))] [object]
                $value
            )
            $this._condition = $value
        }
    }

    SecretsManagerRotationSchedule() : base() {}
    SecretsManagerRotationSchedule([IDictionary] $props) : base($props) {}
    SecretsManagerRotationSchedule([psobject] $props) : base($props) {}
}

Write-Verbose "Importing class 'SecretsManagerResourcePolicy'"

class SecretsManagerResourcePolicy : VSResource {
    hidden [string] $_vsFunctionName = 'New-VSSecretsManagerResourcePolicy'
    hidden [string] $_awsDocumentation = 'http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-secretsmanager-resourcepolicy.html'

    hidden [object] $_condition

    [string] $Type = 'AWS::SecretsManager::ResourcePolicy'
    [bool] $BlockPublicPolicy
    [string] $SecretId
    [VSJson] $ResourcePolicy
    [VSJson] $Metadata
    [UpdatePolicy] $UpdatePolicy
    [string] $Condition

    hidden [void] _addAccessors() {
        $this._addBaseAccessors()
        $this | Add-Member -Force -MemberType ScriptProperty -Name BlockPublicPolicy -Value {
            $this.Properties['BlockPublicPolicy']
        } -SecondValue {
            param([ValidateType(([bool], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this.Properties['BlockPublicPolicy'] = $value
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name SecretId -Value {
            $this.Properties['SecretId']
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this.Properties['SecretId'] = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name ResourcePolicy -Value {
            $this.Properties['ResourcePolicy']
        } -SecondValue {
            param([ValidateType(([string], [VSJson], [VSYaml], [psobject], [IDictionary]))][object] $value)
            $this.Properties['ResourcePolicy'] = [VSJson]::Transform($value)
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name Condition -Value {
            $this._condition
        } -SecondValue {
            param(
                [ValidateType(([string], [IntrinsicFunction], [ConditionFunction]))] [object]
                $value
            )
            $this._condition = $value
        }
    }

    SecretsManagerResourcePolicy() : base() {}
    SecretsManagerResourcePolicy([IDictionary] $props) : base($props) {}
    SecretsManagerResourcePolicy([psobject] $props) : base($props) {}
}

Write-Verbose "Importing class 'SecretsManagerSecret'"

class SecretsManagerSecret : VSResource {
    hidden [string] $_vsFunctionName = 'New-VSSecretsManagerSecret'
    hidden [string] $_awsDocumentation = 'http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-secretsmanager-secret.html'

    hidden [object] $_condition

    [string] $Type = 'AWS::SecretsManager::Secret'
    [string] $Description
    [string] $KmsKeyId
    [string] $SecretString
    [SecretsManagerSecretGenerateSecretString] $GenerateSecretString
    [VSTag[]] $Tags
    [string] $Name
    [VSJson] $Metadata
    [UpdatePolicy] $UpdatePolicy
    [string] $Condition

    hidden [void] _addAccessors() {
        $this._addBaseAccessors()
        $this | Add-Member -Force -MemberType ScriptProperty -Name Description -Value {
            $this.Properties['Description']
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this.Properties['Description'] = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name KmsKeyId -Value {
            $this.Properties['KmsKeyId']
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this.Properties['KmsKeyId'] = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name SecretString -Value {
            $this.Properties['SecretString']
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this.Properties['SecretString'] = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name GenerateSecretString -Value {
            $this.Properties['GenerateSecretString']
        } -SecondValue {
            param([ValidateType(([SecretsManagerSecretGenerateSecretString], [string], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this.Properties['GenerateSecretString'] = $value
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name Tags -Value {
            $this.Properties['Tags']
        } -SecondValue {
            param([TransformTag()] [ValidateType(([IDictionary], [psobject], [VSTag]))] [object] $value)
            $this.Properties['Tags'] = [VSTag]::TransformTag($value)
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name Name -Value {
            $this.Properties['Name']
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this.Properties['Name'] = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name Condition -Value {
            $this._condition
        } -SecondValue {
            param(
                [ValidateType(([string], [IntrinsicFunction], [ConditionFunction]))] [object]
                $value
            )
            $this._condition = $value
        }
    }

    SecretsManagerSecret() : base() {}
    SecretsManagerSecret([IDictionary] $props) : base($props) {}
    SecretsManagerSecret([psobject] $props) : base($props) {}
}

Write-Verbose "Importing class 'SecretsManagerSecretTargetAttachment'"

class SecretsManagerSecretTargetAttachment : VSResource {
    hidden [string] $_vsFunctionName = 'New-VSSecretsManagerSecretTargetAttachment'
    hidden [string] $_awsDocumentation = 'http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-secretsmanager-secrettargetattachment.html'

    hidden [object] $_condition

    [string] $Type = 'AWS::SecretsManager::SecretTargetAttachment'
    [string] $SecretId
    [string] $TargetType
    [string] $TargetId
    [VSJson] $Metadata
    [UpdatePolicy] $UpdatePolicy
    [string] $Condition

    hidden [void] _addAccessors() {
        $this._addBaseAccessors()
        $this | Add-Member -Force -MemberType ScriptProperty -Name SecretId -Value {
            $this.Properties['SecretId']
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this.Properties['SecretId'] = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name TargetType -Value {
            $this.Properties['TargetType']
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this.Properties['TargetType'] = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name TargetId -Value {
            $this.Properties['TargetId']
        } -SecondValue {
            param([ValidateType(([string], [int], [IntrinsicFunction], [ConditionFunction]))] [object] $value)
            $this.Properties['TargetId'] = if ($value -is [int]) {
                $value.ToString()
            }
            else {
                $value
            }
        }
        $this | Add-Member -Force -MemberType ScriptProperty -Name Condition -Value {
            $this._condition
        } -SecondValue {
            param(
                [ValidateType(([string], [IntrinsicFunction], [ConditionFunction]))] [object]
                $value
            )
            $this._condition = $value
        }
    }

    SecretsManagerSecretTargetAttachment() : base() {}
    SecretsManagerSecretTargetAttachment([IDictionary] $props) : base($props) {}
    SecretsManagerSecretTargetAttachment([psobject] $props) : base($props) {}
}