generated from pulumi/pulumi-tf-provider-boilerplate
/
accessGroup.go
294 lines (245 loc) · 9.86 KB
/
accessGroup.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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package dfs
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a DFS Access Group resource.
//
// For information about DFS Access Group and how to use it, see [What is Access Group](https://www.alibabacloud.com/help/doc-detail/207144.htm).
//
// > **NOTE:** Available in v1.133.0+.
//
// ## Example Usage
//
// # Basic Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/rhysmdnz/pulumi-alicloud/sdk/go/alicloud/dfs"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := dfs.NewAccessGroup(ctx, "example", &dfs.AccessGroupArgs{
// AccessGroupName: pulumi.String("example_value"),
// NetworkType: pulumi.String("VPC"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// DFS Access Group can be imported using the id, e.g.
//
// ```sh
//
// $ pulumi import alicloud:dfs/accessGroup:AccessGroup example <id>
//
// ```
type AccessGroup struct {
pulumi.CustomResourceState
// The Name of Access Group.The length of `accessGroupName` does not exceed 100 bytes.
AccessGroupName pulumi.StringOutput `pulumi:"accessGroupName"`
// The Description of Access Group. The length of `description` does not exceed 100 bytes.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The NetworkType of Access Group. Valid values: `VPC`.
NetworkType pulumi.StringOutput `pulumi:"networkType"`
}
// NewAccessGroup registers a new resource with the given unique name, arguments, and options.
func NewAccessGroup(ctx *pulumi.Context,
name string, args *AccessGroupArgs, opts ...pulumi.ResourceOption) (*AccessGroup, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccessGroupName == nil {
return nil, errors.New("invalid value for required argument 'AccessGroupName'")
}
if args.NetworkType == nil {
return nil, errors.New("invalid value for required argument 'NetworkType'")
}
opts = pkgResourceDefaultOpts(opts)
var resource AccessGroup
err := ctx.RegisterResource("alicloud:dfs/accessGroup:AccessGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAccessGroup gets an existing AccessGroup 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 GetAccessGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AccessGroupState, opts ...pulumi.ResourceOption) (*AccessGroup, error) {
var resource AccessGroup
err := ctx.ReadResource("alicloud:dfs/accessGroup:AccessGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AccessGroup resources.
type accessGroupState struct {
// The Name of Access Group.The length of `accessGroupName` does not exceed 100 bytes.
AccessGroupName *string `pulumi:"accessGroupName"`
// The Description of Access Group. The length of `description` does not exceed 100 bytes.
Description *string `pulumi:"description"`
// The NetworkType of Access Group. Valid values: `VPC`.
NetworkType *string `pulumi:"networkType"`
}
type AccessGroupState struct {
// The Name of Access Group.The length of `accessGroupName` does not exceed 100 bytes.
AccessGroupName pulumi.StringPtrInput
// The Description of Access Group. The length of `description` does not exceed 100 bytes.
Description pulumi.StringPtrInput
// The NetworkType of Access Group. Valid values: `VPC`.
NetworkType pulumi.StringPtrInput
}
func (AccessGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*accessGroupState)(nil)).Elem()
}
type accessGroupArgs struct {
// The Name of Access Group.The length of `accessGroupName` does not exceed 100 bytes.
AccessGroupName string `pulumi:"accessGroupName"`
// The Description of Access Group. The length of `description` does not exceed 100 bytes.
Description *string `pulumi:"description"`
// The NetworkType of Access Group. Valid values: `VPC`.
NetworkType string `pulumi:"networkType"`
}
// The set of arguments for constructing a AccessGroup resource.
type AccessGroupArgs struct {
// The Name of Access Group.The length of `accessGroupName` does not exceed 100 bytes.
AccessGroupName pulumi.StringInput
// The Description of Access Group. The length of `description` does not exceed 100 bytes.
Description pulumi.StringPtrInput
// The NetworkType of Access Group. Valid values: `VPC`.
NetworkType pulumi.StringInput
}
func (AccessGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*accessGroupArgs)(nil)).Elem()
}
type AccessGroupInput interface {
pulumi.Input
ToAccessGroupOutput() AccessGroupOutput
ToAccessGroupOutputWithContext(ctx context.Context) AccessGroupOutput
}
func (*AccessGroup) ElementType() reflect.Type {
return reflect.TypeOf((**AccessGroup)(nil)).Elem()
}
func (i *AccessGroup) ToAccessGroupOutput() AccessGroupOutput {
return i.ToAccessGroupOutputWithContext(context.Background())
}
func (i *AccessGroup) ToAccessGroupOutputWithContext(ctx context.Context) AccessGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccessGroupOutput)
}
// AccessGroupArrayInput is an input type that accepts AccessGroupArray and AccessGroupArrayOutput values.
// You can construct a concrete instance of `AccessGroupArrayInput` via:
//
// AccessGroupArray{ AccessGroupArgs{...} }
type AccessGroupArrayInput interface {
pulumi.Input
ToAccessGroupArrayOutput() AccessGroupArrayOutput
ToAccessGroupArrayOutputWithContext(context.Context) AccessGroupArrayOutput
}
type AccessGroupArray []AccessGroupInput
func (AccessGroupArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AccessGroup)(nil)).Elem()
}
func (i AccessGroupArray) ToAccessGroupArrayOutput() AccessGroupArrayOutput {
return i.ToAccessGroupArrayOutputWithContext(context.Background())
}
func (i AccessGroupArray) ToAccessGroupArrayOutputWithContext(ctx context.Context) AccessGroupArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccessGroupArrayOutput)
}
// AccessGroupMapInput is an input type that accepts AccessGroupMap and AccessGroupMapOutput values.
// You can construct a concrete instance of `AccessGroupMapInput` via:
//
// AccessGroupMap{ "key": AccessGroupArgs{...} }
type AccessGroupMapInput interface {
pulumi.Input
ToAccessGroupMapOutput() AccessGroupMapOutput
ToAccessGroupMapOutputWithContext(context.Context) AccessGroupMapOutput
}
type AccessGroupMap map[string]AccessGroupInput
func (AccessGroupMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AccessGroup)(nil)).Elem()
}
func (i AccessGroupMap) ToAccessGroupMapOutput() AccessGroupMapOutput {
return i.ToAccessGroupMapOutputWithContext(context.Background())
}
func (i AccessGroupMap) ToAccessGroupMapOutputWithContext(ctx context.Context) AccessGroupMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccessGroupMapOutput)
}
type AccessGroupOutput struct{ *pulumi.OutputState }
func (AccessGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AccessGroup)(nil)).Elem()
}
func (o AccessGroupOutput) ToAccessGroupOutput() AccessGroupOutput {
return o
}
func (o AccessGroupOutput) ToAccessGroupOutputWithContext(ctx context.Context) AccessGroupOutput {
return o
}
// The Name of Access Group.The length of `accessGroupName` does not exceed 100 bytes.
func (o AccessGroupOutput) AccessGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *AccessGroup) pulumi.StringOutput { return v.AccessGroupName }).(pulumi.StringOutput)
}
// The Description of Access Group. The length of `description` does not exceed 100 bytes.
func (o AccessGroupOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AccessGroup) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The NetworkType of Access Group. Valid values: `VPC`.
func (o AccessGroupOutput) NetworkType() pulumi.StringOutput {
return o.ApplyT(func(v *AccessGroup) pulumi.StringOutput { return v.NetworkType }).(pulumi.StringOutput)
}
type AccessGroupArrayOutput struct{ *pulumi.OutputState }
func (AccessGroupArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AccessGroup)(nil)).Elem()
}
func (o AccessGroupArrayOutput) ToAccessGroupArrayOutput() AccessGroupArrayOutput {
return o
}
func (o AccessGroupArrayOutput) ToAccessGroupArrayOutputWithContext(ctx context.Context) AccessGroupArrayOutput {
return o
}
func (o AccessGroupArrayOutput) Index(i pulumi.IntInput) AccessGroupOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AccessGroup {
return vs[0].([]*AccessGroup)[vs[1].(int)]
}).(AccessGroupOutput)
}
type AccessGroupMapOutput struct{ *pulumi.OutputState }
func (AccessGroupMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AccessGroup)(nil)).Elem()
}
func (o AccessGroupMapOutput) ToAccessGroupMapOutput() AccessGroupMapOutput {
return o
}
func (o AccessGroupMapOutput) ToAccessGroupMapOutputWithContext(ctx context.Context) AccessGroupMapOutput {
return o
}
func (o AccessGroupMapOutput) MapIndex(k pulumi.StringInput) AccessGroupOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AccessGroup {
return vs[0].(map[string]*AccessGroup)[vs[1].(string)]
}).(AccessGroupOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AccessGroupInput)(nil)).Elem(), &AccessGroup{})
pulumi.RegisterInputType(reflect.TypeOf((*AccessGroupArrayInput)(nil)).Elem(), AccessGroupArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AccessGroupMapInput)(nil)).Elem(), AccessGroupMap{})
pulumi.RegisterOutputType(AccessGroupOutput{})
pulumi.RegisterOutputType(AccessGroupArrayOutput{})
pulumi.RegisterOutputType(AccessGroupMapOutput{})
}