/
userStackAssociation.go
329 lines (279 loc) · 12.3 KB
/
userStackAssociation.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
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
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package appstream
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an AppStream User Stack association.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/appstream"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// testStack, err := appstream.NewStack(ctx, "testStack", nil)
// if err != nil {
// return err
// }
// testUser, err := appstream.NewUser(ctx, "testUser", &appstream.UserArgs{
// AuthenticationType: pulumi.String("USERPOOL"),
// UserName: pulumi.String("EMAIL"),
// })
// if err != nil {
// return err
// }
// _, err = appstream.NewUserStackAssociation(ctx, "testUserStackAssociation", &appstream.UserStackAssociationArgs{
// AuthenticationType: testUser.AuthenticationType,
// StackName: testStack.Name,
// UserName: testUser.UserName,
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// AppStream User Stack Association can be imported by using the `user_name`, `authentication_type`, and `stack_name`, separated by a slash (`/`), e.g.,
//
// ```sh
//
// $ pulumi import aws:appstream/userStackAssociation:UserStackAssociation example userName/auhtenticationType/stackName
//
// ```
type UserStackAssociation struct {
pulumi.CustomResourceState
// Authentication type for the user.
AuthenticationType pulumi.StringOutput `pulumi:"authenticationType"`
// Whether a welcome email is sent to a user after the user is created in the user pool.
SendEmailNotification pulumi.BoolPtrOutput `pulumi:"sendEmailNotification"`
// Name of the stack that is associated with the user.
StackName pulumi.StringOutput `pulumi:"stackName"`
// Email address of the user who is associated with the stack.
//
// The following arguments are optional:
UserName pulumi.StringOutput `pulumi:"userName"`
}
// NewUserStackAssociation registers a new resource with the given unique name, arguments, and options.
func NewUserStackAssociation(ctx *pulumi.Context,
name string, args *UserStackAssociationArgs, opts ...pulumi.ResourceOption) (*UserStackAssociation, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AuthenticationType == nil {
return nil, errors.New("invalid value for required argument 'AuthenticationType'")
}
if args.StackName == nil {
return nil, errors.New("invalid value for required argument 'StackName'")
}
if args.UserName == nil {
return nil, errors.New("invalid value for required argument 'UserName'")
}
var resource UserStackAssociation
err := ctx.RegisterResource("aws:appstream/userStackAssociation:UserStackAssociation", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetUserStackAssociation gets an existing UserStackAssociation resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetUserStackAssociation(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *UserStackAssociationState, opts ...pulumi.ResourceOption) (*UserStackAssociation, error) {
var resource UserStackAssociation
err := ctx.ReadResource("aws:appstream/userStackAssociation:UserStackAssociation", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering UserStackAssociation resources.
type userStackAssociationState struct {
// Authentication type for the user.
AuthenticationType *string `pulumi:"authenticationType"`
// Whether a welcome email is sent to a user after the user is created in the user pool.
SendEmailNotification *bool `pulumi:"sendEmailNotification"`
// Name of the stack that is associated with the user.
StackName *string `pulumi:"stackName"`
// Email address of the user who is associated with the stack.
//
// The following arguments are optional:
UserName *string `pulumi:"userName"`
}
type UserStackAssociationState struct {
// Authentication type for the user.
AuthenticationType pulumi.StringPtrInput
// Whether a welcome email is sent to a user after the user is created in the user pool.
SendEmailNotification pulumi.BoolPtrInput
// Name of the stack that is associated with the user.
StackName pulumi.StringPtrInput
// Email address of the user who is associated with the stack.
//
// The following arguments are optional:
UserName pulumi.StringPtrInput
}
func (UserStackAssociationState) ElementType() reflect.Type {
return reflect.TypeOf((*userStackAssociationState)(nil)).Elem()
}
type userStackAssociationArgs struct {
// Authentication type for the user.
AuthenticationType string `pulumi:"authenticationType"`
// Whether a welcome email is sent to a user after the user is created in the user pool.
SendEmailNotification *bool `pulumi:"sendEmailNotification"`
// Name of the stack that is associated with the user.
StackName string `pulumi:"stackName"`
// Email address of the user who is associated with the stack.
//
// The following arguments are optional:
UserName string `pulumi:"userName"`
}
// The set of arguments for constructing a UserStackAssociation resource.
type UserStackAssociationArgs struct {
// Authentication type for the user.
AuthenticationType pulumi.StringInput
// Whether a welcome email is sent to a user after the user is created in the user pool.
SendEmailNotification pulumi.BoolPtrInput
// Name of the stack that is associated with the user.
StackName pulumi.StringInput
// Email address of the user who is associated with the stack.
//
// The following arguments are optional:
UserName pulumi.StringInput
}
func (UserStackAssociationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*userStackAssociationArgs)(nil)).Elem()
}
type UserStackAssociationInput interface {
pulumi.Input
ToUserStackAssociationOutput() UserStackAssociationOutput
ToUserStackAssociationOutputWithContext(ctx context.Context) UserStackAssociationOutput
}
func (*UserStackAssociation) ElementType() reflect.Type {
return reflect.TypeOf((**UserStackAssociation)(nil)).Elem()
}
func (i *UserStackAssociation) ToUserStackAssociationOutput() UserStackAssociationOutput {
return i.ToUserStackAssociationOutputWithContext(context.Background())
}
func (i *UserStackAssociation) ToUserStackAssociationOutputWithContext(ctx context.Context) UserStackAssociationOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserStackAssociationOutput)
}
// UserStackAssociationArrayInput is an input type that accepts UserStackAssociationArray and UserStackAssociationArrayOutput values.
// You can construct a concrete instance of `UserStackAssociationArrayInput` via:
//
// UserStackAssociationArray{ UserStackAssociationArgs{...} }
type UserStackAssociationArrayInput interface {
pulumi.Input
ToUserStackAssociationArrayOutput() UserStackAssociationArrayOutput
ToUserStackAssociationArrayOutputWithContext(context.Context) UserStackAssociationArrayOutput
}
type UserStackAssociationArray []UserStackAssociationInput
func (UserStackAssociationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*UserStackAssociation)(nil)).Elem()
}
func (i UserStackAssociationArray) ToUserStackAssociationArrayOutput() UserStackAssociationArrayOutput {
return i.ToUserStackAssociationArrayOutputWithContext(context.Background())
}
func (i UserStackAssociationArray) ToUserStackAssociationArrayOutputWithContext(ctx context.Context) UserStackAssociationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserStackAssociationArrayOutput)
}
// UserStackAssociationMapInput is an input type that accepts UserStackAssociationMap and UserStackAssociationMapOutput values.
// You can construct a concrete instance of `UserStackAssociationMapInput` via:
//
// UserStackAssociationMap{ "key": UserStackAssociationArgs{...} }
type UserStackAssociationMapInput interface {
pulumi.Input
ToUserStackAssociationMapOutput() UserStackAssociationMapOutput
ToUserStackAssociationMapOutputWithContext(context.Context) UserStackAssociationMapOutput
}
type UserStackAssociationMap map[string]UserStackAssociationInput
func (UserStackAssociationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*UserStackAssociation)(nil)).Elem()
}
func (i UserStackAssociationMap) ToUserStackAssociationMapOutput() UserStackAssociationMapOutput {
return i.ToUserStackAssociationMapOutputWithContext(context.Background())
}
func (i UserStackAssociationMap) ToUserStackAssociationMapOutputWithContext(ctx context.Context) UserStackAssociationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserStackAssociationMapOutput)
}
type UserStackAssociationOutput struct{ *pulumi.OutputState }
func (UserStackAssociationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**UserStackAssociation)(nil)).Elem()
}
func (o UserStackAssociationOutput) ToUserStackAssociationOutput() UserStackAssociationOutput {
return o
}
func (o UserStackAssociationOutput) ToUserStackAssociationOutputWithContext(ctx context.Context) UserStackAssociationOutput {
return o
}
// Authentication type for the user.
func (o UserStackAssociationOutput) AuthenticationType() pulumi.StringOutput {
return o.ApplyT(func(v *UserStackAssociation) pulumi.StringOutput { return v.AuthenticationType }).(pulumi.StringOutput)
}
// Whether a welcome email is sent to a user after the user is created in the user pool.
func (o UserStackAssociationOutput) SendEmailNotification() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *UserStackAssociation) pulumi.BoolPtrOutput { return v.SendEmailNotification }).(pulumi.BoolPtrOutput)
}
// Name of the stack that is associated with the user.
func (o UserStackAssociationOutput) StackName() pulumi.StringOutput {
return o.ApplyT(func(v *UserStackAssociation) pulumi.StringOutput { return v.StackName }).(pulumi.StringOutput)
}
// Email address of the user who is associated with the stack.
//
// The following arguments are optional:
func (o UserStackAssociationOutput) UserName() pulumi.StringOutput {
return o.ApplyT(func(v *UserStackAssociation) pulumi.StringOutput { return v.UserName }).(pulumi.StringOutput)
}
type UserStackAssociationArrayOutput struct{ *pulumi.OutputState }
func (UserStackAssociationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*UserStackAssociation)(nil)).Elem()
}
func (o UserStackAssociationArrayOutput) ToUserStackAssociationArrayOutput() UserStackAssociationArrayOutput {
return o
}
func (o UserStackAssociationArrayOutput) ToUserStackAssociationArrayOutputWithContext(ctx context.Context) UserStackAssociationArrayOutput {
return o
}
func (o UserStackAssociationArrayOutput) Index(i pulumi.IntInput) UserStackAssociationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *UserStackAssociation {
return vs[0].([]*UserStackAssociation)[vs[1].(int)]
}).(UserStackAssociationOutput)
}
type UserStackAssociationMapOutput struct{ *pulumi.OutputState }
func (UserStackAssociationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*UserStackAssociation)(nil)).Elem()
}
func (o UserStackAssociationMapOutput) ToUserStackAssociationMapOutput() UserStackAssociationMapOutput {
return o
}
func (o UserStackAssociationMapOutput) ToUserStackAssociationMapOutputWithContext(ctx context.Context) UserStackAssociationMapOutput {
return o
}
func (o UserStackAssociationMapOutput) MapIndex(k pulumi.StringInput) UserStackAssociationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *UserStackAssociation {
return vs[0].(map[string]*UserStackAssociation)[vs[1].(string)]
}).(UserStackAssociationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*UserStackAssociationInput)(nil)).Elem(), &UserStackAssociation{})
pulumi.RegisterInputType(reflect.TypeOf((*UserStackAssociationArrayInput)(nil)).Elem(), UserStackAssociationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*UserStackAssociationMapInput)(nil)).Elem(), UserStackAssociationMap{})
pulumi.RegisterOutputType(UserStackAssociationOutput{})
pulumi.RegisterOutputType(UserStackAssociationArrayOutput{})
pulumi.RegisterOutputType(UserStackAssociationMapOutput{})
}