generated from pulumi/pulumi-tf-provider-boilerplate
/
addressBandwidth.go
288 lines (238 loc) · 12.2 KB
/
addressBandwidth.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
// 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 ipv6
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a resource to create a ipv6AddressBandwidth
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go/tencentcloud/Ipv6"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Ipv6.NewAddressBandwidth(ctx, "ipv6AddressBandwidth", &Ipv6.AddressBandwidthArgs{
// InternetChargeType: pulumi.String("TRAFFIC_POSTPAID_BY_HOUR"),
// InternetMaxBandwidthOut: pulumi.Int(6),
// Ipv6Address: pulumi.String("2402:4e00:1019:9400:0:9905:a90b:2ef0"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
type AddressBandwidth struct {
pulumi.CustomResourceState
// The bandwidth package id, the Legacy account and the ipv6 address to apply for the bandwidth package charge type need to be passed in.
BandwidthPackageId pulumi.StringPtrOutput `pulumi:"bandwidthPackageId"`
// Network billing mode. IPV6 currently supports: `TRAFFIC_POSTPAID_BY_HOUR`, for standard account types; `BANDWIDTH_PACKAGE`, for traditional account types. The default network billing mode is: `TRAFFIC_POSTPAID_BY_HOUR`.
InternetChargeType pulumi.StringPtrOutput `pulumi:"internetChargeType"`
// Bandwidth, in Mbps. The default is 1Mbps.
InternetMaxBandwidthOut pulumi.IntPtrOutput `pulumi:"internetMaxBandwidthOut"`
// IPV6 address that needs to be enabled for public network access.
Ipv6Address pulumi.StringOutput `pulumi:"ipv6Address"`
}
// NewAddressBandwidth registers a new resource with the given unique name, arguments, and options.
func NewAddressBandwidth(ctx *pulumi.Context,
name string, args *AddressBandwidthArgs, opts ...pulumi.ResourceOption) (*AddressBandwidth, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Ipv6Address == nil {
return nil, errors.New("invalid value for required argument 'Ipv6Address'")
}
opts = pkgResourceDefaultOpts(opts)
var resource AddressBandwidth
err := ctx.RegisterResource("tencentcloud:Ipv6/addressBandwidth:AddressBandwidth", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAddressBandwidth gets an existing AddressBandwidth 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 GetAddressBandwidth(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AddressBandwidthState, opts ...pulumi.ResourceOption) (*AddressBandwidth, error) {
var resource AddressBandwidth
err := ctx.ReadResource("tencentcloud:Ipv6/addressBandwidth:AddressBandwidth", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AddressBandwidth resources.
type addressBandwidthState struct {
// The bandwidth package id, the Legacy account and the ipv6 address to apply for the bandwidth package charge type need to be passed in.
BandwidthPackageId *string `pulumi:"bandwidthPackageId"`
// Network billing mode. IPV6 currently supports: `TRAFFIC_POSTPAID_BY_HOUR`, for standard account types; `BANDWIDTH_PACKAGE`, for traditional account types. The default network billing mode is: `TRAFFIC_POSTPAID_BY_HOUR`.
InternetChargeType *string `pulumi:"internetChargeType"`
// Bandwidth, in Mbps. The default is 1Mbps.
InternetMaxBandwidthOut *int `pulumi:"internetMaxBandwidthOut"`
// IPV6 address that needs to be enabled for public network access.
Ipv6Address *string `pulumi:"ipv6Address"`
}
type AddressBandwidthState struct {
// The bandwidth package id, the Legacy account and the ipv6 address to apply for the bandwidth package charge type need to be passed in.
BandwidthPackageId pulumi.StringPtrInput
// Network billing mode. IPV6 currently supports: `TRAFFIC_POSTPAID_BY_HOUR`, for standard account types; `BANDWIDTH_PACKAGE`, for traditional account types. The default network billing mode is: `TRAFFIC_POSTPAID_BY_HOUR`.
InternetChargeType pulumi.StringPtrInput
// Bandwidth, in Mbps. The default is 1Mbps.
InternetMaxBandwidthOut pulumi.IntPtrInput
// IPV6 address that needs to be enabled for public network access.
Ipv6Address pulumi.StringPtrInput
}
func (AddressBandwidthState) ElementType() reflect.Type {
return reflect.TypeOf((*addressBandwidthState)(nil)).Elem()
}
type addressBandwidthArgs struct {
// The bandwidth package id, the Legacy account and the ipv6 address to apply for the bandwidth package charge type need to be passed in.
BandwidthPackageId *string `pulumi:"bandwidthPackageId"`
// Network billing mode. IPV6 currently supports: `TRAFFIC_POSTPAID_BY_HOUR`, for standard account types; `BANDWIDTH_PACKAGE`, for traditional account types. The default network billing mode is: `TRAFFIC_POSTPAID_BY_HOUR`.
InternetChargeType *string `pulumi:"internetChargeType"`
// Bandwidth, in Mbps. The default is 1Mbps.
InternetMaxBandwidthOut *int `pulumi:"internetMaxBandwidthOut"`
// IPV6 address that needs to be enabled for public network access.
Ipv6Address string `pulumi:"ipv6Address"`
}
// The set of arguments for constructing a AddressBandwidth resource.
type AddressBandwidthArgs struct {
// The bandwidth package id, the Legacy account and the ipv6 address to apply for the bandwidth package charge type need to be passed in.
BandwidthPackageId pulumi.StringPtrInput
// Network billing mode. IPV6 currently supports: `TRAFFIC_POSTPAID_BY_HOUR`, for standard account types; `BANDWIDTH_PACKAGE`, for traditional account types. The default network billing mode is: `TRAFFIC_POSTPAID_BY_HOUR`.
InternetChargeType pulumi.StringPtrInput
// Bandwidth, in Mbps. The default is 1Mbps.
InternetMaxBandwidthOut pulumi.IntPtrInput
// IPV6 address that needs to be enabled for public network access.
Ipv6Address pulumi.StringInput
}
func (AddressBandwidthArgs) ElementType() reflect.Type {
return reflect.TypeOf((*addressBandwidthArgs)(nil)).Elem()
}
type AddressBandwidthInput interface {
pulumi.Input
ToAddressBandwidthOutput() AddressBandwidthOutput
ToAddressBandwidthOutputWithContext(ctx context.Context) AddressBandwidthOutput
}
func (*AddressBandwidth) ElementType() reflect.Type {
return reflect.TypeOf((**AddressBandwidth)(nil)).Elem()
}
func (i *AddressBandwidth) ToAddressBandwidthOutput() AddressBandwidthOutput {
return i.ToAddressBandwidthOutputWithContext(context.Background())
}
func (i *AddressBandwidth) ToAddressBandwidthOutputWithContext(ctx context.Context) AddressBandwidthOutput {
return pulumi.ToOutputWithContext(ctx, i).(AddressBandwidthOutput)
}
// AddressBandwidthArrayInput is an input type that accepts AddressBandwidthArray and AddressBandwidthArrayOutput values.
// You can construct a concrete instance of `AddressBandwidthArrayInput` via:
//
// AddressBandwidthArray{ AddressBandwidthArgs{...} }
type AddressBandwidthArrayInput interface {
pulumi.Input
ToAddressBandwidthArrayOutput() AddressBandwidthArrayOutput
ToAddressBandwidthArrayOutputWithContext(context.Context) AddressBandwidthArrayOutput
}
type AddressBandwidthArray []AddressBandwidthInput
func (AddressBandwidthArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AddressBandwidth)(nil)).Elem()
}
func (i AddressBandwidthArray) ToAddressBandwidthArrayOutput() AddressBandwidthArrayOutput {
return i.ToAddressBandwidthArrayOutputWithContext(context.Background())
}
func (i AddressBandwidthArray) ToAddressBandwidthArrayOutputWithContext(ctx context.Context) AddressBandwidthArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AddressBandwidthArrayOutput)
}
// AddressBandwidthMapInput is an input type that accepts AddressBandwidthMap and AddressBandwidthMapOutput values.
// You can construct a concrete instance of `AddressBandwidthMapInput` via:
//
// AddressBandwidthMap{ "key": AddressBandwidthArgs{...} }
type AddressBandwidthMapInput interface {
pulumi.Input
ToAddressBandwidthMapOutput() AddressBandwidthMapOutput
ToAddressBandwidthMapOutputWithContext(context.Context) AddressBandwidthMapOutput
}
type AddressBandwidthMap map[string]AddressBandwidthInput
func (AddressBandwidthMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AddressBandwidth)(nil)).Elem()
}
func (i AddressBandwidthMap) ToAddressBandwidthMapOutput() AddressBandwidthMapOutput {
return i.ToAddressBandwidthMapOutputWithContext(context.Background())
}
func (i AddressBandwidthMap) ToAddressBandwidthMapOutputWithContext(ctx context.Context) AddressBandwidthMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AddressBandwidthMapOutput)
}
type AddressBandwidthOutput struct{ *pulumi.OutputState }
func (AddressBandwidthOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AddressBandwidth)(nil)).Elem()
}
func (o AddressBandwidthOutput) ToAddressBandwidthOutput() AddressBandwidthOutput {
return o
}
func (o AddressBandwidthOutput) ToAddressBandwidthOutputWithContext(ctx context.Context) AddressBandwidthOutput {
return o
}
// The bandwidth package id, the Legacy account and the ipv6 address to apply for the bandwidth package charge type need to be passed in.
func (o AddressBandwidthOutput) BandwidthPackageId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AddressBandwidth) pulumi.StringPtrOutput { return v.BandwidthPackageId }).(pulumi.StringPtrOutput)
}
// Network billing mode. IPV6 currently supports: `TRAFFIC_POSTPAID_BY_HOUR`, for standard account types; `BANDWIDTH_PACKAGE`, for traditional account types. The default network billing mode is: `TRAFFIC_POSTPAID_BY_HOUR`.
func (o AddressBandwidthOutput) InternetChargeType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AddressBandwidth) pulumi.StringPtrOutput { return v.InternetChargeType }).(pulumi.StringPtrOutput)
}
// Bandwidth, in Mbps. The default is 1Mbps.
func (o AddressBandwidthOutput) InternetMaxBandwidthOut() pulumi.IntPtrOutput {
return o.ApplyT(func(v *AddressBandwidth) pulumi.IntPtrOutput { return v.InternetMaxBandwidthOut }).(pulumi.IntPtrOutput)
}
// IPV6 address that needs to be enabled for public network access.
func (o AddressBandwidthOutput) Ipv6Address() pulumi.StringOutput {
return o.ApplyT(func(v *AddressBandwidth) pulumi.StringOutput { return v.Ipv6Address }).(pulumi.StringOutput)
}
type AddressBandwidthArrayOutput struct{ *pulumi.OutputState }
func (AddressBandwidthArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AddressBandwidth)(nil)).Elem()
}
func (o AddressBandwidthArrayOutput) ToAddressBandwidthArrayOutput() AddressBandwidthArrayOutput {
return o
}
func (o AddressBandwidthArrayOutput) ToAddressBandwidthArrayOutputWithContext(ctx context.Context) AddressBandwidthArrayOutput {
return o
}
func (o AddressBandwidthArrayOutput) Index(i pulumi.IntInput) AddressBandwidthOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AddressBandwidth {
return vs[0].([]*AddressBandwidth)[vs[1].(int)]
}).(AddressBandwidthOutput)
}
type AddressBandwidthMapOutput struct{ *pulumi.OutputState }
func (AddressBandwidthMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AddressBandwidth)(nil)).Elem()
}
func (o AddressBandwidthMapOutput) ToAddressBandwidthMapOutput() AddressBandwidthMapOutput {
return o
}
func (o AddressBandwidthMapOutput) ToAddressBandwidthMapOutputWithContext(ctx context.Context) AddressBandwidthMapOutput {
return o
}
func (o AddressBandwidthMapOutput) MapIndex(k pulumi.StringInput) AddressBandwidthOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AddressBandwidth {
return vs[0].(map[string]*AddressBandwidth)[vs[1].(string)]
}).(AddressBandwidthOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AddressBandwidthInput)(nil)).Elem(), &AddressBandwidth{})
pulumi.RegisterInputType(reflect.TypeOf((*AddressBandwidthArrayInput)(nil)).Elem(), AddressBandwidthArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AddressBandwidthMapInput)(nil)).Elem(), AddressBandwidthMap{})
pulumi.RegisterOutputType(AddressBandwidthOutput{})
pulumi.RegisterOutputType(AddressBandwidthArrayOutput{})
pulumi.RegisterOutputType(AddressBandwidthMapOutput{})
}