-
Notifications
You must be signed in to change notification settings - Fork 151
/
fleetStackAssociation.go
271 lines (225 loc) · 9.59 KB
/
fleetStackAssociation.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package appstream
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an AppStream Fleet Stack association.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/appstream"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleFleet, err := appstream.NewFleet(ctx, "exampleFleet", &appstream.FleetArgs{
// ImageName: pulumi.String("Amazon-AppStream2-Sample-Image-02-04-2019"),
// InstanceType: pulumi.String("stream.standard.small"),
// ComputeCapacity: &appstream.FleetComputeCapacityArgs{
// DesiredInstances: pulumi.Int(1),
// },
// })
// if err != nil {
// return err
// }
// exampleStack, err := appstream.NewStack(ctx, "exampleStack", nil)
// if err != nil {
// return err
// }
// _, err = appstream.NewFleetStackAssociation(ctx, "exampleFleetStackAssociation", &appstream.FleetStackAssociationArgs{
// FleetName: exampleFleet.Name,
// StackName: exampleStack.Name,
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// AppStream Stack Fleet Association can be imported by using the `fleet_name` and `stack_name` separated by a slash (`/`), e.g.,
//
// ```sh
// $ pulumi import aws:appstream/fleetStackAssociation:FleetStackAssociation example fleetName/stackName
// ```
type FleetStackAssociation struct {
pulumi.CustomResourceState
// Name of the fleet.
FleetName pulumi.StringOutput `pulumi:"fleetName"`
// Name of the stack.
StackName pulumi.StringOutput `pulumi:"stackName"`
}
// NewFleetStackAssociation registers a new resource with the given unique name, arguments, and options.
func NewFleetStackAssociation(ctx *pulumi.Context,
name string, args *FleetStackAssociationArgs, opts ...pulumi.ResourceOption) (*FleetStackAssociation, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.FleetName == nil {
return nil, errors.New("invalid value for required argument 'FleetName'")
}
if args.StackName == nil {
return nil, errors.New("invalid value for required argument 'StackName'")
}
var resource FleetStackAssociation
err := ctx.RegisterResource("aws:appstream/fleetStackAssociation:FleetStackAssociation", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetFleetStackAssociation gets an existing FleetStackAssociation 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 GetFleetStackAssociation(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *FleetStackAssociationState, opts ...pulumi.ResourceOption) (*FleetStackAssociation, error) {
var resource FleetStackAssociation
err := ctx.ReadResource("aws:appstream/fleetStackAssociation:FleetStackAssociation", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering FleetStackAssociation resources.
type fleetStackAssociationState struct {
// Name of the fleet.
FleetName *string `pulumi:"fleetName"`
// Name of the stack.
StackName *string `pulumi:"stackName"`
}
type FleetStackAssociationState struct {
// Name of the fleet.
FleetName pulumi.StringPtrInput
// Name of the stack.
StackName pulumi.StringPtrInput
}
func (FleetStackAssociationState) ElementType() reflect.Type {
return reflect.TypeOf((*fleetStackAssociationState)(nil)).Elem()
}
type fleetStackAssociationArgs struct {
// Name of the fleet.
FleetName string `pulumi:"fleetName"`
// Name of the stack.
StackName string `pulumi:"stackName"`
}
// The set of arguments for constructing a FleetStackAssociation resource.
type FleetStackAssociationArgs struct {
// Name of the fleet.
FleetName pulumi.StringInput
// Name of the stack.
StackName pulumi.StringInput
}
func (FleetStackAssociationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*fleetStackAssociationArgs)(nil)).Elem()
}
type FleetStackAssociationInput interface {
pulumi.Input
ToFleetStackAssociationOutput() FleetStackAssociationOutput
ToFleetStackAssociationOutputWithContext(ctx context.Context) FleetStackAssociationOutput
}
func (*FleetStackAssociation) ElementType() reflect.Type {
return reflect.TypeOf((**FleetStackAssociation)(nil)).Elem()
}
func (i *FleetStackAssociation) ToFleetStackAssociationOutput() FleetStackAssociationOutput {
return i.ToFleetStackAssociationOutputWithContext(context.Background())
}
func (i *FleetStackAssociation) ToFleetStackAssociationOutputWithContext(ctx context.Context) FleetStackAssociationOutput {
return pulumi.ToOutputWithContext(ctx, i).(FleetStackAssociationOutput)
}
// FleetStackAssociationArrayInput is an input type that accepts FleetStackAssociationArray and FleetStackAssociationArrayOutput values.
// You can construct a concrete instance of `FleetStackAssociationArrayInput` via:
//
// FleetStackAssociationArray{ FleetStackAssociationArgs{...} }
type FleetStackAssociationArrayInput interface {
pulumi.Input
ToFleetStackAssociationArrayOutput() FleetStackAssociationArrayOutput
ToFleetStackAssociationArrayOutputWithContext(context.Context) FleetStackAssociationArrayOutput
}
type FleetStackAssociationArray []FleetStackAssociationInput
func (FleetStackAssociationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*FleetStackAssociation)(nil)).Elem()
}
func (i FleetStackAssociationArray) ToFleetStackAssociationArrayOutput() FleetStackAssociationArrayOutput {
return i.ToFleetStackAssociationArrayOutputWithContext(context.Background())
}
func (i FleetStackAssociationArray) ToFleetStackAssociationArrayOutputWithContext(ctx context.Context) FleetStackAssociationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(FleetStackAssociationArrayOutput)
}
// FleetStackAssociationMapInput is an input type that accepts FleetStackAssociationMap and FleetStackAssociationMapOutput values.
// You can construct a concrete instance of `FleetStackAssociationMapInput` via:
//
// FleetStackAssociationMap{ "key": FleetStackAssociationArgs{...} }
type FleetStackAssociationMapInput interface {
pulumi.Input
ToFleetStackAssociationMapOutput() FleetStackAssociationMapOutput
ToFleetStackAssociationMapOutputWithContext(context.Context) FleetStackAssociationMapOutput
}
type FleetStackAssociationMap map[string]FleetStackAssociationInput
func (FleetStackAssociationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*FleetStackAssociation)(nil)).Elem()
}
func (i FleetStackAssociationMap) ToFleetStackAssociationMapOutput() FleetStackAssociationMapOutput {
return i.ToFleetStackAssociationMapOutputWithContext(context.Background())
}
func (i FleetStackAssociationMap) ToFleetStackAssociationMapOutputWithContext(ctx context.Context) FleetStackAssociationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(FleetStackAssociationMapOutput)
}
type FleetStackAssociationOutput struct{ *pulumi.OutputState }
func (FleetStackAssociationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**FleetStackAssociation)(nil)).Elem()
}
func (o FleetStackAssociationOutput) ToFleetStackAssociationOutput() FleetStackAssociationOutput {
return o
}
func (o FleetStackAssociationOutput) ToFleetStackAssociationOutputWithContext(ctx context.Context) FleetStackAssociationOutput {
return o
}
type FleetStackAssociationArrayOutput struct{ *pulumi.OutputState }
func (FleetStackAssociationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*FleetStackAssociation)(nil)).Elem()
}
func (o FleetStackAssociationArrayOutput) ToFleetStackAssociationArrayOutput() FleetStackAssociationArrayOutput {
return o
}
func (o FleetStackAssociationArrayOutput) ToFleetStackAssociationArrayOutputWithContext(ctx context.Context) FleetStackAssociationArrayOutput {
return o
}
func (o FleetStackAssociationArrayOutput) Index(i pulumi.IntInput) FleetStackAssociationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *FleetStackAssociation {
return vs[0].([]*FleetStackAssociation)[vs[1].(int)]
}).(FleetStackAssociationOutput)
}
type FleetStackAssociationMapOutput struct{ *pulumi.OutputState }
func (FleetStackAssociationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*FleetStackAssociation)(nil)).Elem()
}
func (o FleetStackAssociationMapOutput) ToFleetStackAssociationMapOutput() FleetStackAssociationMapOutput {
return o
}
func (o FleetStackAssociationMapOutput) ToFleetStackAssociationMapOutputWithContext(ctx context.Context) FleetStackAssociationMapOutput {
return o
}
func (o FleetStackAssociationMapOutput) MapIndex(k pulumi.StringInput) FleetStackAssociationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *FleetStackAssociation {
return vs[0].(map[string]*FleetStackAssociation)[vs[1].(string)]
}).(FleetStackAssociationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*FleetStackAssociationInput)(nil)).Elem(), &FleetStackAssociation{})
pulumi.RegisterInputType(reflect.TypeOf((*FleetStackAssociationArrayInput)(nil)).Elem(), FleetStackAssociationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*FleetStackAssociationMapInput)(nil)).Elem(), FleetStackAssociationMap{})
pulumi.RegisterOutputType(FleetStackAssociationOutput{})
pulumi.RegisterOutputType(FleetStackAssociationArrayOutput{})
pulumi.RegisterOutputType(FleetStackAssociationMapOutput{})
}