This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
generated from pulumi/pulumi-tf-provider-boilerplate
/
userPolicyAttachment.go
306 lines (253 loc) · 12.2 KB
/
userPolicyAttachment.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
297
298
299
300
301
302
303
304
305
306
// 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 cam
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type UserPolicyAttachment struct {
pulumi.CustomResourceState
// Mode of Creation of the CAM user policy attachment. `1` means the CAM policy attachment is created by production, and
// the others indicate syntax strategy ways.
CreateMode pulumi.IntOutput `pulumi:"createMode"`
// Create time of the CAM user policy attachment.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// ID of the policy.
PolicyId pulumi.StringOutput `pulumi:"policyId"`
// Name of the policy.
PolicyName pulumi.StringOutput `pulumi:"policyName"`
// Type of the policy strategy. `User` means customer strategy and `QCS` means preset strategy.
PolicyType pulumi.StringOutput `pulumi:"policyType"`
// ID of the attached CAM user.
//
// Deprecated: It has been deprecated from version 1.59.5. Use `user_name` instead.
UserId pulumi.StringPtrOutput `pulumi:"userId"`
// Name of the attached CAM user as uniq key.
UserName pulumi.StringPtrOutput `pulumi:"userName"`
}
// NewUserPolicyAttachment registers a new resource with the given unique name, arguments, and options.
func NewUserPolicyAttachment(ctx *pulumi.Context,
name string, args *UserPolicyAttachmentArgs, opts ...pulumi.ResourceOption) (*UserPolicyAttachment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.PolicyId == nil {
return nil, errors.New("invalid value for required argument 'PolicyId'")
}
var resource UserPolicyAttachment
err := ctx.RegisterResource("tctest:Cam/userPolicyAttachment:UserPolicyAttachment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetUserPolicyAttachment gets an existing UserPolicyAttachment 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 GetUserPolicyAttachment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *UserPolicyAttachmentState, opts ...pulumi.ResourceOption) (*UserPolicyAttachment, error) {
var resource UserPolicyAttachment
err := ctx.ReadResource("tctest:Cam/userPolicyAttachment:UserPolicyAttachment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering UserPolicyAttachment resources.
type userPolicyAttachmentState struct {
// Mode of Creation of the CAM user policy attachment. `1` means the CAM policy attachment is created by production, and
// the others indicate syntax strategy ways.
CreateMode *int `pulumi:"createMode"`
// Create time of the CAM user policy attachment.
CreateTime *string `pulumi:"createTime"`
// ID of the policy.
PolicyId *string `pulumi:"policyId"`
// Name of the policy.
PolicyName *string `pulumi:"policyName"`
// Type of the policy strategy. `User` means customer strategy and `QCS` means preset strategy.
PolicyType *string `pulumi:"policyType"`
// ID of the attached CAM user.
//
// Deprecated: It has been deprecated from version 1.59.5. Use `user_name` instead.
UserId *string `pulumi:"userId"`
// Name of the attached CAM user as uniq key.
UserName *string `pulumi:"userName"`
}
type UserPolicyAttachmentState struct {
// Mode of Creation of the CAM user policy attachment. `1` means the CAM policy attachment is created by production, and
// the others indicate syntax strategy ways.
CreateMode pulumi.IntPtrInput
// Create time of the CAM user policy attachment.
CreateTime pulumi.StringPtrInput
// ID of the policy.
PolicyId pulumi.StringPtrInput
// Name of the policy.
PolicyName pulumi.StringPtrInput
// Type of the policy strategy. `User` means customer strategy and `QCS` means preset strategy.
PolicyType pulumi.StringPtrInput
// ID of the attached CAM user.
//
// Deprecated: It has been deprecated from version 1.59.5. Use `user_name` instead.
UserId pulumi.StringPtrInput
// Name of the attached CAM user as uniq key.
UserName pulumi.StringPtrInput
}
func (UserPolicyAttachmentState) ElementType() reflect.Type {
return reflect.TypeOf((*userPolicyAttachmentState)(nil)).Elem()
}
type userPolicyAttachmentArgs struct {
// ID of the policy.
PolicyId string `pulumi:"policyId"`
// ID of the attached CAM user.
//
// Deprecated: It has been deprecated from version 1.59.5. Use `user_name` instead.
UserId *string `pulumi:"userId"`
// Name of the attached CAM user as uniq key.
UserName *string `pulumi:"userName"`
}
// The set of arguments for constructing a UserPolicyAttachment resource.
type UserPolicyAttachmentArgs struct {
// ID of the policy.
PolicyId pulumi.StringInput
// ID of the attached CAM user.
//
// Deprecated: It has been deprecated from version 1.59.5. Use `user_name` instead.
UserId pulumi.StringPtrInput
// Name of the attached CAM user as uniq key.
UserName pulumi.StringPtrInput
}
func (UserPolicyAttachmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*userPolicyAttachmentArgs)(nil)).Elem()
}
type UserPolicyAttachmentInput interface {
pulumi.Input
ToUserPolicyAttachmentOutput() UserPolicyAttachmentOutput
ToUserPolicyAttachmentOutputWithContext(ctx context.Context) UserPolicyAttachmentOutput
}
func (*UserPolicyAttachment) ElementType() reflect.Type {
return reflect.TypeOf((**UserPolicyAttachment)(nil)).Elem()
}
func (i *UserPolicyAttachment) ToUserPolicyAttachmentOutput() UserPolicyAttachmentOutput {
return i.ToUserPolicyAttachmentOutputWithContext(context.Background())
}
func (i *UserPolicyAttachment) ToUserPolicyAttachmentOutputWithContext(ctx context.Context) UserPolicyAttachmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserPolicyAttachmentOutput)
}
// UserPolicyAttachmentArrayInput is an input type that accepts UserPolicyAttachmentArray and UserPolicyAttachmentArrayOutput values.
// You can construct a concrete instance of `UserPolicyAttachmentArrayInput` via:
//
// UserPolicyAttachmentArray{ UserPolicyAttachmentArgs{...} }
type UserPolicyAttachmentArrayInput interface {
pulumi.Input
ToUserPolicyAttachmentArrayOutput() UserPolicyAttachmentArrayOutput
ToUserPolicyAttachmentArrayOutputWithContext(context.Context) UserPolicyAttachmentArrayOutput
}
type UserPolicyAttachmentArray []UserPolicyAttachmentInput
func (UserPolicyAttachmentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*UserPolicyAttachment)(nil)).Elem()
}
func (i UserPolicyAttachmentArray) ToUserPolicyAttachmentArrayOutput() UserPolicyAttachmentArrayOutput {
return i.ToUserPolicyAttachmentArrayOutputWithContext(context.Background())
}
func (i UserPolicyAttachmentArray) ToUserPolicyAttachmentArrayOutputWithContext(ctx context.Context) UserPolicyAttachmentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserPolicyAttachmentArrayOutput)
}
// UserPolicyAttachmentMapInput is an input type that accepts UserPolicyAttachmentMap and UserPolicyAttachmentMapOutput values.
// You can construct a concrete instance of `UserPolicyAttachmentMapInput` via:
//
// UserPolicyAttachmentMap{ "key": UserPolicyAttachmentArgs{...} }
type UserPolicyAttachmentMapInput interface {
pulumi.Input
ToUserPolicyAttachmentMapOutput() UserPolicyAttachmentMapOutput
ToUserPolicyAttachmentMapOutputWithContext(context.Context) UserPolicyAttachmentMapOutput
}
type UserPolicyAttachmentMap map[string]UserPolicyAttachmentInput
func (UserPolicyAttachmentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*UserPolicyAttachment)(nil)).Elem()
}
func (i UserPolicyAttachmentMap) ToUserPolicyAttachmentMapOutput() UserPolicyAttachmentMapOutput {
return i.ToUserPolicyAttachmentMapOutputWithContext(context.Background())
}
func (i UserPolicyAttachmentMap) ToUserPolicyAttachmentMapOutputWithContext(ctx context.Context) UserPolicyAttachmentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserPolicyAttachmentMapOutput)
}
type UserPolicyAttachmentOutput struct{ *pulumi.OutputState }
func (UserPolicyAttachmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**UserPolicyAttachment)(nil)).Elem()
}
func (o UserPolicyAttachmentOutput) ToUserPolicyAttachmentOutput() UserPolicyAttachmentOutput {
return o
}
func (o UserPolicyAttachmentOutput) ToUserPolicyAttachmentOutputWithContext(ctx context.Context) UserPolicyAttachmentOutput {
return o
}
// Mode of Creation of the CAM user policy attachment. `1` means the CAM policy attachment is created by production, and
// the others indicate syntax strategy ways.
func (o UserPolicyAttachmentOutput) CreateMode() pulumi.IntOutput {
return o.ApplyT(func(v *UserPolicyAttachment) pulumi.IntOutput { return v.CreateMode }).(pulumi.IntOutput)
}
// Create time of the CAM user policy attachment.
func (o UserPolicyAttachmentOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *UserPolicyAttachment) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// ID of the policy.
func (o UserPolicyAttachmentOutput) PolicyId() pulumi.StringOutput {
return o.ApplyT(func(v *UserPolicyAttachment) pulumi.StringOutput { return v.PolicyId }).(pulumi.StringOutput)
}
// Name of the policy.
func (o UserPolicyAttachmentOutput) PolicyName() pulumi.StringOutput {
return o.ApplyT(func(v *UserPolicyAttachment) pulumi.StringOutput { return v.PolicyName }).(pulumi.StringOutput)
}
// Type of the policy strategy. `User` means customer strategy and `QCS` means preset strategy.
func (o UserPolicyAttachmentOutput) PolicyType() pulumi.StringOutput {
return o.ApplyT(func(v *UserPolicyAttachment) pulumi.StringOutput { return v.PolicyType }).(pulumi.StringOutput)
}
// ID of the attached CAM user.
//
// Deprecated: It has been deprecated from version 1.59.5. Use `user_name` instead.
func (o UserPolicyAttachmentOutput) UserId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *UserPolicyAttachment) pulumi.StringPtrOutput { return v.UserId }).(pulumi.StringPtrOutput)
}
// Name of the attached CAM user as uniq key.
func (o UserPolicyAttachmentOutput) UserName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *UserPolicyAttachment) pulumi.StringPtrOutput { return v.UserName }).(pulumi.StringPtrOutput)
}
type UserPolicyAttachmentArrayOutput struct{ *pulumi.OutputState }
func (UserPolicyAttachmentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*UserPolicyAttachment)(nil)).Elem()
}
func (o UserPolicyAttachmentArrayOutput) ToUserPolicyAttachmentArrayOutput() UserPolicyAttachmentArrayOutput {
return o
}
func (o UserPolicyAttachmentArrayOutput) ToUserPolicyAttachmentArrayOutputWithContext(ctx context.Context) UserPolicyAttachmentArrayOutput {
return o
}
func (o UserPolicyAttachmentArrayOutput) Index(i pulumi.IntInput) UserPolicyAttachmentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *UserPolicyAttachment {
return vs[0].([]*UserPolicyAttachment)[vs[1].(int)]
}).(UserPolicyAttachmentOutput)
}
type UserPolicyAttachmentMapOutput struct{ *pulumi.OutputState }
func (UserPolicyAttachmentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*UserPolicyAttachment)(nil)).Elem()
}
func (o UserPolicyAttachmentMapOutput) ToUserPolicyAttachmentMapOutput() UserPolicyAttachmentMapOutput {
return o
}
func (o UserPolicyAttachmentMapOutput) ToUserPolicyAttachmentMapOutputWithContext(ctx context.Context) UserPolicyAttachmentMapOutput {
return o
}
func (o UserPolicyAttachmentMapOutput) MapIndex(k pulumi.StringInput) UserPolicyAttachmentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *UserPolicyAttachment {
return vs[0].(map[string]*UserPolicyAttachment)[vs[1].(string)]
}).(UserPolicyAttachmentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*UserPolicyAttachmentInput)(nil)).Elem(), &UserPolicyAttachment{})
pulumi.RegisterInputType(reflect.TypeOf((*UserPolicyAttachmentArrayInput)(nil)).Elem(), UserPolicyAttachmentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*UserPolicyAttachmentMapInput)(nil)).Elem(), UserPolicyAttachmentMap{})
pulumi.RegisterOutputType(UserPolicyAttachmentOutput{})
pulumi.RegisterOutputType(UserPolicyAttachmentArrayOutput{})
pulumi.RegisterOutputType(UserPolicyAttachmentMapOutput{})
}