github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/appstream/fleetStackAssociation.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 Fleet 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 // example, err := appstream.NewFleet(ctx, "example", &appstream.FleetArgs{ 33 // Name: pulumi.String("NAME"), 34 // ImageName: pulumi.String("Amazon-AppStream2-Sample-Image-03-11-2023"), 35 // InstanceType: pulumi.String("stream.standard.small"), 36 // ComputeCapacity: &appstream.FleetComputeCapacityArgs{ 37 // DesiredInstances: pulumi.Int(1), 38 // }, 39 // }) 40 // if err != nil { 41 // return err 42 // } 43 // exampleStack, err := appstream.NewStack(ctx, "example", &appstream.StackArgs{ 44 // Name: pulumi.String("STACK NAME"), 45 // }) 46 // if err != nil { 47 // return err 48 // } 49 // _, err = appstream.NewFleetStackAssociation(ctx, "example", &appstream.FleetStackAssociationArgs{ 50 // FleetName: example.Name, 51 // StackName: exampleStack.Name, 52 // }) 53 // if err != nil { 54 // return err 55 // } 56 // return nil 57 // }) 58 // } 59 // 60 // ``` 61 // <!--End PulumiCodeChooser --> 62 // 63 // ## Import 64 // 65 // Using `pulumi import`, import AppStream Stack Fleet Association using the `fleet_name` and `stack_name` separated by a slash (`/`). For example: 66 // 67 // ```sh 68 // $ pulumi import aws:appstream/fleetStackAssociation:FleetStackAssociation example fleetName/stackName 69 // ``` 70 type FleetStackAssociation struct { 71 pulumi.CustomResourceState 72 73 // Name of the fleet. 74 FleetName pulumi.StringOutput `pulumi:"fleetName"` 75 // Name of the stack. 76 StackName pulumi.StringOutput `pulumi:"stackName"` 77 } 78 79 // NewFleetStackAssociation registers a new resource with the given unique name, arguments, and options. 80 func NewFleetStackAssociation(ctx *pulumi.Context, 81 name string, args *FleetStackAssociationArgs, opts ...pulumi.ResourceOption) (*FleetStackAssociation, error) { 82 if args == nil { 83 return nil, errors.New("missing one or more required arguments") 84 } 85 86 if args.FleetName == nil { 87 return nil, errors.New("invalid value for required argument 'FleetName'") 88 } 89 if args.StackName == nil { 90 return nil, errors.New("invalid value for required argument 'StackName'") 91 } 92 opts = internal.PkgResourceDefaultOpts(opts) 93 var resource FleetStackAssociation 94 err := ctx.RegisterResource("aws:appstream/fleetStackAssociation:FleetStackAssociation", name, args, &resource, opts...) 95 if err != nil { 96 return nil, err 97 } 98 return &resource, nil 99 } 100 101 // GetFleetStackAssociation gets an existing FleetStackAssociation resource's state with the given name, ID, and optional 102 // state properties that are used to uniquely qualify the lookup (nil if not required). 103 func GetFleetStackAssociation(ctx *pulumi.Context, 104 name string, id pulumi.IDInput, state *FleetStackAssociationState, opts ...pulumi.ResourceOption) (*FleetStackAssociation, error) { 105 var resource FleetStackAssociation 106 err := ctx.ReadResource("aws:appstream/fleetStackAssociation:FleetStackAssociation", name, id, state, &resource, opts...) 107 if err != nil { 108 return nil, err 109 } 110 return &resource, nil 111 } 112 113 // Input properties used for looking up and filtering FleetStackAssociation resources. 114 type fleetStackAssociationState struct { 115 // Name of the fleet. 116 FleetName *string `pulumi:"fleetName"` 117 // Name of the stack. 118 StackName *string `pulumi:"stackName"` 119 } 120 121 type FleetStackAssociationState struct { 122 // Name of the fleet. 123 FleetName pulumi.StringPtrInput 124 // Name of the stack. 125 StackName pulumi.StringPtrInput 126 } 127 128 func (FleetStackAssociationState) ElementType() reflect.Type { 129 return reflect.TypeOf((*fleetStackAssociationState)(nil)).Elem() 130 } 131 132 type fleetStackAssociationArgs struct { 133 // Name of the fleet. 134 FleetName string `pulumi:"fleetName"` 135 // Name of the stack. 136 StackName string `pulumi:"stackName"` 137 } 138 139 // The set of arguments for constructing a FleetStackAssociation resource. 140 type FleetStackAssociationArgs struct { 141 // Name of the fleet. 142 FleetName pulumi.StringInput 143 // Name of the stack. 144 StackName pulumi.StringInput 145 } 146 147 func (FleetStackAssociationArgs) ElementType() reflect.Type { 148 return reflect.TypeOf((*fleetStackAssociationArgs)(nil)).Elem() 149 } 150 151 type FleetStackAssociationInput interface { 152 pulumi.Input 153 154 ToFleetStackAssociationOutput() FleetStackAssociationOutput 155 ToFleetStackAssociationOutputWithContext(ctx context.Context) FleetStackAssociationOutput 156 } 157 158 func (*FleetStackAssociation) ElementType() reflect.Type { 159 return reflect.TypeOf((**FleetStackAssociation)(nil)).Elem() 160 } 161 162 func (i *FleetStackAssociation) ToFleetStackAssociationOutput() FleetStackAssociationOutput { 163 return i.ToFleetStackAssociationOutputWithContext(context.Background()) 164 } 165 166 func (i *FleetStackAssociation) ToFleetStackAssociationOutputWithContext(ctx context.Context) FleetStackAssociationOutput { 167 return pulumi.ToOutputWithContext(ctx, i).(FleetStackAssociationOutput) 168 } 169 170 // FleetStackAssociationArrayInput is an input type that accepts FleetStackAssociationArray and FleetStackAssociationArrayOutput values. 171 // You can construct a concrete instance of `FleetStackAssociationArrayInput` via: 172 // 173 // FleetStackAssociationArray{ FleetStackAssociationArgs{...} } 174 type FleetStackAssociationArrayInput interface { 175 pulumi.Input 176 177 ToFleetStackAssociationArrayOutput() FleetStackAssociationArrayOutput 178 ToFleetStackAssociationArrayOutputWithContext(context.Context) FleetStackAssociationArrayOutput 179 } 180 181 type FleetStackAssociationArray []FleetStackAssociationInput 182 183 func (FleetStackAssociationArray) ElementType() reflect.Type { 184 return reflect.TypeOf((*[]*FleetStackAssociation)(nil)).Elem() 185 } 186 187 func (i FleetStackAssociationArray) ToFleetStackAssociationArrayOutput() FleetStackAssociationArrayOutput { 188 return i.ToFleetStackAssociationArrayOutputWithContext(context.Background()) 189 } 190 191 func (i FleetStackAssociationArray) ToFleetStackAssociationArrayOutputWithContext(ctx context.Context) FleetStackAssociationArrayOutput { 192 return pulumi.ToOutputWithContext(ctx, i).(FleetStackAssociationArrayOutput) 193 } 194 195 // FleetStackAssociationMapInput is an input type that accepts FleetStackAssociationMap and FleetStackAssociationMapOutput values. 196 // You can construct a concrete instance of `FleetStackAssociationMapInput` via: 197 // 198 // FleetStackAssociationMap{ "key": FleetStackAssociationArgs{...} } 199 type FleetStackAssociationMapInput interface { 200 pulumi.Input 201 202 ToFleetStackAssociationMapOutput() FleetStackAssociationMapOutput 203 ToFleetStackAssociationMapOutputWithContext(context.Context) FleetStackAssociationMapOutput 204 } 205 206 type FleetStackAssociationMap map[string]FleetStackAssociationInput 207 208 func (FleetStackAssociationMap) ElementType() reflect.Type { 209 return reflect.TypeOf((*map[string]*FleetStackAssociation)(nil)).Elem() 210 } 211 212 func (i FleetStackAssociationMap) ToFleetStackAssociationMapOutput() FleetStackAssociationMapOutput { 213 return i.ToFleetStackAssociationMapOutputWithContext(context.Background()) 214 } 215 216 func (i FleetStackAssociationMap) ToFleetStackAssociationMapOutputWithContext(ctx context.Context) FleetStackAssociationMapOutput { 217 return pulumi.ToOutputWithContext(ctx, i).(FleetStackAssociationMapOutput) 218 } 219 220 type FleetStackAssociationOutput struct{ *pulumi.OutputState } 221 222 func (FleetStackAssociationOutput) ElementType() reflect.Type { 223 return reflect.TypeOf((**FleetStackAssociation)(nil)).Elem() 224 } 225 226 func (o FleetStackAssociationOutput) ToFleetStackAssociationOutput() FleetStackAssociationOutput { 227 return o 228 } 229 230 func (o FleetStackAssociationOutput) ToFleetStackAssociationOutputWithContext(ctx context.Context) FleetStackAssociationOutput { 231 return o 232 } 233 234 // Name of the fleet. 235 func (o FleetStackAssociationOutput) FleetName() pulumi.StringOutput { 236 return o.ApplyT(func(v *FleetStackAssociation) pulumi.StringOutput { return v.FleetName }).(pulumi.StringOutput) 237 } 238 239 // Name of the stack. 240 func (o FleetStackAssociationOutput) StackName() pulumi.StringOutput { 241 return o.ApplyT(func(v *FleetStackAssociation) pulumi.StringOutput { return v.StackName }).(pulumi.StringOutput) 242 } 243 244 type FleetStackAssociationArrayOutput struct{ *pulumi.OutputState } 245 246 func (FleetStackAssociationArrayOutput) ElementType() reflect.Type { 247 return reflect.TypeOf((*[]*FleetStackAssociation)(nil)).Elem() 248 } 249 250 func (o FleetStackAssociationArrayOutput) ToFleetStackAssociationArrayOutput() FleetStackAssociationArrayOutput { 251 return o 252 } 253 254 func (o FleetStackAssociationArrayOutput) ToFleetStackAssociationArrayOutputWithContext(ctx context.Context) FleetStackAssociationArrayOutput { 255 return o 256 } 257 258 func (o FleetStackAssociationArrayOutput) Index(i pulumi.IntInput) FleetStackAssociationOutput { 259 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *FleetStackAssociation { 260 return vs[0].([]*FleetStackAssociation)[vs[1].(int)] 261 }).(FleetStackAssociationOutput) 262 } 263 264 type FleetStackAssociationMapOutput struct{ *pulumi.OutputState } 265 266 func (FleetStackAssociationMapOutput) ElementType() reflect.Type { 267 return reflect.TypeOf((*map[string]*FleetStackAssociation)(nil)).Elem() 268 } 269 270 func (o FleetStackAssociationMapOutput) ToFleetStackAssociationMapOutput() FleetStackAssociationMapOutput { 271 return o 272 } 273 274 func (o FleetStackAssociationMapOutput) ToFleetStackAssociationMapOutputWithContext(ctx context.Context) FleetStackAssociationMapOutput { 275 return o 276 } 277 278 func (o FleetStackAssociationMapOutput) MapIndex(k pulumi.StringInput) FleetStackAssociationOutput { 279 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *FleetStackAssociation { 280 return vs[0].(map[string]*FleetStackAssociation)[vs[1].(string)] 281 }).(FleetStackAssociationOutput) 282 } 283 284 func init() { 285 pulumi.RegisterInputType(reflect.TypeOf((*FleetStackAssociationInput)(nil)).Elem(), &FleetStackAssociation{}) 286 pulumi.RegisterInputType(reflect.TypeOf((*FleetStackAssociationArrayInput)(nil)).Elem(), FleetStackAssociationArray{}) 287 pulumi.RegisterInputType(reflect.TypeOf((*FleetStackAssociationMapInput)(nil)).Elem(), FleetStackAssociationMap{}) 288 pulumi.RegisterOutputType(FleetStackAssociationOutput{}) 289 pulumi.RegisterOutputType(FleetStackAssociationArrayOutput{}) 290 pulumi.RegisterOutputType(FleetStackAssociationMapOutput{}) 291 }