generated from pulumi/pulumi-tf-provider-boilerplate
/
domainAttachment.go
274 lines (226 loc) · 9.05 KB
/
domainAttachment.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
// 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 dns
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/rhysmdnz/pulumi-alicloud/sdk/go/alicloud/dns"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := dns.NewDomainAttachment(ctx, "dns", &dns.DomainAttachmentArgs{
// DomainNames: pulumi.StringArray{
// pulumi.String("test111.abc"),
// pulumi.String("test222.abc"),
// },
// InstanceId: pulumi.String("dns-cn-mp91lyq9xxxx"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// DNS domain attachment can be imported using the id, e.g.
//
// ```sh
//
// $ pulumi import alicloud:dns/domainAttachment:DomainAttachment example dns-cn-v0h1ldjhxxx
//
// ```
type DomainAttachment struct {
pulumi.CustomResourceState
// The domain names bound to the DNS instance.
DomainNames pulumi.StringArrayOutput `pulumi:"domainNames"`
// The id of the DNS instance.
InstanceId pulumi.StringOutput `pulumi:"instanceId"`
}
// NewDomainAttachment registers a new resource with the given unique name, arguments, and options.
func NewDomainAttachment(ctx *pulumi.Context,
name string, args *DomainAttachmentArgs, opts ...pulumi.ResourceOption) (*DomainAttachment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DomainNames == nil {
return nil, errors.New("invalid value for required argument 'DomainNames'")
}
if args.InstanceId == nil {
return nil, errors.New("invalid value for required argument 'InstanceId'")
}
opts = pkgResourceDefaultOpts(opts)
var resource DomainAttachment
err := ctx.RegisterResource("alicloud:dns/domainAttachment:DomainAttachment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDomainAttachment gets an existing DomainAttachment 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 GetDomainAttachment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DomainAttachmentState, opts ...pulumi.ResourceOption) (*DomainAttachment, error) {
var resource DomainAttachment
err := ctx.ReadResource("alicloud:dns/domainAttachment:DomainAttachment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DomainAttachment resources.
type domainAttachmentState struct {
// The domain names bound to the DNS instance.
DomainNames []string `pulumi:"domainNames"`
// The id of the DNS instance.
InstanceId *string `pulumi:"instanceId"`
}
type DomainAttachmentState struct {
// The domain names bound to the DNS instance.
DomainNames pulumi.StringArrayInput
// The id of the DNS instance.
InstanceId pulumi.StringPtrInput
}
func (DomainAttachmentState) ElementType() reflect.Type {
return reflect.TypeOf((*domainAttachmentState)(nil)).Elem()
}
type domainAttachmentArgs struct {
// The domain names bound to the DNS instance.
DomainNames []string `pulumi:"domainNames"`
// The id of the DNS instance.
InstanceId string `pulumi:"instanceId"`
}
// The set of arguments for constructing a DomainAttachment resource.
type DomainAttachmentArgs struct {
// The domain names bound to the DNS instance.
DomainNames pulumi.StringArrayInput
// The id of the DNS instance.
InstanceId pulumi.StringInput
}
func (DomainAttachmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*domainAttachmentArgs)(nil)).Elem()
}
type DomainAttachmentInput interface {
pulumi.Input
ToDomainAttachmentOutput() DomainAttachmentOutput
ToDomainAttachmentOutputWithContext(ctx context.Context) DomainAttachmentOutput
}
func (*DomainAttachment) ElementType() reflect.Type {
return reflect.TypeOf((**DomainAttachment)(nil)).Elem()
}
func (i *DomainAttachment) ToDomainAttachmentOutput() DomainAttachmentOutput {
return i.ToDomainAttachmentOutputWithContext(context.Background())
}
func (i *DomainAttachment) ToDomainAttachmentOutputWithContext(ctx context.Context) DomainAttachmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(DomainAttachmentOutput)
}
// DomainAttachmentArrayInput is an input type that accepts DomainAttachmentArray and DomainAttachmentArrayOutput values.
// You can construct a concrete instance of `DomainAttachmentArrayInput` via:
//
// DomainAttachmentArray{ DomainAttachmentArgs{...} }
type DomainAttachmentArrayInput interface {
pulumi.Input
ToDomainAttachmentArrayOutput() DomainAttachmentArrayOutput
ToDomainAttachmentArrayOutputWithContext(context.Context) DomainAttachmentArrayOutput
}
type DomainAttachmentArray []DomainAttachmentInput
func (DomainAttachmentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DomainAttachment)(nil)).Elem()
}
func (i DomainAttachmentArray) ToDomainAttachmentArrayOutput() DomainAttachmentArrayOutput {
return i.ToDomainAttachmentArrayOutputWithContext(context.Background())
}
func (i DomainAttachmentArray) ToDomainAttachmentArrayOutputWithContext(ctx context.Context) DomainAttachmentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DomainAttachmentArrayOutput)
}
// DomainAttachmentMapInput is an input type that accepts DomainAttachmentMap and DomainAttachmentMapOutput values.
// You can construct a concrete instance of `DomainAttachmentMapInput` via:
//
// DomainAttachmentMap{ "key": DomainAttachmentArgs{...} }
type DomainAttachmentMapInput interface {
pulumi.Input
ToDomainAttachmentMapOutput() DomainAttachmentMapOutput
ToDomainAttachmentMapOutputWithContext(context.Context) DomainAttachmentMapOutput
}
type DomainAttachmentMap map[string]DomainAttachmentInput
func (DomainAttachmentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DomainAttachment)(nil)).Elem()
}
func (i DomainAttachmentMap) ToDomainAttachmentMapOutput() DomainAttachmentMapOutput {
return i.ToDomainAttachmentMapOutputWithContext(context.Background())
}
func (i DomainAttachmentMap) ToDomainAttachmentMapOutputWithContext(ctx context.Context) DomainAttachmentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DomainAttachmentMapOutput)
}
type DomainAttachmentOutput struct{ *pulumi.OutputState }
func (DomainAttachmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DomainAttachment)(nil)).Elem()
}
func (o DomainAttachmentOutput) ToDomainAttachmentOutput() DomainAttachmentOutput {
return o
}
func (o DomainAttachmentOutput) ToDomainAttachmentOutputWithContext(ctx context.Context) DomainAttachmentOutput {
return o
}
// The domain names bound to the DNS instance.
func (o DomainAttachmentOutput) DomainNames() pulumi.StringArrayOutput {
return o.ApplyT(func(v *DomainAttachment) pulumi.StringArrayOutput { return v.DomainNames }).(pulumi.StringArrayOutput)
}
// The id of the DNS instance.
func (o DomainAttachmentOutput) InstanceId() pulumi.StringOutput {
return o.ApplyT(func(v *DomainAttachment) pulumi.StringOutput { return v.InstanceId }).(pulumi.StringOutput)
}
type DomainAttachmentArrayOutput struct{ *pulumi.OutputState }
func (DomainAttachmentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DomainAttachment)(nil)).Elem()
}
func (o DomainAttachmentArrayOutput) ToDomainAttachmentArrayOutput() DomainAttachmentArrayOutput {
return o
}
func (o DomainAttachmentArrayOutput) ToDomainAttachmentArrayOutputWithContext(ctx context.Context) DomainAttachmentArrayOutput {
return o
}
func (o DomainAttachmentArrayOutput) Index(i pulumi.IntInput) DomainAttachmentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DomainAttachment {
return vs[0].([]*DomainAttachment)[vs[1].(int)]
}).(DomainAttachmentOutput)
}
type DomainAttachmentMapOutput struct{ *pulumi.OutputState }
func (DomainAttachmentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DomainAttachment)(nil)).Elem()
}
func (o DomainAttachmentMapOutput) ToDomainAttachmentMapOutput() DomainAttachmentMapOutput {
return o
}
func (o DomainAttachmentMapOutput) ToDomainAttachmentMapOutputWithContext(ctx context.Context) DomainAttachmentMapOutput {
return o
}
func (o DomainAttachmentMapOutput) MapIndex(k pulumi.StringInput) DomainAttachmentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DomainAttachment {
return vs[0].(map[string]*DomainAttachment)[vs[1].(string)]
}).(DomainAttachmentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DomainAttachmentInput)(nil)).Elem(), &DomainAttachment{})
pulumi.RegisterInputType(reflect.TypeOf((*DomainAttachmentArrayInput)(nil)).Elem(), DomainAttachmentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DomainAttachmentMapInput)(nil)).Elem(), DomainAttachmentMap{})
pulumi.RegisterOutputType(DomainAttachmentOutput{})
pulumi.RegisterOutputType(DomainAttachmentArrayOutput{})
pulumi.RegisterOutputType(DomainAttachmentMapOutput{})
}