This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
domain.go
363 lines (339 loc) · 13 KB
/
domain.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
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20200601
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Information about a domain.
type Domain struct {
pulumi.CustomResourceState
AuthCode pulumi.StringPtrOutput `pulumi:"authCode"`
// <code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>.
AutoRenew pulumi.BoolPtrOutput `pulumi:"autoRenew"`
// Legal agreement consent.
Consent DomainPurchaseConsentResponseOutput `pulumi:"consent"`
// Administrative contact.
ContactAdmin ContactResponseOutput `pulumi:"contactAdmin"`
// Billing contact.
ContactBilling ContactResponseOutput `pulumi:"contactBilling"`
// Registrant contact.
ContactRegistrant ContactResponseOutput `pulumi:"contactRegistrant"`
// Technical contact.
ContactTech ContactResponseOutput `pulumi:"contactTech"`
// Domain creation timestamp.
CreatedTime pulumi.StringOutput `pulumi:"createdTime"`
// Current DNS type
DnsType pulumi.StringPtrOutput `pulumi:"dnsType"`
// Azure DNS Zone to use
DnsZoneId pulumi.StringPtrOutput `pulumi:"dnsZoneId"`
// Reasons why domain is not renewable.
DomainNotRenewableReasons pulumi.StringArrayOutput `pulumi:"domainNotRenewableReasons"`
// Domain expiration timestamp.
ExpirationTime pulumi.StringOutput `pulumi:"expirationTime"`
// Kind of resource.
Kind pulumi.StringPtrOutput `pulumi:"kind"`
// Timestamp when the domain was renewed last time.
LastRenewedTime pulumi.StringOutput `pulumi:"lastRenewedTime"`
// Resource Location.
Location pulumi.StringOutput `pulumi:"location"`
// All hostnames derived from the domain and assigned to Azure resources.
ManagedHostNames HostNameResponseArrayOutput `pulumi:"managedHostNames"`
// Resource Name.
Name pulumi.StringOutput `pulumi:"name"`
// Name servers.
NameServers pulumi.StringArrayOutput `pulumi:"nameServers"`
// <code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>.
Privacy pulumi.BoolPtrOutput `pulumi:"privacy"`
// Domain provisioning state.
ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"`
// <code>true</code> if Azure can assign this domain to App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if domain registration status is active and
// it is hosted on name servers Azure has programmatic access to.
ReadyForDnsRecordManagement pulumi.BoolOutput `pulumi:"readyForDnsRecordManagement"`
// Domain registration status.
RegistrationStatus pulumi.StringOutput `pulumi:"registrationStatus"`
// Resource tags.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Target DNS type (would be used for migration)
TargetDnsType pulumi.StringPtrOutput `pulumi:"targetDnsType"`
// Resource type.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewDomain registers a new resource with the given unique name, arguments, and options.
func NewDomain(ctx *pulumi.Context,
name string, args *DomainArgs, opts ...pulumi.ResourceOption) (*Domain, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Consent == nil {
return nil, errors.New("invalid value for required argument 'Consent'")
}
if args.ContactAdmin == nil {
return nil, errors.New("invalid value for required argument 'ContactAdmin'")
}
if args.ContactBilling == nil {
return nil, errors.New("invalid value for required argument 'ContactBilling'")
}
if args.ContactRegistrant == nil {
return nil, errors.New("invalid value for required argument 'ContactRegistrant'")
}
if args.ContactTech == nil {
return nil, errors.New("invalid value for required argument 'ContactTech'")
}
if args.DomainName == nil {
return nil, errors.New("invalid value for required argument 'DomainName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.AutoRenew == nil {
args.AutoRenew = pulumi.BoolPtr(true)
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:domainregistration/latest:Domain"),
},
{
Type: pulumi.String("azure-nextgen:domainregistration/v20150401:Domain"),
},
{
Type: pulumi.String("azure-nextgen:domainregistration/v20180201:Domain"),
},
{
Type: pulumi.String("azure-nextgen:domainregistration/v20190801:Domain"),
},
{
Type: pulumi.String("azure-nextgen:domainregistration/v20200901:Domain"),
},
{
Type: pulumi.String("azure-nextgen:domainregistration/v20201001:Domain"),
},
})
opts = append(opts, aliases)
var resource Domain
err := ctx.RegisterResource("azure-nextgen:domainregistration/v20200601:Domain", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDomain gets an existing Domain 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 GetDomain(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DomainState, opts ...pulumi.ResourceOption) (*Domain, error) {
var resource Domain
err := ctx.ReadResource("azure-nextgen:domainregistration/v20200601:Domain", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Domain resources.
type domainState struct {
AuthCode *string `pulumi:"authCode"`
// <code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>.
AutoRenew *bool `pulumi:"autoRenew"`
// Legal agreement consent.
Consent *DomainPurchaseConsentResponse `pulumi:"consent"`
// Administrative contact.
ContactAdmin *ContactResponse `pulumi:"contactAdmin"`
// Billing contact.
ContactBilling *ContactResponse `pulumi:"contactBilling"`
// Registrant contact.
ContactRegistrant *ContactResponse `pulumi:"contactRegistrant"`
// Technical contact.
ContactTech *ContactResponse `pulumi:"contactTech"`
// Domain creation timestamp.
CreatedTime *string `pulumi:"createdTime"`
// Current DNS type
DnsType *string `pulumi:"dnsType"`
// Azure DNS Zone to use
DnsZoneId *string `pulumi:"dnsZoneId"`
// Reasons why domain is not renewable.
DomainNotRenewableReasons []string `pulumi:"domainNotRenewableReasons"`
// Domain expiration timestamp.
ExpirationTime *string `pulumi:"expirationTime"`
// Kind of resource.
Kind *string `pulumi:"kind"`
// Timestamp when the domain was renewed last time.
LastRenewedTime *string `pulumi:"lastRenewedTime"`
// Resource Location.
Location *string `pulumi:"location"`
// All hostnames derived from the domain and assigned to Azure resources.
ManagedHostNames []HostNameResponse `pulumi:"managedHostNames"`
// Resource Name.
Name *string `pulumi:"name"`
// Name servers.
NameServers []string `pulumi:"nameServers"`
// <code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>.
Privacy *bool `pulumi:"privacy"`
// Domain provisioning state.
ProvisioningState *string `pulumi:"provisioningState"`
// <code>true</code> if Azure can assign this domain to App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if domain registration status is active and
// it is hosted on name servers Azure has programmatic access to.
ReadyForDnsRecordManagement *bool `pulumi:"readyForDnsRecordManagement"`
// Domain registration status.
RegistrationStatus *string `pulumi:"registrationStatus"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// Target DNS type (would be used for migration)
TargetDnsType *string `pulumi:"targetDnsType"`
// Resource type.
Type *string `pulumi:"type"`
}
type DomainState struct {
AuthCode pulumi.StringPtrInput
// <code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>.
AutoRenew pulumi.BoolPtrInput
// Legal agreement consent.
Consent DomainPurchaseConsentResponsePtrInput
// Administrative contact.
ContactAdmin ContactResponsePtrInput
// Billing contact.
ContactBilling ContactResponsePtrInput
// Registrant contact.
ContactRegistrant ContactResponsePtrInput
// Technical contact.
ContactTech ContactResponsePtrInput
// Domain creation timestamp.
CreatedTime pulumi.StringPtrInput
// Current DNS type
DnsType pulumi.StringPtrInput
// Azure DNS Zone to use
DnsZoneId pulumi.StringPtrInput
// Reasons why domain is not renewable.
DomainNotRenewableReasons pulumi.StringArrayInput
// Domain expiration timestamp.
ExpirationTime pulumi.StringPtrInput
// Kind of resource.
Kind pulumi.StringPtrInput
// Timestamp when the domain was renewed last time.
LastRenewedTime pulumi.StringPtrInput
// Resource Location.
Location pulumi.StringPtrInput
// All hostnames derived from the domain and assigned to Azure resources.
ManagedHostNames HostNameResponseArrayInput
// Resource Name.
Name pulumi.StringPtrInput
// Name servers.
NameServers pulumi.StringArrayInput
// <code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>.
Privacy pulumi.BoolPtrInput
// Domain provisioning state.
ProvisioningState pulumi.StringPtrInput
// <code>true</code> if Azure can assign this domain to App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if domain registration status is active and
// it is hosted on name servers Azure has programmatic access to.
ReadyForDnsRecordManagement pulumi.BoolPtrInput
// Domain registration status.
RegistrationStatus pulumi.StringPtrInput
// Resource tags.
Tags pulumi.StringMapInput
// Target DNS type (would be used for migration)
TargetDnsType pulumi.StringPtrInput
// Resource type.
Type pulumi.StringPtrInput
}
func (DomainState) ElementType() reflect.Type {
return reflect.TypeOf((*domainState)(nil)).Elem()
}
type domainArgs struct {
AuthCode *string `pulumi:"authCode"`
// <code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>.
AutoRenew *bool `pulumi:"autoRenew"`
// Legal agreement consent.
Consent DomainPurchaseConsent `pulumi:"consent"`
// Administrative contact.
ContactAdmin Contact `pulumi:"contactAdmin"`
// Billing contact.
ContactBilling Contact `pulumi:"contactBilling"`
// Registrant contact.
ContactRegistrant Contact `pulumi:"contactRegistrant"`
// Technical contact.
ContactTech Contact `pulumi:"contactTech"`
// Current DNS type
DnsType *string `pulumi:"dnsType"`
// Azure DNS Zone to use
DnsZoneId *string `pulumi:"dnsZoneId"`
// Name of the domain.
DomainName string `pulumi:"domainName"`
// Kind of resource.
Kind *string `pulumi:"kind"`
// Resource Location.
Location *string `pulumi:"location"`
// <code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>.
Privacy *bool `pulumi:"privacy"`
// Name of the resource group to which the resource belongs.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// Target DNS type (would be used for migration)
TargetDnsType *string `pulumi:"targetDnsType"`
}
// The set of arguments for constructing a Domain resource.
type DomainArgs struct {
AuthCode pulumi.StringPtrInput
// <code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>.
AutoRenew pulumi.BoolPtrInput
// Legal agreement consent.
Consent DomainPurchaseConsentInput
// Administrative contact.
ContactAdmin ContactInput
// Billing contact.
ContactBilling ContactInput
// Registrant contact.
ContactRegistrant ContactInput
// Technical contact.
ContactTech ContactInput
// Current DNS type
DnsType *DnsType
// Azure DNS Zone to use
DnsZoneId pulumi.StringPtrInput
// Name of the domain.
DomainName pulumi.StringInput
// Kind of resource.
Kind pulumi.StringPtrInput
// Resource Location.
Location pulumi.StringPtrInput
// <code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>.
Privacy pulumi.BoolPtrInput
// Name of the resource group to which the resource belongs.
ResourceGroupName pulumi.StringInput
// Resource tags.
Tags pulumi.StringMapInput
// Target DNS type (would be used for migration)
TargetDnsType *DnsType
}
func (DomainArgs) ElementType() reflect.Type {
return reflect.TypeOf((*domainArgs)(nil)).Elem()
}
type DomainInput interface {
pulumi.Input
ToDomainOutput() DomainOutput
ToDomainOutputWithContext(ctx context.Context) DomainOutput
}
func (*Domain) ElementType() reflect.Type {
return reflect.TypeOf((*Domain)(nil))
}
func (i *Domain) ToDomainOutput() DomainOutput {
return i.ToDomainOutputWithContext(context.Background())
}
func (i *Domain) ToDomainOutputWithContext(ctx context.Context) DomainOutput {
return pulumi.ToOutputWithContext(ctx, i).(DomainOutput)
}
type DomainOutput struct {
*pulumi.OutputState
}
func (DomainOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Domain)(nil))
}
func (o DomainOutput) ToDomainOutput() DomainOutput {
return o
}
func (o DomainOutput) ToDomainOutputWithContext(ctx context.Context) DomainOutput {
return o
}
func init() {
pulumi.RegisterOutputType(DomainOutput{})
}