generated from pulumi/pulumi-tf-provider-boilerplate
/
domainNew.go
379 lines (325 loc) · 15.7 KB
/
domainNew.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
// 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 cdn
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a CDN Accelerated Domain resource. This resource is based on CDN's new version OpenAPI.
//
// For information about Cdn Domain New and how to use it, see [Add a domain](https://www.alibabacloud.com/help/doc-detail/91176.html).
//
// > **NOTE:** Available in v1.34.0+.
//
// ## Example Usage
//
// # Basic Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-alicloud/sdk/go/alicloud/cdn"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/rhysmdnz/pulumi-alicloud/sdk/go/alicloud/cdn"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := cdn.NewDomainNew(ctx, "domain", &cdn.DomainNewArgs{
// CdnType: pulumi.String("web"),
// DomainName: pulumi.String("terraform.test.com"),
// Scope: pulumi.String("overseas"),
// Sources: cdn.DomainNewSourceArray{
// &cdn.DomainNewSourceArgs{
// Content: pulumi.String("1.1.1.1"),
// Port: pulumi.Int(80),
// Priority: pulumi.Int(20),
// Type: pulumi.String("ipaddr"),
// Weight: pulumi.Int(10),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// CDN domain can be imported using the id, e.g.
//
// ```sh
//
// $ pulumi import alicloud:cdn/domainNew:DomainNew example xxxx.com
//
// ```
type DomainNew struct {
pulumi.CustomResourceState
// Cdn type of the accelerated domain. Valid values are `web`, `download`, `video`.
CdnType pulumi.StringOutput `pulumi:"cdnType"`
// Certificate config of the accelerated domain. It's a list and consist of at most 1 item.
CertificateConfig DomainNewCertificateConfigOutput `pulumi:"certificateConfig"`
// (Available in v1.90.0+) The CNAME of the CDN domain.
Cname pulumi.StringOutput `pulumi:"cname"`
// Name of the accelerated domain. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix `.sh` and `.tel` are not supported.
DomainName pulumi.StringOutput `pulumi:"domainName"`
// Resource group ID.
ResourceGroupId pulumi.StringOutput `pulumi:"resourceGroupId"`
// Scope of the accelerated domain. Valid values are `domestic`, `overseas`, `global`. Default value is `domestic`. This parameter's setting is valid Only for the international users and domestic L3 and above users .
Scope pulumi.StringOutput `pulumi:"scope"`
// The source address list of the accelerated domain. Defaults to null. See Block Sources.
Sources DomainNewSourceArrayOutput `pulumi:"sources"`
// A mapping of tags to assign to the resource.
Tags pulumi.MapOutput `pulumi:"tags"`
}
// NewDomainNew registers a new resource with the given unique name, arguments, and options.
func NewDomainNew(ctx *pulumi.Context,
name string, args *DomainNewArgs, opts ...pulumi.ResourceOption) (*DomainNew, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CdnType == nil {
return nil, errors.New("invalid value for required argument 'CdnType'")
}
if args.DomainName == nil {
return nil, errors.New("invalid value for required argument 'DomainName'")
}
if args.Sources == nil {
return nil, errors.New("invalid value for required argument 'Sources'")
}
opts = pkgResourceDefaultOpts(opts)
var resource DomainNew
err := ctx.RegisterResource("alicloud:cdn/domainNew:DomainNew", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDomainNew gets an existing DomainNew 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 GetDomainNew(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DomainNewState, opts ...pulumi.ResourceOption) (*DomainNew, error) {
var resource DomainNew
err := ctx.ReadResource("alicloud:cdn/domainNew:DomainNew", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DomainNew resources.
type domainNewState struct {
// Cdn type of the accelerated domain. Valid values are `web`, `download`, `video`.
CdnType *string `pulumi:"cdnType"`
// Certificate config of the accelerated domain. It's a list and consist of at most 1 item.
CertificateConfig *DomainNewCertificateConfig `pulumi:"certificateConfig"`
// (Available in v1.90.0+) The CNAME of the CDN domain.
Cname *string `pulumi:"cname"`
// Name of the accelerated domain. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix `.sh` and `.tel` are not supported.
DomainName *string `pulumi:"domainName"`
// Resource group ID.
ResourceGroupId *string `pulumi:"resourceGroupId"`
// Scope of the accelerated domain. Valid values are `domestic`, `overseas`, `global`. Default value is `domestic`. This parameter's setting is valid Only for the international users and domestic L3 and above users .
Scope *string `pulumi:"scope"`
// The source address list of the accelerated domain. Defaults to null. See Block Sources.
Sources []DomainNewSource `pulumi:"sources"`
// A mapping of tags to assign to the resource.
Tags map[string]interface{} `pulumi:"tags"`
}
type DomainNewState struct {
// Cdn type of the accelerated domain. Valid values are `web`, `download`, `video`.
CdnType pulumi.StringPtrInput
// Certificate config of the accelerated domain. It's a list and consist of at most 1 item.
CertificateConfig DomainNewCertificateConfigPtrInput
// (Available in v1.90.0+) The CNAME of the CDN domain.
Cname pulumi.StringPtrInput
// Name of the accelerated domain. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix `.sh` and `.tel` are not supported.
DomainName pulumi.StringPtrInput
// Resource group ID.
ResourceGroupId pulumi.StringPtrInput
// Scope of the accelerated domain. Valid values are `domestic`, `overseas`, `global`. Default value is `domestic`. This parameter's setting is valid Only for the international users and domestic L3 and above users .
Scope pulumi.StringPtrInput
// The source address list of the accelerated domain. Defaults to null. See Block Sources.
Sources DomainNewSourceArrayInput
// A mapping of tags to assign to the resource.
Tags pulumi.MapInput
}
func (DomainNewState) ElementType() reflect.Type {
return reflect.TypeOf((*domainNewState)(nil)).Elem()
}
type domainNewArgs struct {
// Cdn type of the accelerated domain. Valid values are `web`, `download`, `video`.
CdnType string `pulumi:"cdnType"`
// Certificate config of the accelerated domain. It's a list and consist of at most 1 item.
CertificateConfig *DomainNewCertificateConfig `pulumi:"certificateConfig"`
// Name of the accelerated domain. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix `.sh` and `.tel` are not supported.
DomainName string `pulumi:"domainName"`
// Resource group ID.
ResourceGroupId *string `pulumi:"resourceGroupId"`
// Scope of the accelerated domain. Valid values are `domestic`, `overseas`, `global`. Default value is `domestic`. This parameter's setting is valid Only for the international users and domestic L3 and above users .
Scope *string `pulumi:"scope"`
// The source address list of the accelerated domain. Defaults to null. See Block Sources.
Sources []DomainNewSource `pulumi:"sources"`
// A mapping of tags to assign to the resource.
Tags map[string]interface{} `pulumi:"tags"`
}
// The set of arguments for constructing a DomainNew resource.
type DomainNewArgs struct {
// Cdn type of the accelerated domain. Valid values are `web`, `download`, `video`.
CdnType pulumi.StringInput
// Certificate config of the accelerated domain. It's a list and consist of at most 1 item.
CertificateConfig DomainNewCertificateConfigPtrInput
// Name of the accelerated domain. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix `.sh` and `.tel` are not supported.
DomainName pulumi.StringInput
// Resource group ID.
ResourceGroupId pulumi.StringPtrInput
// Scope of the accelerated domain. Valid values are `domestic`, `overseas`, `global`. Default value is `domestic`. This parameter's setting is valid Only for the international users and domestic L3 and above users .
Scope pulumi.StringPtrInput
// The source address list of the accelerated domain. Defaults to null. See Block Sources.
Sources DomainNewSourceArrayInput
// A mapping of tags to assign to the resource.
Tags pulumi.MapInput
}
func (DomainNewArgs) ElementType() reflect.Type {
return reflect.TypeOf((*domainNewArgs)(nil)).Elem()
}
type DomainNewInput interface {
pulumi.Input
ToDomainNewOutput() DomainNewOutput
ToDomainNewOutputWithContext(ctx context.Context) DomainNewOutput
}
func (*DomainNew) ElementType() reflect.Type {
return reflect.TypeOf((**DomainNew)(nil)).Elem()
}
func (i *DomainNew) ToDomainNewOutput() DomainNewOutput {
return i.ToDomainNewOutputWithContext(context.Background())
}
func (i *DomainNew) ToDomainNewOutputWithContext(ctx context.Context) DomainNewOutput {
return pulumi.ToOutputWithContext(ctx, i).(DomainNewOutput)
}
// DomainNewArrayInput is an input type that accepts DomainNewArray and DomainNewArrayOutput values.
// You can construct a concrete instance of `DomainNewArrayInput` via:
//
// DomainNewArray{ DomainNewArgs{...} }
type DomainNewArrayInput interface {
pulumi.Input
ToDomainNewArrayOutput() DomainNewArrayOutput
ToDomainNewArrayOutputWithContext(context.Context) DomainNewArrayOutput
}
type DomainNewArray []DomainNewInput
func (DomainNewArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DomainNew)(nil)).Elem()
}
func (i DomainNewArray) ToDomainNewArrayOutput() DomainNewArrayOutput {
return i.ToDomainNewArrayOutputWithContext(context.Background())
}
func (i DomainNewArray) ToDomainNewArrayOutputWithContext(ctx context.Context) DomainNewArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DomainNewArrayOutput)
}
// DomainNewMapInput is an input type that accepts DomainNewMap and DomainNewMapOutput values.
// You can construct a concrete instance of `DomainNewMapInput` via:
//
// DomainNewMap{ "key": DomainNewArgs{...} }
type DomainNewMapInput interface {
pulumi.Input
ToDomainNewMapOutput() DomainNewMapOutput
ToDomainNewMapOutputWithContext(context.Context) DomainNewMapOutput
}
type DomainNewMap map[string]DomainNewInput
func (DomainNewMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DomainNew)(nil)).Elem()
}
func (i DomainNewMap) ToDomainNewMapOutput() DomainNewMapOutput {
return i.ToDomainNewMapOutputWithContext(context.Background())
}
func (i DomainNewMap) ToDomainNewMapOutputWithContext(ctx context.Context) DomainNewMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DomainNewMapOutput)
}
type DomainNewOutput struct{ *pulumi.OutputState }
func (DomainNewOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DomainNew)(nil)).Elem()
}
func (o DomainNewOutput) ToDomainNewOutput() DomainNewOutput {
return o
}
func (o DomainNewOutput) ToDomainNewOutputWithContext(ctx context.Context) DomainNewOutput {
return o
}
// Cdn type of the accelerated domain. Valid values are `web`, `download`, `video`.
func (o DomainNewOutput) CdnType() pulumi.StringOutput {
return o.ApplyT(func(v *DomainNew) pulumi.StringOutput { return v.CdnType }).(pulumi.StringOutput)
}
// Certificate config of the accelerated domain. It's a list and consist of at most 1 item.
func (o DomainNewOutput) CertificateConfig() DomainNewCertificateConfigOutput {
return o.ApplyT(func(v *DomainNew) DomainNewCertificateConfigOutput { return v.CertificateConfig }).(DomainNewCertificateConfigOutput)
}
// (Available in v1.90.0+) The CNAME of the CDN domain.
func (o DomainNewOutput) Cname() pulumi.StringOutput {
return o.ApplyT(func(v *DomainNew) pulumi.StringOutput { return v.Cname }).(pulumi.StringOutput)
}
// Name of the accelerated domain. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix `.sh` and `.tel` are not supported.
func (o DomainNewOutput) DomainName() pulumi.StringOutput {
return o.ApplyT(func(v *DomainNew) pulumi.StringOutput { return v.DomainName }).(pulumi.StringOutput)
}
// Resource group ID.
func (o DomainNewOutput) ResourceGroupId() pulumi.StringOutput {
return o.ApplyT(func(v *DomainNew) pulumi.StringOutput { return v.ResourceGroupId }).(pulumi.StringOutput)
}
// Scope of the accelerated domain. Valid values are `domestic`, `overseas`, `global`. Default value is `domestic`. This parameter's setting is valid Only for the international users and domestic L3 and above users .
func (o DomainNewOutput) Scope() pulumi.StringOutput {
return o.ApplyT(func(v *DomainNew) pulumi.StringOutput { return v.Scope }).(pulumi.StringOutput)
}
// The source address list of the accelerated domain. Defaults to null. See Block Sources.
func (o DomainNewOutput) Sources() DomainNewSourceArrayOutput {
return o.ApplyT(func(v *DomainNew) DomainNewSourceArrayOutput { return v.Sources }).(DomainNewSourceArrayOutput)
}
// A mapping of tags to assign to the resource.
func (o DomainNewOutput) Tags() pulumi.MapOutput {
return o.ApplyT(func(v *DomainNew) pulumi.MapOutput { return v.Tags }).(pulumi.MapOutput)
}
type DomainNewArrayOutput struct{ *pulumi.OutputState }
func (DomainNewArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DomainNew)(nil)).Elem()
}
func (o DomainNewArrayOutput) ToDomainNewArrayOutput() DomainNewArrayOutput {
return o
}
func (o DomainNewArrayOutput) ToDomainNewArrayOutputWithContext(ctx context.Context) DomainNewArrayOutput {
return o
}
func (o DomainNewArrayOutput) Index(i pulumi.IntInput) DomainNewOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DomainNew {
return vs[0].([]*DomainNew)[vs[1].(int)]
}).(DomainNewOutput)
}
type DomainNewMapOutput struct{ *pulumi.OutputState }
func (DomainNewMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DomainNew)(nil)).Elem()
}
func (o DomainNewMapOutput) ToDomainNewMapOutput() DomainNewMapOutput {
return o
}
func (o DomainNewMapOutput) ToDomainNewMapOutputWithContext(ctx context.Context) DomainNewMapOutput {
return o
}
func (o DomainNewMapOutput) MapIndex(k pulumi.StringInput) DomainNewOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DomainNew {
return vs[0].(map[string]*DomainNew)[vs[1].(string)]
}).(DomainNewOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DomainNewInput)(nil)).Elem(), &DomainNew{})
pulumi.RegisterInputType(reflect.TypeOf((*DomainNewArrayInput)(nil)).Elem(), DomainNewArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DomainNewMapInput)(nil)).Elem(), DomainNewMap{})
pulumi.RegisterOutputType(DomainNewOutput{})
pulumi.RegisterOutputType(DomainNewArrayOutput{})
pulumi.RegisterOutputType(DomainNewMapOutput{})
}