This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
dedicatedHostGroup.go
215 lines (191 loc) · 10.5 KB
/
dedicatedHostGroup.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
// *** 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"
)
// Specifies information about the dedicated host group that the dedicated hosts should be assigned to. <br><br> Currently, a dedicated host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another dedicated host group.
type DedicatedHostGroup struct {
pulumi.CustomResourceState
// A list of references to all dedicated hosts in the dedicated host group.
Hosts SubResourceReadOnlyResponseArrayOutput `pulumi:"hosts"`
// The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the dedicated host group.
InstanceView DedicatedHostGroupInstanceViewResponseOutput `pulumi:"instanceView"`
// Resource location
Location pulumi.StringOutput `pulumi:"location"`
// Resource name
Name pulumi.StringOutput `pulumi:"name"`
// Number of fault domains that the host group can span.
PlatformFaultDomainCount pulumi.IntOutput `pulumi:"platformFaultDomainCount"`
// Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. <br><br>Minimum api-version: 2020-06-01.
SupportAutomaticPlacement pulumi.BoolPtrOutput `pulumi:"supportAutomaticPlacement"`
// Resource tags
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Resource type
Type pulumi.StringOutput `pulumi:"type"`
// Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone.
Zones pulumi.StringArrayOutput `pulumi:"zones"`
}
// NewDedicatedHostGroup registers a new resource with the given unique name, arguments, and options.
func NewDedicatedHostGroup(ctx *pulumi.Context,
name string, args *DedicatedHostGroupArgs, opts ...pulumi.ResourceOption) (*DedicatedHostGroup, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.HostGroupName == nil {
return nil, errors.New("invalid value for required argument 'HostGroupName'")
}
if args.PlatformFaultDomainCount == nil {
return nil, errors.New("invalid value for required argument 'PlatformFaultDomainCount'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:compute/latest:DedicatedHostGroup"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20190301:DedicatedHostGroup"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20190701:DedicatedHostGroup"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20191201:DedicatedHostGroup"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20201201:DedicatedHostGroup"),
},
})
opts = append(opts, aliases)
var resource DedicatedHostGroup
err := ctx.RegisterResource("azure-nextgen:compute/v20200601:DedicatedHostGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDedicatedHostGroup gets an existing DedicatedHostGroup 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 GetDedicatedHostGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DedicatedHostGroupState, opts ...pulumi.ResourceOption) (*DedicatedHostGroup, error) {
var resource DedicatedHostGroup
err := ctx.ReadResource("azure-nextgen:compute/v20200601:DedicatedHostGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DedicatedHostGroup resources.
type dedicatedHostGroupState struct {
// A list of references to all dedicated hosts in the dedicated host group.
Hosts []SubResourceReadOnlyResponse `pulumi:"hosts"`
// The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the dedicated host group.
InstanceView *DedicatedHostGroupInstanceViewResponse `pulumi:"instanceView"`
// Resource location
Location *string `pulumi:"location"`
// Resource name
Name *string `pulumi:"name"`
// Number of fault domains that the host group can span.
PlatformFaultDomainCount *int `pulumi:"platformFaultDomainCount"`
// Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. <br><br>Minimum api-version: 2020-06-01.
SupportAutomaticPlacement *bool `pulumi:"supportAutomaticPlacement"`
// Resource tags
Tags map[string]string `pulumi:"tags"`
// Resource type
Type *string `pulumi:"type"`
// Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone.
Zones []string `pulumi:"zones"`
}
type DedicatedHostGroupState struct {
// A list of references to all dedicated hosts in the dedicated host group.
Hosts SubResourceReadOnlyResponseArrayInput
// The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the dedicated host group.
InstanceView DedicatedHostGroupInstanceViewResponsePtrInput
// Resource location
Location pulumi.StringPtrInput
// Resource name
Name pulumi.StringPtrInput
// Number of fault domains that the host group can span.
PlatformFaultDomainCount pulumi.IntPtrInput
// Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. <br><br>Minimum api-version: 2020-06-01.
SupportAutomaticPlacement pulumi.BoolPtrInput
// Resource tags
Tags pulumi.StringMapInput
// Resource type
Type pulumi.StringPtrInput
// Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone.
Zones pulumi.StringArrayInput
}
func (DedicatedHostGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*dedicatedHostGroupState)(nil)).Elem()
}
type dedicatedHostGroupArgs struct {
// The name of the dedicated host group.
HostGroupName string `pulumi:"hostGroupName"`
// Resource location
Location *string `pulumi:"location"`
// Number of fault domains that the host group can span.
PlatformFaultDomainCount int `pulumi:"platformFaultDomainCount"`
// The name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. <br><br>Minimum api-version: 2020-06-01.
SupportAutomaticPlacement *bool `pulumi:"supportAutomaticPlacement"`
// Resource tags
Tags map[string]string `pulumi:"tags"`
// Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone.
Zones []string `pulumi:"zones"`
}
// The set of arguments for constructing a DedicatedHostGroup resource.
type DedicatedHostGroupArgs struct {
// The name of the dedicated host group.
HostGroupName pulumi.StringInput
// Resource location
Location pulumi.StringPtrInput
// Number of fault domains that the host group can span.
PlatformFaultDomainCount pulumi.IntInput
// The name of the resource group.
ResourceGroupName pulumi.StringInput
// Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. <br><br>Minimum api-version: 2020-06-01.
SupportAutomaticPlacement pulumi.BoolPtrInput
// Resource tags
Tags pulumi.StringMapInput
// Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone.
Zones pulumi.StringArrayInput
}
func (DedicatedHostGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*dedicatedHostGroupArgs)(nil)).Elem()
}
type DedicatedHostGroupInput interface {
pulumi.Input
ToDedicatedHostGroupOutput() DedicatedHostGroupOutput
ToDedicatedHostGroupOutputWithContext(ctx context.Context) DedicatedHostGroupOutput
}
func (*DedicatedHostGroup) ElementType() reflect.Type {
return reflect.TypeOf((*DedicatedHostGroup)(nil))
}
func (i *DedicatedHostGroup) ToDedicatedHostGroupOutput() DedicatedHostGroupOutput {
return i.ToDedicatedHostGroupOutputWithContext(context.Background())
}
func (i *DedicatedHostGroup) ToDedicatedHostGroupOutputWithContext(ctx context.Context) DedicatedHostGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(DedicatedHostGroupOutput)
}
type DedicatedHostGroupOutput struct {
*pulumi.OutputState
}
func (DedicatedHostGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((*DedicatedHostGroup)(nil))
}
func (o DedicatedHostGroupOutput) ToDedicatedHostGroupOutput() DedicatedHostGroupOutput {
return o
}
func (o DedicatedHostGroupOutput) ToDedicatedHostGroupOutputWithContext(ctx context.Context) DedicatedHostGroupOutput {
return o
}
func init() {
pulumi.RegisterOutputType(DedicatedHostGroupOutput{})
}