This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
generated from pulumi/pulumi-tf-provider-boilerplate
/
functionIamBinding.go
288 lines (242 loc) · 11.8 KB
/
functionIamBinding.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package yandex
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## yandex\_function\_iam\_binding
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-yandex/sdk/go/yandex"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := yandex.NewFunctionIamBinding(ctx, "function-iam", &yandex.FunctionIamBindingArgs{
// FunctionId: pulumi.String("your-function-id"),
// Members: pulumi.StringArray{
// pulumi.String("system:allUsers"),
// },
// Role: pulumi.String("serverless.functions.invoker"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
type FunctionIamBinding struct {
pulumi.CustomResourceState
// The [Yandex Cloud Function](https://cloud.yandex.com/docs/functions/) ID to apply a binding to.
FunctionId pulumi.StringOutput `pulumi:"functionId"`
// Identities that will be granted the privilege in `role`.
// Each entry can have one of the following values:
// * **userAccount:{user_id}**: A unique user ID that represents a specific Yandex account.
// * **serviceAccount:{service_account_id}**: A unique service account ID.
// * **system:{allUsers|allAuthenticatedUsers}**: see [system groups](https://cloud.yandex.com/docs/iam/concepts/access-control/system-group)
Members pulumi.StringArrayOutput `pulumi:"members"`
// The role that should be applied. See [roles](https://cloud.yandex.com/docs/functions/security/)
Role pulumi.StringOutput `pulumi:"role"`
SleepAfter pulumi.IntPtrOutput `pulumi:"sleepAfter"`
}
// NewFunctionIamBinding registers a new resource with the given unique name, arguments, and options.
func NewFunctionIamBinding(ctx *pulumi.Context,
name string, args *FunctionIamBindingArgs, opts ...pulumi.ResourceOption) (*FunctionIamBinding, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.FunctionId == nil {
return nil, errors.New("invalid value for required argument 'FunctionId'")
}
if args.Members == nil {
return nil, errors.New("invalid value for required argument 'Members'")
}
if args.Role == nil {
return nil, errors.New("invalid value for required argument 'Role'")
}
var resource FunctionIamBinding
err := ctx.RegisterResource("yandex:index/functionIamBinding:FunctionIamBinding", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetFunctionIamBinding gets an existing FunctionIamBinding 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 GetFunctionIamBinding(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *FunctionIamBindingState, opts ...pulumi.ResourceOption) (*FunctionIamBinding, error) {
var resource FunctionIamBinding
err := ctx.ReadResource("yandex:index/functionIamBinding:FunctionIamBinding", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering FunctionIamBinding resources.
type functionIamBindingState struct {
// The [Yandex Cloud Function](https://cloud.yandex.com/docs/functions/) ID to apply a binding to.
FunctionId *string `pulumi:"functionId"`
// Identities that will be granted the privilege in `role`.
// Each entry can have one of the following values:
// * **userAccount:{user_id}**: A unique user ID that represents a specific Yandex account.
// * **serviceAccount:{service_account_id}**: A unique service account ID.
// * **system:{allUsers|allAuthenticatedUsers}**: see [system groups](https://cloud.yandex.com/docs/iam/concepts/access-control/system-group)
Members []string `pulumi:"members"`
// The role that should be applied. See [roles](https://cloud.yandex.com/docs/functions/security/)
Role *string `pulumi:"role"`
SleepAfter *int `pulumi:"sleepAfter"`
}
type FunctionIamBindingState struct {
// The [Yandex Cloud Function](https://cloud.yandex.com/docs/functions/) ID to apply a binding to.
FunctionId pulumi.StringPtrInput
// Identities that will be granted the privilege in `role`.
// Each entry can have one of the following values:
// * **userAccount:{user_id}**: A unique user ID that represents a specific Yandex account.
// * **serviceAccount:{service_account_id}**: A unique service account ID.
// * **system:{allUsers|allAuthenticatedUsers}**: see [system groups](https://cloud.yandex.com/docs/iam/concepts/access-control/system-group)
Members pulumi.StringArrayInput
// The role that should be applied. See [roles](https://cloud.yandex.com/docs/functions/security/)
Role pulumi.StringPtrInput
SleepAfter pulumi.IntPtrInput
}
func (FunctionIamBindingState) ElementType() reflect.Type {
return reflect.TypeOf((*functionIamBindingState)(nil)).Elem()
}
type functionIamBindingArgs struct {
// The [Yandex Cloud Function](https://cloud.yandex.com/docs/functions/) ID to apply a binding to.
FunctionId string `pulumi:"functionId"`
// Identities that will be granted the privilege in `role`.
// Each entry can have one of the following values:
// * **userAccount:{user_id}**: A unique user ID that represents a specific Yandex account.
// * **serviceAccount:{service_account_id}**: A unique service account ID.
// * **system:{allUsers|allAuthenticatedUsers}**: see [system groups](https://cloud.yandex.com/docs/iam/concepts/access-control/system-group)
Members []string `pulumi:"members"`
// The role that should be applied. See [roles](https://cloud.yandex.com/docs/functions/security/)
Role string `pulumi:"role"`
SleepAfter *int `pulumi:"sleepAfter"`
}
// The set of arguments for constructing a FunctionIamBinding resource.
type FunctionIamBindingArgs struct {
// The [Yandex Cloud Function](https://cloud.yandex.com/docs/functions/) ID to apply a binding to.
FunctionId pulumi.StringInput
// Identities that will be granted the privilege in `role`.
// Each entry can have one of the following values:
// * **userAccount:{user_id}**: A unique user ID that represents a specific Yandex account.
// * **serviceAccount:{service_account_id}**: A unique service account ID.
// * **system:{allUsers|allAuthenticatedUsers}**: see [system groups](https://cloud.yandex.com/docs/iam/concepts/access-control/system-group)
Members pulumi.StringArrayInput
// The role that should be applied. See [roles](https://cloud.yandex.com/docs/functions/security/)
Role pulumi.StringInput
SleepAfter pulumi.IntPtrInput
}
func (FunctionIamBindingArgs) ElementType() reflect.Type {
return reflect.TypeOf((*functionIamBindingArgs)(nil)).Elem()
}
type FunctionIamBindingInput interface {
pulumi.Input
ToFunctionIamBindingOutput() FunctionIamBindingOutput
ToFunctionIamBindingOutputWithContext(ctx context.Context) FunctionIamBindingOutput
}
func (*FunctionIamBinding) ElementType() reflect.Type {
return reflect.TypeOf((**FunctionIamBinding)(nil)).Elem()
}
func (i *FunctionIamBinding) ToFunctionIamBindingOutput() FunctionIamBindingOutput {
return i.ToFunctionIamBindingOutputWithContext(context.Background())
}
func (i *FunctionIamBinding) ToFunctionIamBindingOutputWithContext(ctx context.Context) FunctionIamBindingOutput {
return pulumi.ToOutputWithContext(ctx, i).(FunctionIamBindingOutput)
}
// FunctionIamBindingArrayInput is an input type that accepts FunctionIamBindingArray and FunctionIamBindingArrayOutput values.
// You can construct a concrete instance of `FunctionIamBindingArrayInput` via:
//
// FunctionIamBindingArray{ FunctionIamBindingArgs{...} }
type FunctionIamBindingArrayInput interface {
pulumi.Input
ToFunctionIamBindingArrayOutput() FunctionIamBindingArrayOutput
ToFunctionIamBindingArrayOutputWithContext(context.Context) FunctionIamBindingArrayOutput
}
type FunctionIamBindingArray []FunctionIamBindingInput
func (FunctionIamBindingArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*FunctionIamBinding)(nil)).Elem()
}
func (i FunctionIamBindingArray) ToFunctionIamBindingArrayOutput() FunctionIamBindingArrayOutput {
return i.ToFunctionIamBindingArrayOutputWithContext(context.Background())
}
func (i FunctionIamBindingArray) ToFunctionIamBindingArrayOutputWithContext(ctx context.Context) FunctionIamBindingArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(FunctionIamBindingArrayOutput)
}
// FunctionIamBindingMapInput is an input type that accepts FunctionIamBindingMap and FunctionIamBindingMapOutput values.
// You can construct a concrete instance of `FunctionIamBindingMapInput` via:
//
// FunctionIamBindingMap{ "key": FunctionIamBindingArgs{...} }
type FunctionIamBindingMapInput interface {
pulumi.Input
ToFunctionIamBindingMapOutput() FunctionIamBindingMapOutput
ToFunctionIamBindingMapOutputWithContext(context.Context) FunctionIamBindingMapOutput
}
type FunctionIamBindingMap map[string]FunctionIamBindingInput
func (FunctionIamBindingMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*FunctionIamBinding)(nil)).Elem()
}
func (i FunctionIamBindingMap) ToFunctionIamBindingMapOutput() FunctionIamBindingMapOutput {
return i.ToFunctionIamBindingMapOutputWithContext(context.Background())
}
func (i FunctionIamBindingMap) ToFunctionIamBindingMapOutputWithContext(ctx context.Context) FunctionIamBindingMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(FunctionIamBindingMapOutput)
}
type FunctionIamBindingOutput struct{ *pulumi.OutputState }
func (FunctionIamBindingOutput) ElementType() reflect.Type {
return reflect.TypeOf((**FunctionIamBinding)(nil)).Elem()
}
func (o FunctionIamBindingOutput) ToFunctionIamBindingOutput() FunctionIamBindingOutput {
return o
}
func (o FunctionIamBindingOutput) ToFunctionIamBindingOutputWithContext(ctx context.Context) FunctionIamBindingOutput {
return o
}
type FunctionIamBindingArrayOutput struct{ *pulumi.OutputState }
func (FunctionIamBindingArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*FunctionIamBinding)(nil)).Elem()
}
func (o FunctionIamBindingArrayOutput) ToFunctionIamBindingArrayOutput() FunctionIamBindingArrayOutput {
return o
}
func (o FunctionIamBindingArrayOutput) ToFunctionIamBindingArrayOutputWithContext(ctx context.Context) FunctionIamBindingArrayOutput {
return o
}
func (o FunctionIamBindingArrayOutput) Index(i pulumi.IntInput) FunctionIamBindingOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *FunctionIamBinding {
return vs[0].([]*FunctionIamBinding)[vs[1].(int)]
}).(FunctionIamBindingOutput)
}
type FunctionIamBindingMapOutput struct{ *pulumi.OutputState }
func (FunctionIamBindingMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*FunctionIamBinding)(nil)).Elem()
}
func (o FunctionIamBindingMapOutput) ToFunctionIamBindingMapOutput() FunctionIamBindingMapOutput {
return o
}
func (o FunctionIamBindingMapOutput) ToFunctionIamBindingMapOutputWithContext(ctx context.Context) FunctionIamBindingMapOutput {
return o
}
func (o FunctionIamBindingMapOutput) MapIndex(k pulumi.StringInput) FunctionIamBindingOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *FunctionIamBinding {
return vs[0].(map[string]*FunctionIamBinding)[vs[1].(string)]
}).(FunctionIamBindingOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*FunctionIamBindingInput)(nil)).Elem(), &FunctionIamBinding{})
pulumi.RegisterInputType(reflect.TypeOf((*FunctionIamBindingArrayInput)(nil)).Elem(), FunctionIamBindingArray{})
pulumi.RegisterInputType(reflect.TypeOf((*FunctionIamBindingMapInput)(nil)).Elem(), FunctionIamBindingMap{})
pulumi.RegisterOutputType(FunctionIamBindingOutput{})
pulumi.RegisterOutputType(FunctionIamBindingArrayOutput{})
pulumi.RegisterOutputType(FunctionIamBindingMapOutput{})
}