/
managedFolderIamPolicy.go
202 lines (170 loc) · 10 KB
/
managedFolderIamPolicy.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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Updates an IAM policy for the specified managed folder.
// Note - this resource's API doesn't support deletion. When deleted, the resource will persist
// on Google Cloud even though it will be deleted from Pulumi state.
type ManagedFolderIamPolicy struct {
pulumi.CustomResourceState
// An association between a role, which comes with a set of permissions, and members who may assume that role.
Bindings ManagedFolderIamPolicyBindingsItemResponseArrayOutput `pulumi:"bindings"`
Bucket pulumi.StringOutput `pulumi:"bucket"`
// HTTP 1.1 Entity tag for the policy.
Etag pulumi.StringOutput `pulumi:"etag"`
// The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.
Kind pulumi.StringOutput `pulumi:"kind"`
ManagedFolder pulumi.StringOutput `pulumi:"managedFolder"`
// The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input.
ResourceId pulumi.StringOutput `pulumi:"resourceId"`
// The project to be billed for this request. Required for Requester Pays buckets.
UserProject pulumi.StringPtrOutput `pulumi:"userProject"`
// The IAM policy format version.
Version pulumi.IntOutput `pulumi:"version"`
}
// NewManagedFolderIamPolicy registers a new resource with the given unique name, arguments, and options.
func NewManagedFolderIamPolicy(ctx *pulumi.Context,
name string, args *ManagedFolderIamPolicyArgs, opts ...pulumi.ResourceOption) (*ManagedFolderIamPolicy, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Bucket == nil {
return nil, errors.New("invalid value for required argument 'Bucket'")
}
if args.ManagedFolder == nil {
return nil, errors.New("invalid value for required argument 'ManagedFolder'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"bucket",
"managedFolder",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource ManagedFolderIamPolicy
err := ctx.RegisterResource("google-native:storage/v1:ManagedFolderIamPolicy", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetManagedFolderIamPolicy gets an existing ManagedFolderIamPolicy 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 GetManagedFolderIamPolicy(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ManagedFolderIamPolicyState, opts ...pulumi.ResourceOption) (*ManagedFolderIamPolicy, error) {
var resource ManagedFolderIamPolicy
err := ctx.ReadResource("google-native:storage/v1:ManagedFolderIamPolicy", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ManagedFolderIamPolicy resources.
type managedFolderIamPolicyState struct {
}
type ManagedFolderIamPolicyState struct {
}
func (ManagedFolderIamPolicyState) ElementType() reflect.Type {
return reflect.TypeOf((*managedFolderIamPolicyState)(nil)).Elem()
}
type managedFolderIamPolicyArgs struct {
// An association between a role, which comes with a set of permissions, and members who may assume that role.
Bindings []ManagedFolderIamPolicyBindingsItem `pulumi:"bindings"`
Bucket string `pulumi:"bucket"`
// HTTP 1.1 Entity tag for the policy.
Etag *string `pulumi:"etag"`
// The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.
Kind *string `pulumi:"kind"`
ManagedFolder string `pulumi:"managedFolder"`
// The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input.
ResourceId *string `pulumi:"resourceId"`
// The project to be billed for this request. Required for Requester Pays buckets.
UserProject *string `pulumi:"userProject"`
// The IAM policy format version.
Version *int `pulumi:"version"`
}
// The set of arguments for constructing a ManagedFolderIamPolicy resource.
type ManagedFolderIamPolicyArgs struct {
// An association between a role, which comes with a set of permissions, and members who may assume that role.
Bindings ManagedFolderIamPolicyBindingsItemArrayInput
Bucket pulumi.StringInput
// HTTP 1.1 Entity tag for the policy.
Etag pulumi.StringPtrInput
// The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.
Kind pulumi.StringPtrInput
ManagedFolder pulumi.StringInput
// The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input.
ResourceId pulumi.StringPtrInput
// The project to be billed for this request. Required for Requester Pays buckets.
UserProject pulumi.StringPtrInput
// The IAM policy format version.
Version pulumi.IntPtrInput
}
func (ManagedFolderIamPolicyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*managedFolderIamPolicyArgs)(nil)).Elem()
}
type ManagedFolderIamPolicyInput interface {
pulumi.Input
ToManagedFolderIamPolicyOutput() ManagedFolderIamPolicyOutput
ToManagedFolderIamPolicyOutputWithContext(ctx context.Context) ManagedFolderIamPolicyOutput
}
func (*ManagedFolderIamPolicy) ElementType() reflect.Type {
return reflect.TypeOf((**ManagedFolderIamPolicy)(nil)).Elem()
}
func (i *ManagedFolderIamPolicy) ToManagedFolderIamPolicyOutput() ManagedFolderIamPolicyOutput {
return i.ToManagedFolderIamPolicyOutputWithContext(context.Background())
}
func (i *ManagedFolderIamPolicy) ToManagedFolderIamPolicyOutputWithContext(ctx context.Context) ManagedFolderIamPolicyOutput {
return pulumi.ToOutputWithContext(ctx, i).(ManagedFolderIamPolicyOutput)
}
type ManagedFolderIamPolicyOutput struct{ *pulumi.OutputState }
func (ManagedFolderIamPolicyOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ManagedFolderIamPolicy)(nil)).Elem()
}
func (o ManagedFolderIamPolicyOutput) ToManagedFolderIamPolicyOutput() ManagedFolderIamPolicyOutput {
return o
}
func (o ManagedFolderIamPolicyOutput) ToManagedFolderIamPolicyOutputWithContext(ctx context.Context) ManagedFolderIamPolicyOutput {
return o
}
// An association between a role, which comes with a set of permissions, and members who may assume that role.
func (o ManagedFolderIamPolicyOutput) Bindings() ManagedFolderIamPolicyBindingsItemResponseArrayOutput {
return o.ApplyT(func(v *ManagedFolderIamPolicy) ManagedFolderIamPolicyBindingsItemResponseArrayOutput {
return v.Bindings
}).(ManagedFolderIamPolicyBindingsItemResponseArrayOutput)
}
func (o ManagedFolderIamPolicyOutput) Bucket() pulumi.StringOutput {
return o.ApplyT(func(v *ManagedFolderIamPolicy) pulumi.StringOutput { return v.Bucket }).(pulumi.StringOutput)
}
// HTTP 1.1 Entity tag for the policy.
func (o ManagedFolderIamPolicyOutput) Etag() pulumi.StringOutput {
return o.ApplyT(func(v *ManagedFolderIamPolicy) pulumi.StringOutput { return v.Etag }).(pulumi.StringOutput)
}
// The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.
func (o ManagedFolderIamPolicyOutput) Kind() pulumi.StringOutput {
return o.ApplyT(func(v *ManagedFolderIamPolicy) pulumi.StringOutput { return v.Kind }).(pulumi.StringOutput)
}
func (o ManagedFolderIamPolicyOutput) ManagedFolder() pulumi.StringOutput {
return o.ApplyT(func(v *ManagedFolderIamPolicy) pulumi.StringOutput { return v.ManagedFolder }).(pulumi.StringOutput)
}
// The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input.
func (o ManagedFolderIamPolicyOutput) ResourceId() pulumi.StringOutput {
return o.ApplyT(func(v *ManagedFolderIamPolicy) pulumi.StringOutput { return v.ResourceId }).(pulumi.StringOutput)
}
// The project to be billed for this request. Required for Requester Pays buckets.
func (o ManagedFolderIamPolicyOutput) UserProject() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ManagedFolderIamPolicy) pulumi.StringPtrOutput { return v.UserProject }).(pulumi.StringPtrOutput)
}
// The IAM policy format version.
func (o ManagedFolderIamPolicyOutput) Version() pulumi.IntOutput {
return o.ApplyT(func(v *ManagedFolderIamPolicy) pulumi.IntOutput { return v.Version }).(pulumi.IntOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ManagedFolderIamPolicyInput)(nil)).Elem(), &ManagedFolderIamPolicy{})
pulumi.RegisterOutputType(ManagedFolderIamPolicyOutput{})
}