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
/
resourceGroup.go
212 lines (188 loc) · 7.42 KB
/
resourceGroup.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
// *** 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 v20190801
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Resource group information.
type ResourceGroup struct {
pulumi.CustomResourceState
// The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations.
Location pulumi.StringOutput `pulumi:"location"`
// The ID of the resource that manages this resource group.
ManagedBy pulumi.StringPtrOutput `pulumi:"managedBy"`
// The name of the resource group.
Name pulumi.StringOutput `pulumi:"name"`
// The resource group properties.
Properties ResourceGroupPropertiesResponseOutput `pulumi:"properties"`
// The tags attached to the resource group.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The type of the resource group.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewResourceGroup registers a new resource with the given unique name, arguments, and options.
func NewResourceGroup(ctx *pulumi.Context,
name string, args *ResourceGroupArgs, opts ...pulumi.ResourceOption) (*ResourceGroup, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:resources/latest:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20151101:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20160201:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20160701:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20160901:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20170510:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20180201:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20180501:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20190301:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20190501:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20190510:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20190701:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20191001:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20200601:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20200801:ResourceGroup"),
},
{
Type: pulumi.String("azure-nextgen:resources/v20201001:ResourceGroup"),
},
})
opts = append(opts, aliases)
var resource ResourceGroup
err := ctx.RegisterResource("azure-nextgen:resources/v20190801:ResourceGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetResourceGroup gets an existing ResourceGroup 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 GetResourceGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ResourceGroupState, opts ...pulumi.ResourceOption) (*ResourceGroup, error) {
var resource ResourceGroup
err := ctx.ReadResource("azure-nextgen:resources/v20190801:ResourceGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ResourceGroup resources.
type resourceGroupState struct {
// The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations.
Location *string `pulumi:"location"`
// The ID of the resource that manages this resource group.
ManagedBy *string `pulumi:"managedBy"`
// The name of the resource group.
Name *string `pulumi:"name"`
// The resource group properties.
Properties *ResourceGroupPropertiesResponse `pulumi:"properties"`
// The tags attached to the resource group.
Tags map[string]string `pulumi:"tags"`
// The type of the resource group.
Type *string `pulumi:"type"`
}
type ResourceGroupState struct {
// The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations.
Location pulumi.StringPtrInput
// The ID of the resource that manages this resource group.
ManagedBy pulumi.StringPtrInput
// The name of the resource group.
Name pulumi.StringPtrInput
// The resource group properties.
Properties ResourceGroupPropertiesResponsePtrInput
// The tags attached to the resource group.
Tags pulumi.StringMapInput
// The type of the resource group.
Type pulumi.StringPtrInput
}
func (ResourceGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*resourceGroupState)(nil)).Elem()
}
type resourceGroupArgs struct {
// The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations.
Location *string `pulumi:"location"`
// The ID of the resource that manages this resource group.
ManagedBy *string `pulumi:"managedBy"`
// The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The tags attached to the resource group.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a ResourceGroup resource.
type ResourceGroupArgs struct {
// The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations.
Location pulumi.StringPtrInput
// The ID of the resource that manages this resource group.
ManagedBy pulumi.StringPtrInput
// The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
ResourceGroupName pulumi.StringInput
// The tags attached to the resource group.
Tags pulumi.StringMapInput
}
func (ResourceGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*resourceGroupArgs)(nil)).Elem()
}
type ResourceGroupInput interface {
pulumi.Input
ToResourceGroupOutput() ResourceGroupOutput
ToResourceGroupOutputWithContext(ctx context.Context) ResourceGroupOutput
}
func (*ResourceGroup) ElementType() reflect.Type {
return reflect.TypeOf((*ResourceGroup)(nil))
}
func (i *ResourceGroup) ToResourceGroupOutput() ResourceGroupOutput {
return i.ToResourceGroupOutputWithContext(context.Background())
}
func (i *ResourceGroup) ToResourceGroupOutputWithContext(ctx context.Context) ResourceGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(ResourceGroupOutput)
}
type ResourceGroupOutput struct {
*pulumi.OutputState
}
func (ResourceGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((*ResourceGroup)(nil))
}
func (o ResourceGroupOutput) ToResourceGroupOutput() ResourceGroupOutput {
return o
}
func (o ResourceGroupOutput) ToResourceGroupOutputWithContext(ctx context.Context) ResourceGroupOutput {
return o
}
func init() {
pulumi.RegisterOutputType(ResourceGroupOutput{})
}