generated from pulumi/pulumi-tf-provider-boilerplate
/
zone.go
389 lines (333 loc) · 19.2 KB
/
zone.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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
// 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 teo
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a resource to create a teo zone
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go/tencentcloud/Teo"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Teo.NewZone(ctx, "zone", &Teo.ZoneArgs{
// AliasZoneName: pulumi.String("teo-test"),
// Area: pulumi.String("overseas"),
// Paused: pulumi.Bool(false),
// PlanId: pulumi.String("edgeone-2kfv1h391n6w"),
// Tags: pulumi.AnyMap{
// "createdBy": pulumi.Any("terraform"),
// },
// Type: pulumi.String("partial"),
// ZoneName: pulumi.String("tf-teo.com"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// teo zone can be imported using the id, e.g.
//
// ```sh
// $ pulumi import tencentcloud:Teo/zone:Zone zone zone_id
// ```
type Zone struct {
pulumi.CustomResourceState
// Alias site identifier. Limit the input to a combination of numbers, English, - and _, within 20 characters. For details, refer to the alias site identifier. If there is no such usage scenario, leave this field empty.
AliasZoneName pulumi.StringPtrOutput `pulumi:"aliasZoneName"`
// When the `type` value is `partial` or `full`, the acceleration region of the L7 domain name. The following are the values of this parameter, and the default value is `overseas` if not filled in. When the `type` value is `noDomainAccess`, please leave this value empty. Valid values: `global`: Global availability zone; `mainland`: Chinese mainland availability zone; `overseas`: Global availability zone (excluding Chinese mainland).
Area pulumi.StringOutput `pulumi:"area"`
// NS list allocated by Tencent Cloud.
NameServers pulumi.StringArrayOutput `pulumi:"nameServers"`
// Ownership verification information. Note: This field may return null, indicating that no valid value can be obtained.
OwnershipVerifications ZoneOwnershipVerificationArrayOutput `pulumi:"ownershipVerifications"`
// Indicates whether the site is disabled.
Paused pulumi.BoolOutput `pulumi:"paused"`
// The target Plan ID to be bound. When you have an existing Plan in your account, you can fill in this parameter to directly bind the site to the Plan. If you do not have a Plan that can be bound at the moment, please go to the console to purchase a Plan to complete the site creation.
PlanId pulumi.StringOutput `pulumi:"planId"`
// Site status. Valid values: `active`: NS is switched; `pending`: NS is not switched; `moved`: NS is moved; `deactivated`: this site is blocked.
Status pulumi.StringOutput `pulumi:"status"`
// Tag description list.
Tags pulumi.MapOutput `pulumi:"tags"`
// Site access type. The value of this parameter is as follows, and the default is `partial` if not filled in. Valid values: `partial`: CNAME access; `full`: NS access; `noDomainAccess`: No domain access.
Type pulumi.StringOutput `pulumi:"type"`
// Site name. When accessing CNAME/NS, please pass the second-level domain (example.com) as the site name; when accessing without a domain name, please leave this value empty.
ZoneName pulumi.StringOutput `pulumi:"zoneName"`
}
// NewZone registers a new resource with the given unique name, arguments, and options.
func NewZone(ctx *pulumi.Context,
name string, args *ZoneArgs, opts ...pulumi.ResourceOption) (*Zone, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Area == nil {
return nil, errors.New("invalid value for required argument 'Area'")
}
if args.PlanId == nil {
return nil, errors.New("invalid value for required argument 'PlanId'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
if args.ZoneName == nil {
return nil, errors.New("invalid value for required argument 'ZoneName'")
}
opts = pkgResourceDefaultOpts(opts)
var resource Zone
err := ctx.RegisterResource("tencentcloud:Teo/zone:Zone", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetZone gets an existing Zone 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 GetZone(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ZoneState, opts ...pulumi.ResourceOption) (*Zone, error) {
var resource Zone
err := ctx.ReadResource("tencentcloud:Teo/zone:Zone", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Zone resources.
type zoneState struct {
// Alias site identifier. Limit the input to a combination of numbers, English, - and _, within 20 characters. For details, refer to the alias site identifier. If there is no such usage scenario, leave this field empty.
AliasZoneName *string `pulumi:"aliasZoneName"`
// When the `type` value is `partial` or `full`, the acceleration region of the L7 domain name. The following are the values of this parameter, and the default value is `overseas` if not filled in. When the `type` value is `noDomainAccess`, please leave this value empty. Valid values: `global`: Global availability zone; `mainland`: Chinese mainland availability zone; `overseas`: Global availability zone (excluding Chinese mainland).
Area *string `pulumi:"area"`
// NS list allocated by Tencent Cloud.
NameServers []string `pulumi:"nameServers"`
// Ownership verification information. Note: This field may return null, indicating that no valid value can be obtained.
OwnershipVerifications []ZoneOwnershipVerification `pulumi:"ownershipVerifications"`
// Indicates whether the site is disabled.
Paused *bool `pulumi:"paused"`
// The target Plan ID to be bound. When you have an existing Plan in your account, you can fill in this parameter to directly bind the site to the Plan. If you do not have a Plan that can be bound at the moment, please go to the console to purchase a Plan to complete the site creation.
PlanId *string `pulumi:"planId"`
// Site status. Valid values: `active`: NS is switched; `pending`: NS is not switched; `moved`: NS is moved; `deactivated`: this site is blocked.
Status *string `pulumi:"status"`
// Tag description list.
Tags map[string]interface{} `pulumi:"tags"`
// Site access type. The value of this parameter is as follows, and the default is `partial` if not filled in. Valid values: `partial`: CNAME access; `full`: NS access; `noDomainAccess`: No domain access.
Type *string `pulumi:"type"`
// Site name. When accessing CNAME/NS, please pass the second-level domain (example.com) as the site name; when accessing without a domain name, please leave this value empty.
ZoneName *string `pulumi:"zoneName"`
}
type ZoneState struct {
// Alias site identifier. Limit the input to a combination of numbers, English, - and _, within 20 characters. For details, refer to the alias site identifier. If there is no such usage scenario, leave this field empty.
AliasZoneName pulumi.StringPtrInput
// When the `type` value is `partial` or `full`, the acceleration region of the L7 domain name. The following are the values of this parameter, and the default value is `overseas` if not filled in. When the `type` value is `noDomainAccess`, please leave this value empty. Valid values: `global`: Global availability zone; `mainland`: Chinese mainland availability zone; `overseas`: Global availability zone (excluding Chinese mainland).
Area pulumi.StringPtrInput
// NS list allocated by Tencent Cloud.
NameServers pulumi.StringArrayInput
// Ownership verification information. Note: This field may return null, indicating that no valid value can be obtained.
OwnershipVerifications ZoneOwnershipVerificationArrayInput
// Indicates whether the site is disabled.
Paused pulumi.BoolPtrInput
// The target Plan ID to be bound. When you have an existing Plan in your account, you can fill in this parameter to directly bind the site to the Plan. If you do not have a Plan that can be bound at the moment, please go to the console to purchase a Plan to complete the site creation.
PlanId pulumi.StringPtrInput
// Site status. Valid values: `active`: NS is switched; `pending`: NS is not switched; `moved`: NS is moved; `deactivated`: this site is blocked.
Status pulumi.StringPtrInput
// Tag description list.
Tags pulumi.MapInput
// Site access type. The value of this parameter is as follows, and the default is `partial` if not filled in. Valid values: `partial`: CNAME access; `full`: NS access; `noDomainAccess`: No domain access.
Type pulumi.StringPtrInput
// Site name. When accessing CNAME/NS, please pass the second-level domain (example.com) as the site name; when accessing without a domain name, please leave this value empty.
ZoneName pulumi.StringPtrInput
}
func (ZoneState) ElementType() reflect.Type {
return reflect.TypeOf((*zoneState)(nil)).Elem()
}
type zoneArgs struct {
// Alias site identifier. Limit the input to a combination of numbers, English, - and _, within 20 characters. For details, refer to the alias site identifier. If there is no such usage scenario, leave this field empty.
AliasZoneName *string `pulumi:"aliasZoneName"`
// When the `type` value is `partial` or `full`, the acceleration region of the L7 domain name. The following are the values of this parameter, and the default value is `overseas` if not filled in. When the `type` value is `noDomainAccess`, please leave this value empty. Valid values: `global`: Global availability zone; `mainland`: Chinese mainland availability zone; `overseas`: Global availability zone (excluding Chinese mainland).
Area string `pulumi:"area"`
// Indicates whether the site is disabled.
Paused *bool `pulumi:"paused"`
// The target Plan ID to be bound. When you have an existing Plan in your account, you can fill in this parameter to directly bind the site to the Plan. If you do not have a Plan that can be bound at the moment, please go to the console to purchase a Plan to complete the site creation.
PlanId string `pulumi:"planId"`
// Tag description list.
Tags map[string]interface{} `pulumi:"tags"`
// Site access type. The value of this parameter is as follows, and the default is `partial` if not filled in. Valid values: `partial`: CNAME access; `full`: NS access; `noDomainAccess`: No domain access.
Type string `pulumi:"type"`
// Site name. When accessing CNAME/NS, please pass the second-level domain (example.com) as the site name; when accessing without a domain name, please leave this value empty.
ZoneName string `pulumi:"zoneName"`
}
// The set of arguments for constructing a Zone resource.
type ZoneArgs struct {
// Alias site identifier. Limit the input to a combination of numbers, English, - and _, within 20 characters. For details, refer to the alias site identifier. If there is no such usage scenario, leave this field empty.
AliasZoneName pulumi.StringPtrInput
// When the `type` value is `partial` or `full`, the acceleration region of the L7 domain name. The following are the values of this parameter, and the default value is `overseas` if not filled in. When the `type` value is `noDomainAccess`, please leave this value empty. Valid values: `global`: Global availability zone; `mainland`: Chinese mainland availability zone; `overseas`: Global availability zone (excluding Chinese mainland).
Area pulumi.StringInput
// Indicates whether the site is disabled.
Paused pulumi.BoolPtrInput
// The target Plan ID to be bound. When you have an existing Plan in your account, you can fill in this parameter to directly bind the site to the Plan. If you do not have a Plan that can be bound at the moment, please go to the console to purchase a Plan to complete the site creation.
PlanId pulumi.StringInput
// Tag description list.
Tags pulumi.MapInput
// Site access type. The value of this parameter is as follows, and the default is `partial` if not filled in. Valid values: `partial`: CNAME access; `full`: NS access; `noDomainAccess`: No domain access.
Type pulumi.StringInput
// Site name. When accessing CNAME/NS, please pass the second-level domain (example.com) as the site name; when accessing without a domain name, please leave this value empty.
ZoneName pulumi.StringInput
}
func (ZoneArgs) ElementType() reflect.Type {
return reflect.TypeOf((*zoneArgs)(nil)).Elem()
}
type ZoneInput interface {
pulumi.Input
ToZoneOutput() ZoneOutput
ToZoneOutputWithContext(ctx context.Context) ZoneOutput
}
func (*Zone) ElementType() reflect.Type {
return reflect.TypeOf((**Zone)(nil)).Elem()
}
func (i *Zone) ToZoneOutput() ZoneOutput {
return i.ToZoneOutputWithContext(context.Background())
}
func (i *Zone) ToZoneOutputWithContext(ctx context.Context) ZoneOutput {
return pulumi.ToOutputWithContext(ctx, i).(ZoneOutput)
}
// ZoneArrayInput is an input type that accepts ZoneArray and ZoneArrayOutput values.
// You can construct a concrete instance of `ZoneArrayInput` via:
//
// ZoneArray{ ZoneArgs{...} }
type ZoneArrayInput interface {
pulumi.Input
ToZoneArrayOutput() ZoneArrayOutput
ToZoneArrayOutputWithContext(context.Context) ZoneArrayOutput
}
type ZoneArray []ZoneInput
func (ZoneArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Zone)(nil)).Elem()
}
func (i ZoneArray) ToZoneArrayOutput() ZoneArrayOutput {
return i.ToZoneArrayOutputWithContext(context.Background())
}
func (i ZoneArray) ToZoneArrayOutputWithContext(ctx context.Context) ZoneArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ZoneArrayOutput)
}
// ZoneMapInput is an input type that accepts ZoneMap and ZoneMapOutput values.
// You can construct a concrete instance of `ZoneMapInput` via:
//
// ZoneMap{ "key": ZoneArgs{...} }
type ZoneMapInput interface {
pulumi.Input
ToZoneMapOutput() ZoneMapOutput
ToZoneMapOutputWithContext(context.Context) ZoneMapOutput
}
type ZoneMap map[string]ZoneInput
func (ZoneMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Zone)(nil)).Elem()
}
func (i ZoneMap) ToZoneMapOutput() ZoneMapOutput {
return i.ToZoneMapOutputWithContext(context.Background())
}
func (i ZoneMap) ToZoneMapOutputWithContext(ctx context.Context) ZoneMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ZoneMapOutput)
}
type ZoneOutput struct{ *pulumi.OutputState }
func (ZoneOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Zone)(nil)).Elem()
}
func (o ZoneOutput) ToZoneOutput() ZoneOutput {
return o
}
func (o ZoneOutput) ToZoneOutputWithContext(ctx context.Context) ZoneOutput {
return o
}
// Alias site identifier. Limit the input to a combination of numbers, English, - and _, within 20 characters. For details, refer to the alias site identifier. If there is no such usage scenario, leave this field empty.
func (o ZoneOutput) AliasZoneName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Zone) pulumi.StringPtrOutput { return v.AliasZoneName }).(pulumi.StringPtrOutput)
}
// When the `type` value is `partial` or `full`, the acceleration region of the L7 domain name. The following are the values of this parameter, and the default value is `overseas` if not filled in. When the `type` value is `noDomainAccess`, please leave this value empty. Valid values: `global`: Global availability zone; `mainland`: Chinese mainland availability zone; `overseas`: Global availability zone (excluding Chinese mainland).
func (o ZoneOutput) Area() pulumi.StringOutput {
return o.ApplyT(func(v *Zone) pulumi.StringOutput { return v.Area }).(pulumi.StringOutput)
}
// NS list allocated by Tencent Cloud.
func (o ZoneOutput) NameServers() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Zone) pulumi.StringArrayOutput { return v.NameServers }).(pulumi.StringArrayOutput)
}
// Ownership verification information. Note: This field may return null, indicating that no valid value can be obtained.
func (o ZoneOutput) OwnershipVerifications() ZoneOwnershipVerificationArrayOutput {
return o.ApplyT(func(v *Zone) ZoneOwnershipVerificationArrayOutput { return v.OwnershipVerifications }).(ZoneOwnershipVerificationArrayOutput)
}
// Indicates whether the site is disabled.
func (o ZoneOutput) Paused() pulumi.BoolOutput {
return o.ApplyT(func(v *Zone) pulumi.BoolOutput { return v.Paused }).(pulumi.BoolOutput)
}
// The target Plan ID to be bound. When you have an existing Plan in your account, you can fill in this parameter to directly bind the site to the Plan. If you do not have a Plan that can be bound at the moment, please go to the console to purchase a Plan to complete the site creation.
func (o ZoneOutput) PlanId() pulumi.StringOutput {
return o.ApplyT(func(v *Zone) pulumi.StringOutput { return v.PlanId }).(pulumi.StringOutput)
}
// Site status. Valid values: `active`: NS is switched; `pending`: NS is not switched; `moved`: NS is moved; `deactivated`: this site is blocked.
func (o ZoneOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v *Zone) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
}
// Tag description list.
func (o ZoneOutput) Tags() pulumi.MapOutput {
return o.ApplyT(func(v *Zone) pulumi.MapOutput { return v.Tags }).(pulumi.MapOutput)
}
// Site access type. The value of this parameter is as follows, and the default is `partial` if not filled in. Valid values: `partial`: CNAME access; `full`: NS access; `noDomainAccess`: No domain access.
func (o ZoneOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *Zone) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// Site name. When accessing CNAME/NS, please pass the second-level domain (example.com) as the site name; when accessing without a domain name, please leave this value empty.
func (o ZoneOutput) ZoneName() pulumi.StringOutput {
return o.ApplyT(func(v *Zone) pulumi.StringOutput { return v.ZoneName }).(pulumi.StringOutput)
}
type ZoneArrayOutput struct{ *pulumi.OutputState }
func (ZoneArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Zone)(nil)).Elem()
}
func (o ZoneArrayOutput) ToZoneArrayOutput() ZoneArrayOutput {
return o
}
func (o ZoneArrayOutput) ToZoneArrayOutputWithContext(ctx context.Context) ZoneArrayOutput {
return o
}
func (o ZoneArrayOutput) Index(i pulumi.IntInput) ZoneOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Zone {
return vs[0].([]*Zone)[vs[1].(int)]
}).(ZoneOutput)
}
type ZoneMapOutput struct{ *pulumi.OutputState }
func (ZoneMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Zone)(nil)).Elem()
}
func (o ZoneMapOutput) ToZoneMapOutput() ZoneMapOutput {
return o
}
func (o ZoneMapOutput) ToZoneMapOutputWithContext(ctx context.Context) ZoneMapOutput {
return o
}
func (o ZoneMapOutput) MapIndex(k pulumi.StringInput) ZoneOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Zone {
return vs[0].(map[string]*Zone)[vs[1].(string)]
}).(ZoneOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ZoneInput)(nil)).Elem(), &Zone{})
pulumi.RegisterInputType(reflect.TypeOf((*ZoneArrayInput)(nil)).Elem(), ZoneArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ZoneMapInput)(nil)).Elem(), ZoneMap{})
pulumi.RegisterOutputType(ZoneOutput{})
pulumi.RegisterOutputType(ZoneArrayOutput{})
pulumi.RegisterOutputType(ZoneMapOutput{})
}