This repository has been archived by the owner on Jun 1, 2022. It is now read-only.
generated from pulumi/pulumi-component-provider-go-boilerplate
/
assumableRoles.go
223 lines (181 loc) · 8.07 KB
/
assumableRoles.go
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
// Code generated by Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package awsiam
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type AssumableRoles struct {
pulumi.ResourceState
Admin pulumi.StringMapOutput `pulumi:"admin"`
Poweruser pulumi.StringMapOutput `pulumi:"poweruser"`
Readonly pulumi.StringMapOutput `pulumi:"readonly"`
}
// NewAssumableRoles registers a new resource with the given unique name, arguments, and options.
func NewAssumableRoles(ctx *pulumi.Context,
name string, args *AssumableRolesArgs, opts ...pulumi.ResourceOption) (*AssumableRoles, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Admin == nil {
return nil, errors.New("invalid value for required argument 'Admin'")
}
args.Admin = args.Admin.ToAdminRoleWithMFAOutput().ApplyT(func(v AdminRoleWithMFA) AdminRoleWithMFA { return *v.Defaults() }).(AdminRoleWithMFAOutput)
if isZero(args.ForceDetachPolicies) {
args.ForceDetachPolicies = pulumi.BoolPtr(false)
}
if isZero(args.MaxSessionDuration) {
args.MaxSessionDuration = pulumi.IntPtr(3600)
}
if isZero(args.MfaAge) {
args.MfaAge = pulumi.IntPtr(86400)
}
if args.Poweruser != nil {
args.Poweruser = args.Poweruser.ToPoweruserRoleWithMFAPtrOutput().ApplyT(func(v *PoweruserRoleWithMFA) *PoweruserRoleWithMFA { return v.Defaults() }).(PoweruserRoleWithMFAPtrOutput)
}
if args.Readonly != nil {
args.Readonly = args.Readonly.ToReadonlyRoleWithMFAPtrOutput().ApplyT(func(v *ReadonlyRoleWithMFA) *ReadonlyRoleWithMFA { return v.Defaults() }).(ReadonlyRoleWithMFAPtrOutput)
}
var resource AssumableRoles
err := ctx.RegisterRemoteComponentResource("aws-iam:index:AssumableRoles", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
type assumableRolesArgs struct {
Admin AdminRoleWithMFA `pulumi:"admin"`
// Whether policies should be detached from this role when destroying.
ForceDetachPolicies *bool `pulumi:"forceDetachPolicies"`
// Maximum CLI/API session duration in seconds between 3600 and 43200.
MaxSessionDuration *int `pulumi:"maxSessionDuration"`
// Max age of valid MFA (in seconds) for roles which require MFA.
MfaAge *int `pulumi:"mfaAge"`
Poweruser *PoweruserRoleWithMFA `pulumi:"poweruser"`
Readonly *ReadonlyRoleWithMFA `pulumi:"readonly"`
// ARNs of AWS entities who can assume these roles.
TrustedRoleArns []string `pulumi:"trustedRoleArns"`
// AWS Services that can assume these roles.
TrustedRoleServices []string `pulumi:"trustedRoleServices"`
}
// The set of arguments for constructing a AssumableRoles resource.
type AssumableRolesArgs struct {
Admin AdminRoleWithMFAInput
// Whether policies should be detached from this role when destroying.
ForceDetachPolicies pulumi.BoolPtrInput
// Maximum CLI/API session duration in seconds between 3600 and 43200.
MaxSessionDuration pulumi.IntPtrInput
// Max age of valid MFA (in seconds) for roles which require MFA.
MfaAge pulumi.IntPtrInput
Poweruser PoweruserRoleWithMFAPtrInput
Readonly ReadonlyRoleWithMFAPtrInput
// ARNs of AWS entities who can assume these roles.
TrustedRoleArns pulumi.StringArrayInput
// AWS Services that can assume these roles.
TrustedRoleServices pulumi.StringArrayInput
}
func (AssumableRolesArgs) ElementType() reflect.Type {
return reflect.TypeOf((*assumableRolesArgs)(nil)).Elem()
}
type AssumableRolesInput interface {
pulumi.Input
ToAssumableRolesOutput() AssumableRolesOutput
ToAssumableRolesOutputWithContext(ctx context.Context) AssumableRolesOutput
}
func (*AssumableRoles) ElementType() reflect.Type {
return reflect.TypeOf((**AssumableRoles)(nil)).Elem()
}
func (i *AssumableRoles) ToAssumableRolesOutput() AssumableRolesOutput {
return i.ToAssumableRolesOutputWithContext(context.Background())
}
func (i *AssumableRoles) ToAssumableRolesOutputWithContext(ctx context.Context) AssumableRolesOutput {
return pulumi.ToOutputWithContext(ctx, i).(AssumableRolesOutput)
}
// AssumableRolesArrayInput is an input type that accepts AssumableRolesArray and AssumableRolesArrayOutput values.
// You can construct a concrete instance of `AssumableRolesArrayInput` via:
//
// AssumableRolesArray{ AssumableRolesArgs{...} }
type AssumableRolesArrayInput interface {
pulumi.Input
ToAssumableRolesArrayOutput() AssumableRolesArrayOutput
ToAssumableRolesArrayOutputWithContext(context.Context) AssumableRolesArrayOutput
}
type AssumableRolesArray []AssumableRolesInput
func (AssumableRolesArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AssumableRoles)(nil)).Elem()
}
func (i AssumableRolesArray) ToAssumableRolesArrayOutput() AssumableRolesArrayOutput {
return i.ToAssumableRolesArrayOutputWithContext(context.Background())
}
func (i AssumableRolesArray) ToAssumableRolesArrayOutputWithContext(ctx context.Context) AssumableRolesArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AssumableRolesArrayOutput)
}
// AssumableRolesMapInput is an input type that accepts AssumableRolesMap and AssumableRolesMapOutput values.
// You can construct a concrete instance of `AssumableRolesMapInput` via:
//
// AssumableRolesMap{ "key": AssumableRolesArgs{...} }
type AssumableRolesMapInput interface {
pulumi.Input
ToAssumableRolesMapOutput() AssumableRolesMapOutput
ToAssumableRolesMapOutputWithContext(context.Context) AssumableRolesMapOutput
}
type AssumableRolesMap map[string]AssumableRolesInput
func (AssumableRolesMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AssumableRoles)(nil)).Elem()
}
func (i AssumableRolesMap) ToAssumableRolesMapOutput() AssumableRolesMapOutput {
return i.ToAssumableRolesMapOutputWithContext(context.Background())
}
func (i AssumableRolesMap) ToAssumableRolesMapOutputWithContext(ctx context.Context) AssumableRolesMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AssumableRolesMapOutput)
}
type AssumableRolesOutput struct{ *pulumi.OutputState }
func (AssumableRolesOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AssumableRoles)(nil)).Elem()
}
func (o AssumableRolesOutput) ToAssumableRolesOutput() AssumableRolesOutput {
return o
}
func (o AssumableRolesOutput) ToAssumableRolesOutputWithContext(ctx context.Context) AssumableRolesOutput {
return o
}
type AssumableRolesArrayOutput struct{ *pulumi.OutputState }
func (AssumableRolesArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AssumableRoles)(nil)).Elem()
}
func (o AssumableRolesArrayOutput) ToAssumableRolesArrayOutput() AssumableRolesArrayOutput {
return o
}
func (o AssumableRolesArrayOutput) ToAssumableRolesArrayOutputWithContext(ctx context.Context) AssumableRolesArrayOutput {
return o
}
func (o AssumableRolesArrayOutput) Index(i pulumi.IntInput) AssumableRolesOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AssumableRoles {
return vs[0].([]*AssumableRoles)[vs[1].(int)]
}).(AssumableRolesOutput)
}
type AssumableRolesMapOutput struct{ *pulumi.OutputState }
func (AssumableRolesMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AssumableRoles)(nil)).Elem()
}
func (o AssumableRolesMapOutput) ToAssumableRolesMapOutput() AssumableRolesMapOutput {
return o
}
func (o AssumableRolesMapOutput) ToAssumableRolesMapOutputWithContext(ctx context.Context) AssumableRolesMapOutput {
return o
}
func (o AssumableRolesMapOutput) MapIndex(k pulumi.StringInput) AssumableRolesOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AssumableRoles {
return vs[0].(map[string]*AssumableRoles)[vs[1].(string)]
}).(AssumableRolesOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AssumableRolesInput)(nil)).Elem(), &AssumableRoles{})
pulumi.RegisterInputType(reflect.TypeOf((*AssumableRolesArrayInput)(nil)).Elem(), AssumableRolesArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AssumableRolesMapInput)(nil)).Elem(), AssumableRolesMap{})
pulumi.RegisterOutputType(AssumableRolesOutput{})
pulumi.RegisterOutputType(AssumableRolesArrayOutput{})
pulumi.RegisterOutputType(AssumableRolesMapOutput{})
}