generated from pulumi/pulumi-tf-provider-boilerplate
/
bandwidthPackageAttachment.go
291 lines (243 loc) · 10.9 KB
/
bandwidthPackageAttachment.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
// 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 cen
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a CEN bandwidth package attachment resource. The resource can be used to bind a bandwidth package to a specified CEN instance.
//
// ## Example Usage
//
// # Basic Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/rhysmdnz/pulumi-alicloud/sdk/go/alicloud/cen"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// cen, err := cen.NewInstance(ctx, "cen", &cen.InstanceArgs{
// Description: pulumi.String("tf-testAccCenBandwidthPackageAttachmentDescription"),
// })
// if err != nil {
// return err
// }
// bwp, err := cen.NewBandwidthPackage(ctx, "bwp", &cen.BandwidthPackageArgs{
// Bandwidth: pulumi.Int(20),
// GeographicRegionIds: pulumi.StringArray{
// pulumi.String("China"),
// pulumi.String("Asia-Pacific"),
// },
// })
// if err != nil {
// return err
// }
// _, err = cen.NewBandwidthPackageAttachment(ctx, "foo", &cen.BandwidthPackageAttachmentArgs{
// InstanceId: cen.ID(),
// BandwidthPackageId: bwp.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// CEN bandwidth package attachment resource can be imported using the id, e.g.
//
// ```sh
//
// $ pulumi import alicloud:cen/bandwidthPackageAttachment:BandwidthPackageAttachment example bwp-abc123456
//
// ```
type BandwidthPackageAttachment struct {
pulumi.CustomResourceState
// The ID of the bandwidth package.
BandwidthPackageId pulumi.StringOutput `pulumi:"bandwidthPackageId"`
// The ID of the CEN.
InstanceId pulumi.StringOutput `pulumi:"instanceId"`
}
// NewBandwidthPackageAttachment registers a new resource with the given unique name, arguments, and options.
func NewBandwidthPackageAttachment(ctx *pulumi.Context,
name string, args *BandwidthPackageAttachmentArgs, opts ...pulumi.ResourceOption) (*BandwidthPackageAttachment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.BandwidthPackageId == nil {
return nil, errors.New("invalid value for required argument 'BandwidthPackageId'")
}
if args.InstanceId == nil {
return nil, errors.New("invalid value for required argument 'InstanceId'")
}
opts = pkgResourceDefaultOpts(opts)
var resource BandwidthPackageAttachment
err := ctx.RegisterResource("alicloud:cen/bandwidthPackageAttachment:BandwidthPackageAttachment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBandwidthPackageAttachment gets an existing BandwidthPackageAttachment 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 GetBandwidthPackageAttachment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BandwidthPackageAttachmentState, opts ...pulumi.ResourceOption) (*BandwidthPackageAttachment, error) {
var resource BandwidthPackageAttachment
err := ctx.ReadResource("alicloud:cen/bandwidthPackageAttachment:BandwidthPackageAttachment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering BandwidthPackageAttachment resources.
type bandwidthPackageAttachmentState struct {
// The ID of the bandwidth package.
BandwidthPackageId *string `pulumi:"bandwidthPackageId"`
// The ID of the CEN.
InstanceId *string `pulumi:"instanceId"`
}
type BandwidthPackageAttachmentState struct {
// The ID of the bandwidth package.
BandwidthPackageId pulumi.StringPtrInput
// The ID of the CEN.
InstanceId pulumi.StringPtrInput
}
func (BandwidthPackageAttachmentState) ElementType() reflect.Type {
return reflect.TypeOf((*bandwidthPackageAttachmentState)(nil)).Elem()
}
type bandwidthPackageAttachmentArgs struct {
// The ID of the bandwidth package.
BandwidthPackageId string `pulumi:"bandwidthPackageId"`
// The ID of the CEN.
InstanceId string `pulumi:"instanceId"`
}
// The set of arguments for constructing a BandwidthPackageAttachment resource.
type BandwidthPackageAttachmentArgs struct {
// The ID of the bandwidth package.
BandwidthPackageId pulumi.StringInput
// The ID of the CEN.
InstanceId pulumi.StringInput
}
func (BandwidthPackageAttachmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*bandwidthPackageAttachmentArgs)(nil)).Elem()
}
type BandwidthPackageAttachmentInput interface {
pulumi.Input
ToBandwidthPackageAttachmentOutput() BandwidthPackageAttachmentOutput
ToBandwidthPackageAttachmentOutputWithContext(ctx context.Context) BandwidthPackageAttachmentOutput
}
func (*BandwidthPackageAttachment) ElementType() reflect.Type {
return reflect.TypeOf((**BandwidthPackageAttachment)(nil)).Elem()
}
func (i *BandwidthPackageAttachment) ToBandwidthPackageAttachmentOutput() BandwidthPackageAttachmentOutput {
return i.ToBandwidthPackageAttachmentOutputWithContext(context.Background())
}
func (i *BandwidthPackageAttachment) ToBandwidthPackageAttachmentOutputWithContext(ctx context.Context) BandwidthPackageAttachmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(BandwidthPackageAttachmentOutput)
}
// BandwidthPackageAttachmentArrayInput is an input type that accepts BandwidthPackageAttachmentArray and BandwidthPackageAttachmentArrayOutput values.
// You can construct a concrete instance of `BandwidthPackageAttachmentArrayInput` via:
//
// BandwidthPackageAttachmentArray{ BandwidthPackageAttachmentArgs{...} }
type BandwidthPackageAttachmentArrayInput interface {
pulumi.Input
ToBandwidthPackageAttachmentArrayOutput() BandwidthPackageAttachmentArrayOutput
ToBandwidthPackageAttachmentArrayOutputWithContext(context.Context) BandwidthPackageAttachmentArrayOutput
}
type BandwidthPackageAttachmentArray []BandwidthPackageAttachmentInput
func (BandwidthPackageAttachmentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BandwidthPackageAttachment)(nil)).Elem()
}
func (i BandwidthPackageAttachmentArray) ToBandwidthPackageAttachmentArrayOutput() BandwidthPackageAttachmentArrayOutput {
return i.ToBandwidthPackageAttachmentArrayOutputWithContext(context.Background())
}
func (i BandwidthPackageAttachmentArray) ToBandwidthPackageAttachmentArrayOutputWithContext(ctx context.Context) BandwidthPackageAttachmentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(BandwidthPackageAttachmentArrayOutput)
}
// BandwidthPackageAttachmentMapInput is an input type that accepts BandwidthPackageAttachmentMap and BandwidthPackageAttachmentMapOutput values.
// You can construct a concrete instance of `BandwidthPackageAttachmentMapInput` via:
//
// BandwidthPackageAttachmentMap{ "key": BandwidthPackageAttachmentArgs{...} }
type BandwidthPackageAttachmentMapInput interface {
pulumi.Input
ToBandwidthPackageAttachmentMapOutput() BandwidthPackageAttachmentMapOutput
ToBandwidthPackageAttachmentMapOutputWithContext(context.Context) BandwidthPackageAttachmentMapOutput
}
type BandwidthPackageAttachmentMap map[string]BandwidthPackageAttachmentInput
func (BandwidthPackageAttachmentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BandwidthPackageAttachment)(nil)).Elem()
}
func (i BandwidthPackageAttachmentMap) ToBandwidthPackageAttachmentMapOutput() BandwidthPackageAttachmentMapOutput {
return i.ToBandwidthPackageAttachmentMapOutputWithContext(context.Background())
}
func (i BandwidthPackageAttachmentMap) ToBandwidthPackageAttachmentMapOutputWithContext(ctx context.Context) BandwidthPackageAttachmentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(BandwidthPackageAttachmentMapOutput)
}
type BandwidthPackageAttachmentOutput struct{ *pulumi.OutputState }
func (BandwidthPackageAttachmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**BandwidthPackageAttachment)(nil)).Elem()
}
func (o BandwidthPackageAttachmentOutput) ToBandwidthPackageAttachmentOutput() BandwidthPackageAttachmentOutput {
return o
}
func (o BandwidthPackageAttachmentOutput) ToBandwidthPackageAttachmentOutputWithContext(ctx context.Context) BandwidthPackageAttachmentOutput {
return o
}
// The ID of the bandwidth package.
func (o BandwidthPackageAttachmentOutput) BandwidthPackageId() pulumi.StringOutput {
return o.ApplyT(func(v *BandwidthPackageAttachment) pulumi.StringOutput { return v.BandwidthPackageId }).(pulumi.StringOutput)
}
// The ID of the CEN.
func (o BandwidthPackageAttachmentOutput) InstanceId() pulumi.StringOutput {
return o.ApplyT(func(v *BandwidthPackageAttachment) pulumi.StringOutput { return v.InstanceId }).(pulumi.StringOutput)
}
type BandwidthPackageAttachmentArrayOutput struct{ *pulumi.OutputState }
func (BandwidthPackageAttachmentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BandwidthPackageAttachment)(nil)).Elem()
}
func (o BandwidthPackageAttachmentArrayOutput) ToBandwidthPackageAttachmentArrayOutput() BandwidthPackageAttachmentArrayOutput {
return o
}
func (o BandwidthPackageAttachmentArrayOutput) ToBandwidthPackageAttachmentArrayOutputWithContext(ctx context.Context) BandwidthPackageAttachmentArrayOutput {
return o
}
func (o BandwidthPackageAttachmentArrayOutput) Index(i pulumi.IntInput) BandwidthPackageAttachmentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *BandwidthPackageAttachment {
return vs[0].([]*BandwidthPackageAttachment)[vs[1].(int)]
}).(BandwidthPackageAttachmentOutput)
}
type BandwidthPackageAttachmentMapOutput struct{ *pulumi.OutputState }
func (BandwidthPackageAttachmentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BandwidthPackageAttachment)(nil)).Elem()
}
func (o BandwidthPackageAttachmentMapOutput) ToBandwidthPackageAttachmentMapOutput() BandwidthPackageAttachmentMapOutput {
return o
}
func (o BandwidthPackageAttachmentMapOutput) ToBandwidthPackageAttachmentMapOutputWithContext(ctx context.Context) BandwidthPackageAttachmentMapOutput {
return o
}
func (o BandwidthPackageAttachmentMapOutput) MapIndex(k pulumi.StringInput) BandwidthPackageAttachmentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *BandwidthPackageAttachment {
return vs[0].(map[string]*BandwidthPackageAttachment)[vs[1].(string)]
}).(BandwidthPackageAttachmentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*BandwidthPackageAttachmentInput)(nil)).Elem(), &BandwidthPackageAttachment{})
pulumi.RegisterInputType(reflect.TypeOf((*BandwidthPackageAttachmentArrayInput)(nil)).Elem(), BandwidthPackageAttachmentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*BandwidthPackageAttachmentMapInput)(nil)).Elem(), BandwidthPackageAttachmentMap{})
pulumi.RegisterOutputType(BandwidthPackageAttachmentOutput{})
pulumi.RegisterOutputType(BandwidthPackageAttachmentArrayOutput{})
pulumi.RegisterOutputType(BandwidthPackageAttachmentMapOutput{})
}