generated from pulumi/pulumi-tf-provider-boilerplate
/
userAttachment.go
296 lines (247 loc) · 10.7 KB
/
userAttachment.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
295
296
// 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 bastionhost
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Bastion Host User Attachment resource to add user to one user group.
//
// > **NOTE:** Available in v1.134.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/bastionhost"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := bastionhost.NewUserAttachment(ctx, "example", &bastionhost.UserAttachmentArgs{
// InstanceId: pulumi.String("bastionhost-cn-tl3xxxxxxx"),
// UserGroupId: pulumi.String("10"),
// UserId: pulumi.String("100"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Bastion Host User Attachment can be imported using the id, e.g.
//
// ```sh
//
// $ pulumi import alicloud:bastionhost/userAttachment:UserAttachment example <instance_id>:<user_group_id>:<user_id>
//
// ```
type UserAttachment struct {
pulumi.CustomResourceState
// Specifies the user group to add the user's bastion host ID of.
InstanceId pulumi.StringOutput `pulumi:"instanceId"`
// Specifies the user group to which you want to add the user ID.
UserGroupId pulumi.StringOutput `pulumi:"userGroupId"`
// Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.
UserId pulumi.StringOutput `pulumi:"userId"`
}
// NewUserAttachment registers a new resource with the given unique name, arguments, and options.
func NewUserAttachment(ctx *pulumi.Context,
name string, args *UserAttachmentArgs, opts ...pulumi.ResourceOption) (*UserAttachment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.InstanceId == nil {
return nil, errors.New("invalid value for required argument 'InstanceId'")
}
if args.UserGroupId == nil {
return nil, errors.New("invalid value for required argument 'UserGroupId'")
}
if args.UserId == nil {
return nil, errors.New("invalid value for required argument 'UserId'")
}
opts = pkgResourceDefaultOpts(opts)
var resource UserAttachment
err := ctx.RegisterResource("alicloud:bastionhost/userAttachment:UserAttachment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetUserAttachment gets an existing UserAttachment 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 GetUserAttachment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *UserAttachmentState, opts ...pulumi.ResourceOption) (*UserAttachment, error) {
var resource UserAttachment
err := ctx.ReadResource("alicloud:bastionhost/userAttachment:UserAttachment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering UserAttachment resources.
type userAttachmentState struct {
// Specifies the user group to add the user's bastion host ID of.
InstanceId *string `pulumi:"instanceId"`
// Specifies the user group to which you want to add the user ID.
UserGroupId *string `pulumi:"userGroupId"`
// Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.
UserId *string `pulumi:"userId"`
}
type UserAttachmentState struct {
// Specifies the user group to add the user's bastion host ID of.
InstanceId pulumi.StringPtrInput
// Specifies the user group to which you want to add the user ID.
UserGroupId pulumi.StringPtrInput
// Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.
UserId pulumi.StringPtrInput
}
func (UserAttachmentState) ElementType() reflect.Type {
return reflect.TypeOf((*userAttachmentState)(nil)).Elem()
}
type userAttachmentArgs struct {
// Specifies the user group to add the user's bastion host ID of.
InstanceId string `pulumi:"instanceId"`
// Specifies the user group to which you want to add the user ID.
UserGroupId string `pulumi:"userGroupId"`
// Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.
UserId string `pulumi:"userId"`
}
// The set of arguments for constructing a UserAttachment resource.
type UserAttachmentArgs struct {
// Specifies the user group to add the user's bastion host ID of.
InstanceId pulumi.StringInput
// Specifies the user group to which you want to add the user ID.
UserGroupId pulumi.StringInput
// Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.
UserId pulumi.StringInput
}
func (UserAttachmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*userAttachmentArgs)(nil)).Elem()
}
type UserAttachmentInput interface {
pulumi.Input
ToUserAttachmentOutput() UserAttachmentOutput
ToUserAttachmentOutputWithContext(ctx context.Context) UserAttachmentOutput
}
func (*UserAttachment) ElementType() reflect.Type {
return reflect.TypeOf((**UserAttachment)(nil)).Elem()
}
func (i *UserAttachment) ToUserAttachmentOutput() UserAttachmentOutput {
return i.ToUserAttachmentOutputWithContext(context.Background())
}
func (i *UserAttachment) ToUserAttachmentOutputWithContext(ctx context.Context) UserAttachmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserAttachmentOutput)
}
// UserAttachmentArrayInput is an input type that accepts UserAttachmentArray and UserAttachmentArrayOutput values.
// You can construct a concrete instance of `UserAttachmentArrayInput` via:
//
// UserAttachmentArray{ UserAttachmentArgs{...} }
type UserAttachmentArrayInput interface {
pulumi.Input
ToUserAttachmentArrayOutput() UserAttachmentArrayOutput
ToUserAttachmentArrayOutputWithContext(context.Context) UserAttachmentArrayOutput
}
type UserAttachmentArray []UserAttachmentInput
func (UserAttachmentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*UserAttachment)(nil)).Elem()
}
func (i UserAttachmentArray) ToUserAttachmentArrayOutput() UserAttachmentArrayOutput {
return i.ToUserAttachmentArrayOutputWithContext(context.Background())
}
func (i UserAttachmentArray) ToUserAttachmentArrayOutputWithContext(ctx context.Context) UserAttachmentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserAttachmentArrayOutput)
}
// UserAttachmentMapInput is an input type that accepts UserAttachmentMap and UserAttachmentMapOutput values.
// You can construct a concrete instance of `UserAttachmentMapInput` via:
//
// UserAttachmentMap{ "key": UserAttachmentArgs{...} }
type UserAttachmentMapInput interface {
pulumi.Input
ToUserAttachmentMapOutput() UserAttachmentMapOutput
ToUserAttachmentMapOutputWithContext(context.Context) UserAttachmentMapOutput
}
type UserAttachmentMap map[string]UserAttachmentInput
func (UserAttachmentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*UserAttachment)(nil)).Elem()
}
func (i UserAttachmentMap) ToUserAttachmentMapOutput() UserAttachmentMapOutput {
return i.ToUserAttachmentMapOutputWithContext(context.Background())
}
func (i UserAttachmentMap) ToUserAttachmentMapOutputWithContext(ctx context.Context) UserAttachmentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserAttachmentMapOutput)
}
type UserAttachmentOutput struct{ *pulumi.OutputState }
func (UserAttachmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**UserAttachment)(nil)).Elem()
}
func (o UserAttachmentOutput) ToUserAttachmentOutput() UserAttachmentOutput {
return o
}
func (o UserAttachmentOutput) ToUserAttachmentOutputWithContext(ctx context.Context) UserAttachmentOutput {
return o
}
// Specifies the user group to add the user's bastion host ID of.
func (o UserAttachmentOutput) InstanceId() pulumi.StringOutput {
return o.ApplyT(func(v *UserAttachment) pulumi.StringOutput { return v.InstanceId }).(pulumi.StringOutput)
}
// Specifies the user group to which you want to add the user ID.
func (o UserAttachmentOutput) UserGroupId() pulumi.StringOutput {
return o.ApplyT(func(v *UserAttachment) pulumi.StringOutput { return v.UserGroupId }).(pulumi.StringOutput)
}
// Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.
func (o UserAttachmentOutput) UserId() pulumi.StringOutput {
return o.ApplyT(func(v *UserAttachment) pulumi.StringOutput { return v.UserId }).(pulumi.StringOutput)
}
type UserAttachmentArrayOutput struct{ *pulumi.OutputState }
func (UserAttachmentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*UserAttachment)(nil)).Elem()
}
func (o UserAttachmentArrayOutput) ToUserAttachmentArrayOutput() UserAttachmentArrayOutput {
return o
}
func (o UserAttachmentArrayOutput) ToUserAttachmentArrayOutputWithContext(ctx context.Context) UserAttachmentArrayOutput {
return o
}
func (o UserAttachmentArrayOutput) Index(i pulumi.IntInput) UserAttachmentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *UserAttachment {
return vs[0].([]*UserAttachment)[vs[1].(int)]
}).(UserAttachmentOutput)
}
type UserAttachmentMapOutput struct{ *pulumi.OutputState }
func (UserAttachmentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*UserAttachment)(nil)).Elem()
}
func (o UserAttachmentMapOutput) ToUserAttachmentMapOutput() UserAttachmentMapOutput {
return o
}
func (o UserAttachmentMapOutput) ToUserAttachmentMapOutputWithContext(ctx context.Context) UserAttachmentMapOutput {
return o
}
func (o UserAttachmentMapOutput) MapIndex(k pulumi.StringInput) UserAttachmentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *UserAttachment {
return vs[0].(map[string]*UserAttachment)[vs[1].(string)]
}).(UserAttachmentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*UserAttachmentInput)(nil)).Elem(), &UserAttachment{})
pulumi.RegisterInputType(reflect.TypeOf((*UserAttachmentArrayInput)(nil)).Elem(), UserAttachmentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*UserAttachmentMapInput)(nil)).Elem(), UserAttachmentMap{})
pulumi.RegisterOutputType(UserAttachmentOutput{})
pulumi.RegisterOutputType(UserAttachmentArrayOutput{})
pulumi.RegisterOutputType(UserAttachmentMapOutput{})
}