/
cnameRecord.go
141 lines (128 loc) · 5.45 KB
/
cnameRecord.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
// nolint: lll
package privatedns
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Enables you to manage DNS CNAME Records within Azure Private DNS.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/private_dns_cname_record.html.markdown.
type CnameRecord struct {
pulumi.CustomResourceState
// The FQDN of the DNS CNAME Record.
Fqdn pulumi.StringOutput `pulumi:"fqdn"`
// The name of the DNS CNAME Record.
Name pulumi.StringOutput `pulumi:"name"`
// The target of the CNAME.
Record pulumi.StringOutput `pulumi:"record"`
// Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
Ttl pulumi.IntOutput `pulumi:"ttl"`
// Specifies the Private DNS Zone where the resource exists. Changing this forces a new resource to be created.
ZoneName pulumi.StringOutput `pulumi:"zoneName"`
}
// NewCnameRecord registers a new resource with the given unique name, arguments, and options.
func NewCnameRecord(ctx *pulumi.Context,
name string, args *CnameRecordArgs, opts ...pulumi.ResourceOption) (*CnameRecord, error) {
if args == nil || args.Record == nil {
return nil, errors.New("missing required argument 'Record'")
}
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil || args.Ttl == nil {
return nil, errors.New("missing required argument 'Ttl'")
}
if args == nil || args.ZoneName == nil {
return nil, errors.New("missing required argument 'ZoneName'")
}
if args == nil {
args = &CnameRecordArgs{}
}
var resource CnameRecord
err := ctx.RegisterResource("azure:privatedns/cnameRecord:CnameRecord", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCnameRecord gets an existing CnameRecord 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 GetCnameRecord(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CnameRecordState, opts ...pulumi.ResourceOption) (*CnameRecord, error) {
var resource CnameRecord
err := ctx.ReadResource("azure:privatedns/cnameRecord:CnameRecord", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CnameRecord resources.
type cnameRecordState struct {
// The FQDN of the DNS CNAME Record.
Fqdn *string `pulumi:"fqdn"`
// The name of the DNS CNAME Record.
Name *string `pulumi:"name"`
// The target of the CNAME.
Record *string `pulumi:"record"`
// Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
Ttl *int `pulumi:"ttl"`
// Specifies the Private DNS Zone where the resource exists. Changing this forces a new resource to be created.
ZoneName *string `pulumi:"zoneName"`
}
type CnameRecordState struct {
// The FQDN of the DNS CNAME Record.
Fqdn pulumi.StringPtrInput
// The name of the DNS CNAME Record.
Name pulumi.StringPtrInput
// The target of the CNAME.
Record pulumi.StringPtrInput
// Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
Ttl pulumi.IntPtrInput
// Specifies the Private DNS Zone where the resource exists. Changing this forces a new resource to be created.
ZoneName pulumi.StringPtrInput
}
func (CnameRecordState) ElementType() reflect.Type {
return reflect.TypeOf((*cnameRecordState)(nil)).Elem()
}
type cnameRecordArgs struct {
// The name of the DNS CNAME Record.
Name *string `pulumi:"name"`
// The target of the CNAME.
Record string `pulumi:"record"`
// Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
Ttl int `pulumi:"ttl"`
// Specifies the Private DNS Zone where the resource exists. Changing this forces a new resource to be created.
ZoneName string `pulumi:"zoneName"`
}
// The set of arguments for constructing a CnameRecord resource.
type CnameRecordArgs struct {
// The name of the DNS CNAME Record.
Name pulumi.StringPtrInput
// The target of the CNAME.
Record pulumi.StringInput
// Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
Ttl pulumi.IntInput
// Specifies the Private DNS Zone where the resource exists. Changing this forces a new resource to be created.
ZoneName pulumi.StringInput
}
func (CnameRecordArgs) ElementType() reflect.Type {
return reflect.TypeOf((*cnameRecordArgs)(nil)).Elem()
}