-
Notifications
You must be signed in to change notification settings - Fork 51
/
aRecord.go
141 lines (126 loc) · 4.57 KB
/
aRecord.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! ***
package dns
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Enables you to manage DNS A Records within Azure DNS.
type ARecord struct {
s *pulumi.ResourceState
}
// NewARecord registers a new resource with the given unique name, arguments, and options.
func NewARecord(ctx *pulumi.Context,
name string, args *ARecordArgs, opts ...pulumi.ResourceOpt) (*ARecord, error) {
if args == nil || args.Records == nil {
return nil, errors.New("missing required argument 'Records'")
}
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'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["name"] = nil
inputs["records"] = nil
inputs["resourceGroupName"] = nil
inputs["tags"] = nil
inputs["ttl"] = nil
inputs["zoneName"] = nil
} else {
inputs["name"] = args.Name
inputs["records"] = args.Records
inputs["resourceGroupName"] = args.ResourceGroupName
inputs["tags"] = args.Tags
inputs["ttl"] = args.Ttl
inputs["zoneName"] = args.ZoneName
}
s, err := ctx.RegisterResource("azure:dns/aRecord:ARecord", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &ARecord{s: s}, nil
}
// GetARecord gets an existing ARecord 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 GetARecord(ctx *pulumi.Context,
name string, id pulumi.ID, state *ARecordState, opts ...pulumi.ResourceOpt) (*ARecord, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["name"] = state.Name
inputs["records"] = state.Records
inputs["resourceGroupName"] = state.ResourceGroupName
inputs["tags"] = state.Tags
inputs["ttl"] = state.Ttl
inputs["zoneName"] = state.ZoneName
}
s, err := ctx.ReadResource("azure:dns/aRecord:ARecord", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &ARecord{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *ARecord) URN() *pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *ARecord) ID() *pulumi.IDOutput {
return r.s.ID()
}
// The name of the DNS A Record.
func (r *ARecord) Name() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["name"])
}
// List of IPv4 Addresses.
func (r *ARecord) Records() *pulumi.ArrayOutput {
return (*pulumi.ArrayOutput)(r.s.State["records"])
}
// Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
func (r *ARecord) ResourceGroupName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["resourceGroupName"])
}
// A mapping of tags to assign to the resource.
func (r *ARecord) Tags() *pulumi.MapOutput {
return (*pulumi.MapOutput)(r.s.State["tags"])
}
func (r *ARecord) Ttl() *pulumi.IntOutput {
return (*pulumi.IntOutput)(r.s.State["ttl"])
}
// Specifies the DNS Zone where the resource exists. Changing this forces a new resource to be created.
func (r *ARecord) ZoneName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["zoneName"])
}
// Input properties used for looking up and filtering ARecord resources.
type ARecordState struct {
// The name of the DNS A Record.
Name interface{}
// List of IPv4 Addresses.
Records interface{}
// Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
ResourceGroupName interface{}
// A mapping of tags to assign to the resource.
Tags interface{}
Ttl interface{}
// Specifies the DNS Zone where the resource exists. Changing this forces a new resource to be created.
ZoneName interface{}
}
// The set of arguments for constructing a ARecord resource.
type ARecordArgs struct {
// The name of the DNS A Record.
Name interface{}
// List of IPv4 Addresses.
Records interface{}
// Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
ResourceGroupName interface{}
// A mapping of tags to assign to the resource.
Tags interface{}
Ttl interface{}
// Specifies the DNS Zone where the resource exists. Changing this forces a new resource to be created.
ZoneName interface{}
}