This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
generated from pulumi/pulumi-tf-provider-boilerplate
/
iamServiceAccountStaticAccessKey.go
292 lines (246 loc) · 14 KB
/
iamServiceAccountStaticAccessKey.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
// *** 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"
)
// Allows management of [Yandex.Cloud IAM service account static access keys](https://cloud.yandex.com/docs/iam/operations/sa/create-access-key).
// Generated pair of keys is used to access [Yandex Object Storage](https://cloud.yandex.com/docs/storage) on behalf of service account.
//
// Before using keys do not forget to [assign a proper role](https://cloud.yandex.com/docs/iam/operations/sa/assign-role-for-sa) to the service account.
//
// ## Example Usage
//
// This snippet creates a service account static access key.
//
// ```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.NewIamServiceAccountStaticAccessKey(ctx, "sa-static-key", &yandex.IamServiceAccountStaticAccessKeyArgs{
// Description: pulumi.String("static access key for object storage"),
// PgpKey: pulumi.String("keybase:keybaseusername"),
// ServiceAccountId: pulumi.String("some_sa_id"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
type IamServiceAccountStaticAccessKey struct {
pulumi.CustomResourceState
// ID of the static access key.
AccessKey pulumi.StringOutput `pulumi:"accessKey"`
// Creation timestamp of the static access key.
CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
// The description of the service account static key.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The encrypted secret, base64 encoded. This is only populated when `pgpKey` is supplied.
EncryptedSecretKey pulumi.StringOutput `pulumi:"encryptedSecretKey"`
// The fingerprint of the PGP key used to encrypt the secret key. This is only populated when `pgpKey` is supplied.
KeyFingerprint pulumi.StringOutput `pulumi:"keyFingerprint"`
// An optional PGP key to encrypt the resulting secret key material. May either be a base64-encoded public key or a keybase username in the form `keybase:keybaseusername`.
PgpKey pulumi.StringPtrOutput `pulumi:"pgpKey"`
// Private part of generated static access key. This is only populated when no `pgpKey` is provided.
SecretKey pulumi.StringOutput `pulumi:"secretKey"`
// ID of the service account which is used to get a static key.
ServiceAccountId pulumi.StringOutput `pulumi:"serviceAccountId"`
}
// NewIamServiceAccountStaticAccessKey registers a new resource with the given unique name, arguments, and options.
func NewIamServiceAccountStaticAccessKey(ctx *pulumi.Context,
name string, args *IamServiceAccountStaticAccessKeyArgs, opts ...pulumi.ResourceOption) (*IamServiceAccountStaticAccessKey, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ServiceAccountId == nil {
return nil, errors.New("invalid value for required argument 'ServiceAccountId'")
}
var resource IamServiceAccountStaticAccessKey
err := ctx.RegisterResource("yandex:index/iamServiceAccountStaticAccessKey:IamServiceAccountStaticAccessKey", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetIamServiceAccountStaticAccessKey gets an existing IamServiceAccountStaticAccessKey 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 GetIamServiceAccountStaticAccessKey(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *IamServiceAccountStaticAccessKeyState, opts ...pulumi.ResourceOption) (*IamServiceAccountStaticAccessKey, error) {
var resource IamServiceAccountStaticAccessKey
err := ctx.ReadResource("yandex:index/iamServiceAccountStaticAccessKey:IamServiceAccountStaticAccessKey", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering IamServiceAccountStaticAccessKey resources.
type iamServiceAccountStaticAccessKeyState struct {
// ID of the static access key.
AccessKey *string `pulumi:"accessKey"`
// Creation timestamp of the static access key.
CreatedAt *string `pulumi:"createdAt"`
// The description of the service account static key.
Description *string `pulumi:"description"`
// The encrypted secret, base64 encoded. This is only populated when `pgpKey` is supplied.
EncryptedSecretKey *string `pulumi:"encryptedSecretKey"`
// The fingerprint of the PGP key used to encrypt the secret key. This is only populated when `pgpKey` is supplied.
KeyFingerprint *string `pulumi:"keyFingerprint"`
// An optional PGP key to encrypt the resulting secret key material. May either be a base64-encoded public key or a keybase username in the form `keybase:keybaseusername`.
PgpKey *string `pulumi:"pgpKey"`
// Private part of generated static access key. This is only populated when no `pgpKey` is provided.
SecretKey *string `pulumi:"secretKey"`
// ID of the service account which is used to get a static key.
ServiceAccountId *string `pulumi:"serviceAccountId"`
}
type IamServiceAccountStaticAccessKeyState struct {
// ID of the static access key.
AccessKey pulumi.StringPtrInput
// Creation timestamp of the static access key.
CreatedAt pulumi.StringPtrInput
// The description of the service account static key.
Description pulumi.StringPtrInput
// The encrypted secret, base64 encoded. This is only populated when `pgpKey` is supplied.
EncryptedSecretKey pulumi.StringPtrInput
// The fingerprint of the PGP key used to encrypt the secret key. This is only populated when `pgpKey` is supplied.
KeyFingerprint pulumi.StringPtrInput
// An optional PGP key to encrypt the resulting secret key material. May either be a base64-encoded public key or a keybase username in the form `keybase:keybaseusername`.
PgpKey pulumi.StringPtrInput
// Private part of generated static access key. This is only populated when no `pgpKey` is provided.
SecretKey pulumi.StringPtrInput
// ID of the service account which is used to get a static key.
ServiceAccountId pulumi.StringPtrInput
}
func (IamServiceAccountStaticAccessKeyState) ElementType() reflect.Type {
return reflect.TypeOf((*iamServiceAccountStaticAccessKeyState)(nil)).Elem()
}
type iamServiceAccountStaticAccessKeyArgs struct {
// The description of the service account static key.
Description *string `pulumi:"description"`
// An optional PGP key to encrypt the resulting secret key material. May either be a base64-encoded public key or a keybase username in the form `keybase:keybaseusername`.
PgpKey *string `pulumi:"pgpKey"`
// ID of the service account which is used to get a static key.
ServiceAccountId string `pulumi:"serviceAccountId"`
}
// The set of arguments for constructing a IamServiceAccountStaticAccessKey resource.
type IamServiceAccountStaticAccessKeyArgs struct {
// The description of the service account static key.
Description pulumi.StringPtrInput
// An optional PGP key to encrypt the resulting secret key material. May either be a base64-encoded public key or a keybase username in the form `keybase:keybaseusername`.
PgpKey pulumi.StringPtrInput
// ID of the service account which is used to get a static key.
ServiceAccountId pulumi.StringInput
}
func (IamServiceAccountStaticAccessKeyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*iamServiceAccountStaticAccessKeyArgs)(nil)).Elem()
}
type IamServiceAccountStaticAccessKeyInput interface {
pulumi.Input
ToIamServiceAccountStaticAccessKeyOutput() IamServiceAccountStaticAccessKeyOutput
ToIamServiceAccountStaticAccessKeyOutputWithContext(ctx context.Context) IamServiceAccountStaticAccessKeyOutput
}
func (*IamServiceAccountStaticAccessKey) ElementType() reflect.Type {
return reflect.TypeOf((**IamServiceAccountStaticAccessKey)(nil)).Elem()
}
func (i *IamServiceAccountStaticAccessKey) ToIamServiceAccountStaticAccessKeyOutput() IamServiceAccountStaticAccessKeyOutput {
return i.ToIamServiceAccountStaticAccessKeyOutputWithContext(context.Background())
}
func (i *IamServiceAccountStaticAccessKey) ToIamServiceAccountStaticAccessKeyOutputWithContext(ctx context.Context) IamServiceAccountStaticAccessKeyOutput {
return pulumi.ToOutputWithContext(ctx, i).(IamServiceAccountStaticAccessKeyOutput)
}
// IamServiceAccountStaticAccessKeyArrayInput is an input type that accepts IamServiceAccountStaticAccessKeyArray and IamServiceAccountStaticAccessKeyArrayOutput values.
// You can construct a concrete instance of `IamServiceAccountStaticAccessKeyArrayInput` via:
//
// IamServiceAccountStaticAccessKeyArray{ IamServiceAccountStaticAccessKeyArgs{...} }
type IamServiceAccountStaticAccessKeyArrayInput interface {
pulumi.Input
ToIamServiceAccountStaticAccessKeyArrayOutput() IamServiceAccountStaticAccessKeyArrayOutput
ToIamServiceAccountStaticAccessKeyArrayOutputWithContext(context.Context) IamServiceAccountStaticAccessKeyArrayOutput
}
type IamServiceAccountStaticAccessKeyArray []IamServiceAccountStaticAccessKeyInput
func (IamServiceAccountStaticAccessKeyArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*IamServiceAccountStaticAccessKey)(nil)).Elem()
}
func (i IamServiceAccountStaticAccessKeyArray) ToIamServiceAccountStaticAccessKeyArrayOutput() IamServiceAccountStaticAccessKeyArrayOutput {
return i.ToIamServiceAccountStaticAccessKeyArrayOutputWithContext(context.Background())
}
func (i IamServiceAccountStaticAccessKeyArray) ToIamServiceAccountStaticAccessKeyArrayOutputWithContext(ctx context.Context) IamServiceAccountStaticAccessKeyArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(IamServiceAccountStaticAccessKeyArrayOutput)
}
// IamServiceAccountStaticAccessKeyMapInput is an input type that accepts IamServiceAccountStaticAccessKeyMap and IamServiceAccountStaticAccessKeyMapOutput values.
// You can construct a concrete instance of `IamServiceAccountStaticAccessKeyMapInput` via:
//
// IamServiceAccountStaticAccessKeyMap{ "key": IamServiceAccountStaticAccessKeyArgs{...} }
type IamServiceAccountStaticAccessKeyMapInput interface {
pulumi.Input
ToIamServiceAccountStaticAccessKeyMapOutput() IamServiceAccountStaticAccessKeyMapOutput
ToIamServiceAccountStaticAccessKeyMapOutputWithContext(context.Context) IamServiceAccountStaticAccessKeyMapOutput
}
type IamServiceAccountStaticAccessKeyMap map[string]IamServiceAccountStaticAccessKeyInput
func (IamServiceAccountStaticAccessKeyMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*IamServiceAccountStaticAccessKey)(nil)).Elem()
}
func (i IamServiceAccountStaticAccessKeyMap) ToIamServiceAccountStaticAccessKeyMapOutput() IamServiceAccountStaticAccessKeyMapOutput {
return i.ToIamServiceAccountStaticAccessKeyMapOutputWithContext(context.Background())
}
func (i IamServiceAccountStaticAccessKeyMap) ToIamServiceAccountStaticAccessKeyMapOutputWithContext(ctx context.Context) IamServiceAccountStaticAccessKeyMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(IamServiceAccountStaticAccessKeyMapOutput)
}
type IamServiceAccountStaticAccessKeyOutput struct{ *pulumi.OutputState }
func (IamServiceAccountStaticAccessKeyOutput) ElementType() reflect.Type {
return reflect.TypeOf((**IamServiceAccountStaticAccessKey)(nil)).Elem()
}
func (o IamServiceAccountStaticAccessKeyOutput) ToIamServiceAccountStaticAccessKeyOutput() IamServiceAccountStaticAccessKeyOutput {
return o
}
func (o IamServiceAccountStaticAccessKeyOutput) ToIamServiceAccountStaticAccessKeyOutputWithContext(ctx context.Context) IamServiceAccountStaticAccessKeyOutput {
return o
}
type IamServiceAccountStaticAccessKeyArrayOutput struct{ *pulumi.OutputState }
func (IamServiceAccountStaticAccessKeyArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*IamServiceAccountStaticAccessKey)(nil)).Elem()
}
func (o IamServiceAccountStaticAccessKeyArrayOutput) ToIamServiceAccountStaticAccessKeyArrayOutput() IamServiceAccountStaticAccessKeyArrayOutput {
return o
}
func (o IamServiceAccountStaticAccessKeyArrayOutput) ToIamServiceAccountStaticAccessKeyArrayOutputWithContext(ctx context.Context) IamServiceAccountStaticAccessKeyArrayOutput {
return o
}
func (o IamServiceAccountStaticAccessKeyArrayOutput) Index(i pulumi.IntInput) IamServiceAccountStaticAccessKeyOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *IamServiceAccountStaticAccessKey {
return vs[0].([]*IamServiceAccountStaticAccessKey)[vs[1].(int)]
}).(IamServiceAccountStaticAccessKeyOutput)
}
type IamServiceAccountStaticAccessKeyMapOutput struct{ *pulumi.OutputState }
func (IamServiceAccountStaticAccessKeyMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*IamServiceAccountStaticAccessKey)(nil)).Elem()
}
func (o IamServiceAccountStaticAccessKeyMapOutput) ToIamServiceAccountStaticAccessKeyMapOutput() IamServiceAccountStaticAccessKeyMapOutput {
return o
}
func (o IamServiceAccountStaticAccessKeyMapOutput) ToIamServiceAccountStaticAccessKeyMapOutputWithContext(ctx context.Context) IamServiceAccountStaticAccessKeyMapOutput {
return o
}
func (o IamServiceAccountStaticAccessKeyMapOutput) MapIndex(k pulumi.StringInput) IamServiceAccountStaticAccessKeyOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *IamServiceAccountStaticAccessKey {
return vs[0].(map[string]*IamServiceAccountStaticAccessKey)[vs[1].(string)]
}).(IamServiceAccountStaticAccessKeyOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*IamServiceAccountStaticAccessKeyInput)(nil)).Elem(), &IamServiceAccountStaticAccessKey{})
pulumi.RegisterInputType(reflect.TypeOf((*IamServiceAccountStaticAccessKeyArrayInput)(nil)).Elem(), IamServiceAccountStaticAccessKeyArray{})
pulumi.RegisterInputType(reflect.TypeOf((*IamServiceAccountStaticAccessKeyMapInput)(nil)).Elem(), IamServiceAccountStaticAccessKeyMap{})
pulumi.RegisterOutputType(IamServiceAccountStaticAccessKeyOutput{})
pulumi.RegisterOutputType(IamServiceAccountStaticAccessKeyArrayOutput{})
pulumi.RegisterOutputType(IamServiceAccountStaticAccessKeyMapOutput{})
}