github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/appstream/userStackAssociation.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package appstream 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Manages an AppStream User Stack association. 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appstream" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // test, err := appstream.NewStack(ctx, "test", &appstream.StackArgs{ 33 // Name: pulumi.String("STACK NAME"), 34 // }) 35 // if err != nil { 36 // return err 37 // } 38 // testUser, err := appstream.NewUser(ctx, "test", &appstream.UserArgs{ 39 // AuthenticationType: pulumi.String("USERPOOL"), 40 // UserName: pulumi.String("EMAIL"), 41 // }) 42 // if err != nil { 43 // return err 44 // } 45 // _, err = appstream.NewUserStackAssociation(ctx, "test", &appstream.UserStackAssociationArgs{ 46 // AuthenticationType: testUser.AuthenticationType, 47 // StackName: test.Name, 48 // UserName: testUser.UserName, 49 // }) 50 // if err != nil { 51 // return err 52 // } 53 // return nil 54 // }) 55 // } 56 // 57 // ``` 58 // <!--End PulumiCodeChooser --> 59 // 60 // ## Import 61 // 62 // Using `pulumi import`, import AppStream User Stack Association using the `user_name`, `authentication_type`, and `stack_name`, separated by a slash (`/`). For example: 63 // 64 // ```sh 65 // $ pulumi import aws:appstream/userStackAssociation:UserStackAssociation example userName/auhtenticationType/stackName 66 // ``` 67 type UserStackAssociation struct { 68 pulumi.CustomResourceState 69 70 // Authentication type for the user. 71 AuthenticationType pulumi.StringOutput `pulumi:"authenticationType"` 72 // Whether a welcome email is sent to a user after the user is created in the user pool. 73 SendEmailNotification pulumi.BoolPtrOutput `pulumi:"sendEmailNotification"` 74 // Name of the stack that is associated with the user. 75 StackName pulumi.StringOutput `pulumi:"stackName"` 76 // Email address of the user who is associated with the stack. 77 // 78 // The following arguments are optional: 79 UserName pulumi.StringOutput `pulumi:"userName"` 80 } 81 82 // NewUserStackAssociation registers a new resource with the given unique name, arguments, and options. 83 func NewUserStackAssociation(ctx *pulumi.Context, 84 name string, args *UserStackAssociationArgs, opts ...pulumi.ResourceOption) (*UserStackAssociation, error) { 85 if args == nil { 86 return nil, errors.New("missing one or more required arguments") 87 } 88 89 if args.AuthenticationType == nil { 90 return nil, errors.New("invalid value for required argument 'AuthenticationType'") 91 } 92 if args.StackName == nil { 93 return nil, errors.New("invalid value for required argument 'StackName'") 94 } 95 if args.UserName == nil { 96 return nil, errors.New("invalid value for required argument 'UserName'") 97 } 98 opts = internal.PkgResourceDefaultOpts(opts) 99 var resource UserStackAssociation 100 err := ctx.RegisterResource("aws:appstream/userStackAssociation:UserStackAssociation", name, args, &resource, opts...) 101 if err != nil { 102 return nil, err 103 } 104 return &resource, nil 105 } 106 107 // GetUserStackAssociation gets an existing UserStackAssociation resource's state with the given name, ID, and optional 108 // state properties that are used to uniquely qualify the lookup (nil if not required). 109 func GetUserStackAssociation(ctx *pulumi.Context, 110 name string, id pulumi.IDInput, state *UserStackAssociationState, opts ...pulumi.ResourceOption) (*UserStackAssociation, error) { 111 var resource UserStackAssociation 112 err := ctx.ReadResource("aws:appstream/userStackAssociation:UserStackAssociation", name, id, state, &resource, opts...) 113 if err != nil { 114 return nil, err 115 } 116 return &resource, nil 117 } 118 119 // Input properties used for looking up and filtering UserStackAssociation resources. 120 type userStackAssociationState struct { 121 // Authentication type for the user. 122 AuthenticationType *string `pulumi:"authenticationType"` 123 // Whether a welcome email is sent to a user after the user is created in the user pool. 124 SendEmailNotification *bool `pulumi:"sendEmailNotification"` 125 // Name of the stack that is associated with the user. 126 StackName *string `pulumi:"stackName"` 127 // Email address of the user who is associated with the stack. 128 // 129 // The following arguments are optional: 130 UserName *string `pulumi:"userName"` 131 } 132 133 type UserStackAssociationState struct { 134 // Authentication type for the user. 135 AuthenticationType pulumi.StringPtrInput 136 // Whether a welcome email is sent to a user after the user is created in the user pool. 137 SendEmailNotification pulumi.BoolPtrInput 138 // Name of the stack that is associated with the user. 139 StackName pulumi.StringPtrInput 140 // Email address of the user who is associated with the stack. 141 // 142 // The following arguments are optional: 143 UserName pulumi.StringPtrInput 144 } 145 146 func (UserStackAssociationState) ElementType() reflect.Type { 147 return reflect.TypeOf((*userStackAssociationState)(nil)).Elem() 148 } 149 150 type userStackAssociationArgs struct { 151 // Authentication type for the user. 152 AuthenticationType string `pulumi:"authenticationType"` 153 // Whether a welcome email is sent to a user after the user is created in the user pool. 154 SendEmailNotification *bool `pulumi:"sendEmailNotification"` 155 // Name of the stack that is associated with the user. 156 StackName string `pulumi:"stackName"` 157 // Email address of the user who is associated with the stack. 158 // 159 // The following arguments are optional: 160 UserName string `pulumi:"userName"` 161 } 162 163 // The set of arguments for constructing a UserStackAssociation resource. 164 type UserStackAssociationArgs struct { 165 // Authentication type for the user. 166 AuthenticationType pulumi.StringInput 167 // Whether a welcome email is sent to a user after the user is created in the user pool. 168 SendEmailNotification pulumi.BoolPtrInput 169 // Name of the stack that is associated with the user. 170 StackName pulumi.StringInput 171 // Email address of the user who is associated with the stack. 172 // 173 // The following arguments are optional: 174 UserName pulumi.StringInput 175 } 176 177 func (UserStackAssociationArgs) ElementType() reflect.Type { 178 return reflect.TypeOf((*userStackAssociationArgs)(nil)).Elem() 179 } 180 181 type UserStackAssociationInput interface { 182 pulumi.Input 183 184 ToUserStackAssociationOutput() UserStackAssociationOutput 185 ToUserStackAssociationOutputWithContext(ctx context.Context) UserStackAssociationOutput 186 } 187 188 func (*UserStackAssociation) ElementType() reflect.Type { 189 return reflect.TypeOf((**UserStackAssociation)(nil)).Elem() 190 } 191 192 func (i *UserStackAssociation) ToUserStackAssociationOutput() UserStackAssociationOutput { 193 return i.ToUserStackAssociationOutputWithContext(context.Background()) 194 } 195 196 func (i *UserStackAssociation) ToUserStackAssociationOutputWithContext(ctx context.Context) UserStackAssociationOutput { 197 return pulumi.ToOutputWithContext(ctx, i).(UserStackAssociationOutput) 198 } 199 200 // UserStackAssociationArrayInput is an input type that accepts UserStackAssociationArray and UserStackAssociationArrayOutput values. 201 // You can construct a concrete instance of `UserStackAssociationArrayInput` via: 202 // 203 // UserStackAssociationArray{ UserStackAssociationArgs{...} } 204 type UserStackAssociationArrayInput interface { 205 pulumi.Input 206 207 ToUserStackAssociationArrayOutput() UserStackAssociationArrayOutput 208 ToUserStackAssociationArrayOutputWithContext(context.Context) UserStackAssociationArrayOutput 209 } 210 211 type UserStackAssociationArray []UserStackAssociationInput 212 213 func (UserStackAssociationArray) ElementType() reflect.Type { 214 return reflect.TypeOf((*[]*UserStackAssociation)(nil)).Elem() 215 } 216 217 func (i UserStackAssociationArray) ToUserStackAssociationArrayOutput() UserStackAssociationArrayOutput { 218 return i.ToUserStackAssociationArrayOutputWithContext(context.Background()) 219 } 220 221 func (i UserStackAssociationArray) ToUserStackAssociationArrayOutputWithContext(ctx context.Context) UserStackAssociationArrayOutput { 222 return pulumi.ToOutputWithContext(ctx, i).(UserStackAssociationArrayOutput) 223 } 224 225 // UserStackAssociationMapInput is an input type that accepts UserStackAssociationMap and UserStackAssociationMapOutput values. 226 // You can construct a concrete instance of `UserStackAssociationMapInput` via: 227 // 228 // UserStackAssociationMap{ "key": UserStackAssociationArgs{...} } 229 type UserStackAssociationMapInput interface { 230 pulumi.Input 231 232 ToUserStackAssociationMapOutput() UserStackAssociationMapOutput 233 ToUserStackAssociationMapOutputWithContext(context.Context) UserStackAssociationMapOutput 234 } 235 236 type UserStackAssociationMap map[string]UserStackAssociationInput 237 238 func (UserStackAssociationMap) ElementType() reflect.Type { 239 return reflect.TypeOf((*map[string]*UserStackAssociation)(nil)).Elem() 240 } 241 242 func (i UserStackAssociationMap) ToUserStackAssociationMapOutput() UserStackAssociationMapOutput { 243 return i.ToUserStackAssociationMapOutputWithContext(context.Background()) 244 } 245 246 func (i UserStackAssociationMap) ToUserStackAssociationMapOutputWithContext(ctx context.Context) UserStackAssociationMapOutput { 247 return pulumi.ToOutputWithContext(ctx, i).(UserStackAssociationMapOutput) 248 } 249 250 type UserStackAssociationOutput struct{ *pulumi.OutputState } 251 252 func (UserStackAssociationOutput) ElementType() reflect.Type { 253 return reflect.TypeOf((**UserStackAssociation)(nil)).Elem() 254 } 255 256 func (o UserStackAssociationOutput) ToUserStackAssociationOutput() UserStackAssociationOutput { 257 return o 258 } 259 260 func (o UserStackAssociationOutput) ToUserStackAssociationOutputWithContext(ctx context.Context) UserStackAssociationOutput { 261 return o 262 } 263 264 // Authentication type for the user. 265 func (o UserStackAssociationOutput) AuthenticationType() pulumi.StringOutput { 266 return o.ApplyT(func(v *UserStackAssociation) pulumi.StringOutput { return v.AuthenticationType }).(pulumi.StringOutput) 267 } 268 269 // Whether a welcome email is sent to a user after the user is created in the user pool. 270 func (o UserStackAssociationOutput) SendEmailNotification() pulumi.BoolPtrOutput { 271 return o.ApplyT(func(v *UserStackAssociation) pulumi.BoolPtrOutput { return v.SendEmailNotification }).(pulumi.BoolPtrOutput) 272 } 273 274 // Name of the stack that is associated with the user. 275 func (o UserStackAssociationOutput) StackName() pulumi.StringOutput { 276 return o.ApplyT(func(v *UserStackAssociation) pulumi.StringOutput { return v.StackName }).(pulumi.StringOutput) 277 } 278 279 // Email address of the user who is associated with the stack. 280 // 281 // The following arguments are optional: 282 func (o UserStackAssociationOutput) UserName() pulumi.StringOutput { 283 return o.ApplyT(func(v *UserStackAssociation) pulumi.StringOutput { return v.UserName }).(pulumi.StringOutput) 284 } 285 286 type UserStackAssociationArrayOutput struct{ *pulumi.OutputState } 287 288 func (UserStackAssociationArrayOutput) ElementType() reflect.Type { 289 return reflect.TypeOf((*[]*UserStackAssociation)(nil)).Elem() 290 } 291 292 func (o UserStackAssociationArrayOutput) ToUserStackAssociationArrayOutput() UserStackAssociationArrayOutput { 293 return o 294 } 295 296 func (o UserStackAssociationArrayOutput) ToUserStackAssociationArrayOutputWithContext(ctx context.Context) UserStackAssociationArrayOutput { 297 return o 298 } 299 300 func (o UserStackAssociationArrayOutput) Index(i pulumi.IntInput) UserStackAssociationOutput { 301 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *UserStackAssociation { 302 return vs[0].([]*UserStackAssociation)[vs[1].(int)] 303 }).(UserStackAssociationOutput) 304 } 305 306 type UserStackAssociationMapOutput struct{ *pulumi.OutputState } 307 308 func (UserStackAssociationMapOutput) ElementType() reflect.Type { 309 return reflect.TypeOf((*map[string]*UserStackAssociation)(nil)).Elem() 310 } 311 312 func (o UserStackAssociationMapOutput) ToUserStackAssociationMapOutput() UserStackAssociationMapOutput { 313 return o 314 } 315 316 func (o UserStackAssociationMapOutput) ToUserStackAssociationMapOutputWithContext(ctx context.Context) UserStackAssociationMapOutput { 317 return o 318 } 319 320 func (o UserStackAssociationMapOutput) MapIndex(k pulumi.StringInput) UserStackAssociationOutput { 321 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *UserStackAssociation { 322 return vs[0].(map[string]*UserStackAssociation)[vs[1].(string)] 323 }).(UserStackAssociationOutput) 324 } 325 326 func init() { 327 pulumi.RegisterInputType(reflect.TypeOf((*UserStackAssociationInput)(nil)).Elem(), &UserStackAssociation{}) 328 pulumi.RegisterInputType(reflect.TypeOf((*UserStackAssociationArrayInput)(nil)).Elem(), UserStackAssociationArray{}) 329 pulumi.RegisterInputType(reflect.TypeOf((*UserStackAssociationMapInput)(nil)).Elem(), UserStackAssociationMap{}) 330 pulumi.RegisterOutputType(UserStackAssociationOutput{}) 331 pulumi.RegisterOutputType(UserStackAssociationArrayOutput{}) 332 pulumi.RegisterOutputType(UserStackAssociationMapOutput{}) 333 }