-
Notifications
You must be signed in to change notification settings - Fork 50
/
availabilitySet.go
161 lines (144 loc) · 7.16 KB
/
availabilitySet.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
// *** 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 compute
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages an availability set for virtual machines.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/availability_set.html.markdown.
type AvailabilitySet struct {
s *pulumi.ResourceState
}
// NewAvailabilitySet registers a new resource with the given unique name, arguments, and options.
func NewAvailabilitySet(ctx *pulumi.Context,
name string, args *AvailabilitySetArgs, opts ...pulumi.ResourceOpt) (*AvailabilitySet, error) {
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["location"] = nil
inputs["managed"] = nil
inputs["name"] = nil
inputs["platformFaultDomainCount"] = nil
inputs["platformUpdateDomainCount"] = nil
inputs["proximityPlacementGroupId"] = nil
inputs["resourceGroupName"] = nil
inputs["tags"] = nil
} else {
inputs["location"] = args.Location
inputs["managed"] = args.Managed
inputs["name"] = args.Name
inputs["platformFaultDomainCount"] = args.PlatformFaultDomainCount
inputs["platformUpdateDomainCount"] = args.PlatformUpdateDomainCount
inputs["proximityPlacementGroupId"] = args.ProximityPlacementGroupId
inputs["resourceGroupName"] = args.ResourceGroupName
inputs["tags"] = args.Tags
}
s, err := ctx.RegisterResource("azure:compute/availabilitySet:AvailabilitySet", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &AvailabilitySet{s: s}, nil
}
// GetAvailabilitySet gets an existing AvailabilitySet 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 GetAvailabilitySet(ctx *pulumi.Context,
name string, id pulumi.ID, state *AvailabilitySetState, opts ...pulumi.ResourceOpt) (*AvailabilitySet, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["location"] = state.Location
inputs["managed"] = state.Managed
inputs["name"] = state.Name
inputs["platformFaultDomainCount"] = state.PlatformFaultDomainCount
inputs["platformUpdateDomainCount"] = state.PlatformUpdateDomainCount
inputs["proximityPlacementGroupId"] = state.ProximityPlacementGroupId
inputs["resourceGroupName"] = state.ResourceGroupName
inputs["tags"] = state.Tags
}
s, err := ctx.ReadResource("azure:compute/availabilitySet:AvailabilitySet", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &AvailabilitySet{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *AvailabilitySet) URN() *pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *AvailabilitySet) ID() *pulumi.IDOutput {
return r.s.ID()
}
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
func (r *AvailabilitySet) Location() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["location"])
}
// Specifies whether the availability set is managed or not. Possible values are `true` (to specify aligned) or `false` (to specify classic). Default is `false`.
func (r *AvailabilitySet) Managed() *pulumi.BoolOutput {
return (*pulumi.BoolOutput)(r.s.State["managed"])
}
// Specifies the name of the availability set. Changing this forces a new resource to be created.
func (r *AvailabilitySet) Name() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["name"])
}
// Specifies the number of fault domains that are used. Defaults to 3.
func (r *AvailabilitySet) PlatformFaultDomainCount() *pulumi.IntOutput {
return (*pulumi.IntOutput)(r.s.State["platformFaultDomainCount"])
}
// Specifies the number of update domains that are used. Defaults to 5.
func (r *AvailabilitySet) PlatformUpdateDomainCount() *pulumi.IntOutput {
return (*pulumi.IntOutput)(r.s.State["platformUpdateDomainCount"])
}
// The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
func (r *AvailabilitySet) ProximityPlacementGroupId() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["proximityPlacementGroupId"])
}
// The name of the resource group in which to create the availability set. Changing this forces a new resource to be created.
func (r *AvailabilitySet) ResourceGroupName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["resourceGroupName"])
}
// A mapping of tags to assign to the resource.
func (r *AvailabilitySet) Tags() *pulumi.MapOutput {
return (*pulumi.MapOutput)(r.s.State["tags"])
}
// Input properties used for looking up and filtering AvailabilitySet resources.
type AvailabilitySetState struct {
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location interface{}
// Specifies whether the availability set is managed or not. Possible values are `true` (to specify aligned) or `false` (to specify classic). Default is `false`.
Managed interface{}
// Specifies the name of the availability set. Changing this forces a new resource to be created.
Name interface{}
// Specifies the number of fault domains that are used. Defaults to 3.
PlatformFaultDomainCount interface{}
// Specifies the number of update domains that are used. Defaults to 5.
PlatformUpdateDomainCount interface{}
// The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
ProximityPlacementGroupId interface{}
// The name of the resource group in which to create the availability set. Changing this forces a new resource to be created.
ResourceGroupName interface{}
// A mapping of tags to assign to the resource.
Tags interface{}
}
// The set of arguments for constructing a AvailabilitySet resource.
type AvailabilitySetArgs struct {
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location interface{}
// Specifies whether the availability set is managed or not. Possible values are `true` (to specify aligned) or `false` (to specify classic). Default is `false`.
Managed interface{}
// Specifies the name of the availability set. Changing this forces a new resource to be created.
Name interface{}
// Specifies the number of fault domains that are used. Defaults to 3.
PlatformFaultDomainCount interface{}
// Specifies the number of update domains that are used. Defaults to 5.
PlatformUpdateDomainCount interface{}
// The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
ProximityPlacementGroupId interface{}
// The name of the resource group in which to create the availability set. Changing this forces a new resource to be created.
ResourceGroupName interface{}
// A mapping of tags to assign to the resource.
Tags interface{}
}