This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
managementGroup.go
188 lines (164 loc) · 6.88 KB
/
managementGroup.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
// *** 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 v20180301preview
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// The management group details.
type ManagementGroup struct {
pulumi.CustomResourceState
// The list of children.
Children ManagementGroupChildInfoResponseArrayOutput `pulumi:"children"`
// The details of a management group.
Details ManagementGroupDetailsResponsePtrOutput `pulumi:"details"`
// The friendly name of the management group.
DisplayName pulumi.StringPtrOutput `pulumi:"displayName"`
// The name of the management group. For example, 00000000-0000-0000-0000-000000000000
Name pulumi.StringOutput `pulumi:"name"`
// The role definitions associated with the management group.
Roles pulumi.StringArrayOutput `pulumi:"roles"`
// The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000
TenantId pulumi.StringPtrOutput `pulumi:"tenantId"`
// The type of the resource. For example, /providers/Microsoft.Management/managementGroups
Type pulumi.StringOutput `pulumi:"type"`
}
// NewManagementGroup registers a new resource with the given unique name, arguments, and options.
func NewManagementGroup(ctx *pulumi.Context,
name string, args *ManagementGroupArgs, opts ...pulumi.ResourceOption) (*ManagementGroup, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.GroupId == nil {
return nil, errors.New("invalid value for required argument 'GroupId'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:management/latest:ManagementGroup"),
},
{
Type: pulumi.String("azure-nextgen:management/v20171101preview:ManagementGroup"),
},
{
Type: pulumi.String("azure-nextgen:management/v20180101preview:ManagementGroup"),
},
{
Type: pulumi.String("azure-nextgen:management/v20191101:ManagementGroup"),
},
{
Type: pulumi.String("azure-nextgen:management/v20200201:ManagementGroup"),
},
{
Type: pulumi.String("azure-nextgen:management/v20200501:ManagementGroup"),
},
})
opts = append(opts, aliases)
var resource ManagementGroup
err := ctx.RegisterResource("azure-nextgen:management/v20180301preview:ManagementGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetManagementGroup gets an existing ManagementGroup 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 GetManagementGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ManagementGroupState, opts ...pulumi.ResourceOption) (*ManagementGroup, error) {
var resource ManagementGroup
err := ctx.ReadResource("azure-nextgen:management/v20180301preview:ManagementGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ManagementGroup resources.
type managementGroupState struct {
// The list of children.
Children []ManagementGroupChildInfoResponse `pulumi:"children"`
// The details of a management group.
Details *ManagementGroupDetailsResponse `pulumi:"details"`
// The friendly name of the management group.
DisplayName *string `pulumi:"displayName"`
// The name of the management group. For example, 00000000-0000-0000-0000-000000000000
Name *string `pulumi:"name"`
// The role definitions associated with the management group.
Roles []string `pulumi:"roles"`
// The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000
TenantId *string `pulumi:"tenantId"`
// The type of the resource. For example, /providers/Microsoft.Management/managementGroups
Type *string `pulumi:"type"`
}
type ManagementGroupState struct {
// The list of children.
Children ManagementGroupChildInfoResponseArrayInput
// The details of a management group.
Details ManagementGroupDetailsResponsePtrInput
// The friendly name of the management group.
DisplayName pulumi.StringPtrInput
// The name of the management group. For example, 00000000-0000-0000-0000-000000000000
Name pulumi.StringPtrInput
// The role definitions associated with the management group.
Roles pulumi.StringArrayInput
// The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000
TenantId pulumi.StringPtrInput
// The type of the resource. For example, /providers/Microsoft.Management/managementGroups
Type pulumi.StringPtrInput
}
func (ManagementGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*managementGroupState)(nil)).Elem()
}
type managementGroupArgs struct {
// The details of a management group used during creation.
Details *CreateManagementGroupDetails `pulumi:"details"`
// The friendly name of the management group. If no value is passed then this field will be set to the groupId.
DisplayName *string `pulumi:"displayName"`
// Management Group ID.
GroupId string `pulumi:"groupId"`
// The name of the management group. For example, 00000000-0000-0000-0000-000000000000
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a ManagementGroup resource.
type ManagementGroupArgs struct {
// The details of a management group used during creation.
Details CreateManagementGroupDetailsPtrInput
// The friendly name of the management group. If no value is passed then this field will be set to the groupId.
DisplayName pulumi.StringPtrInput
// Management Group ID.
GroupId pulumi.StringInput
// The name of the management group. For example, 00000000-0000-0000-0000-000000000000
Name pulumi.StringPtrInput
}
func (ManagementGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*managementGroupArgs)(nil)).Elem()
}
type ManagementGroupInput interface {
pulumi.Input
ToManagementGroupOutput() ManagementGroupOutput
ToManagementGroupOutputWithContext(ctx context.Context) ManagementGroupOutput
}
func (*ManagementGroup) ElementType() reflect.Type {
return reflect.TypeOf((*ManagementGroup)(nil))
}
func (i *ManagementGroup) ToManagementGroupOutput() ManagementGroupOutput {
return i.ToManagementGroupOutputWithContext(context.Background())
}
func (i *ManagementGroup) ToManagementGroupOutputWithContext(ctx context.Context) ManagementGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(ManagementGroupOutput)
}
type ManagementGroupOutput struct {
*pulumi.OutputState
}
func (ManagementGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((*ManagementGroup)(nil))
}
func (o ManagementGroupOutput) ToManagementGroupOutput() ManagementGroupOutput {
return o
}
func (o ManagementGroupOutput) ToManagementGroupOutputWithContext(ctx context.Context) ManagementGroupOutput {
return o
}
func init() {
pulumi.RegisterOutputType(ManagementGroupOutput{})
}