generated from pulumi/pulumi-tf-provider-boilerplate
/
snscredentials.go
338 lines (286 loc) · 11.7 KB
/
snscredentials.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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
// 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 mnq
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/raeumlich/pulumi-scaleway/sdk/go/scaleway/internal"
)
// Creates and manages Scaleway Messaging and queuing SNS Credentials.
// For further information please check
// our [documentation](https://www.scaleway.com/en/docs/serverless/messaging/reference-content/sns-overview/)
//
// ## Example Usage
//
// ### Basic
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/raeumlich/pulumi-scaleway/sdk/go/scaleway/mnq"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// mainSNS, err := mnq.NewSNS(ctx, "mainSNS", nil)
// if err != nil {
// return err
// }
// _, err = mnq.NewSNSCredentials(ctx, "mainSNSCredentials", &mnq.SNSCredentialsArgs{
// ProjectId: mainSNS.ProjectId,
// Permissions: &mnq.SNSCredentialsPermissionsArgs{
// CanManage: pulumi.Bool(false),
// CanReceive: pulumi.Bool(true),
// CanPublish: pulumi.Bool(false),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// SNS credentials can be imported using the `{region}/{id}`, e.g.
//
// bash
//
// ```sh
// $ pulumi import scaleway:mnq/sNSCredentials:SNSCredentials main fr-par/11111111111111111111111111111111
// ```
type SNSCredentials struct {
pulumi.CustomResourceState
// The ID of the key.
AccessKey pulumi.StringOutput `pulumi:"accessKey"`
// The unique name of the sns credentials.
Name pulumi.StringOutput `pulumi:"name"`
// . List of permissions associated to these credentials. Only one of permissions may be set.
Permissions SNSCredentialsPermissionsOutput `pulumi:"permissions"`
// `projectId`) The ID of the project the sns is enabled for.
ProjectId pulumi.StringOutput `pulumi:"projectId"`
// `region`). The region in which sns is enabled.
Region pulumi.StringOutput `pulumi:"region"`
// The secret value of the key.
SecretKey pulumi.StringOutput `pulumi:"secretKey"`
}
// NewSNSCredentials registers a new resource with the given unique name, arguments, and options.
func NewSNSCredentials(ctx *pulumi.Context,
name string, args *SNSCredentialsArgs, opts ...pulumi.ResourceOption) (*SNSCredentials, error) {
if args == nil {
args = &SNSCredentialsArgs{}
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"accessKey",
"secretKey",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource SNSCredentials
err := ctx.RegisterResource("scaleway:mnq/sNSCredentials:SNSCredentials", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSNSCredentials gets an existing SNSCredentials 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 GetSNSCredentials(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SNSCredentialsState, opts ...pulumi.ResourceOption) (*SNSCredentials, error) {
var resource SNSCredentials
err := ctx.ReadResource("scaleway:mnq/sNSCredentials:SNSCredentials", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SNSCredentials resources.
type snscredentialsState struct {
// The ID of the key.
AccessKey *string `pulumi:"accessKey"`
// The unique name of the sns credentials.
Name *string `pulumi:"name"`
// . List of permissions associated to these credentials. Only one of permissions may be set.
Permissions *SNSCredentialsPermissions `pulumi:"permissions"`
// `projectId`) The ID of the project the sns is enabled for.
ProjectId *string `pulumi:"projectId"`
// `region`). The region in which sns is enabled.
Region *string `pulumi:"region"`
// The secret value of the key.
SecretKey *string `pulumi:"secretKey"`
}
type SNSCredentialsState struct {
// The ID of the key.
AccessKey pulumi.StringPtrInput
// The unique name of the sns credentials.
Name pulumi.StringPtrInput
// . List of permissions associated to these credentials. Only one of permissions may be set.
Permissions SNSCredentialsPermissionsPtrInput
// `projectId`) The ID of the project the sns is enabled for.
ProjectId pulumi.StringPtrInput
// `region`). The region in which sns is enabled.
Region pulumi.StringPtrInput
// The secret value of the key.
SecretKey pulumi.StringPtrInput
}
func (SNSCredentialsState) ElementType() reflect.Type {
return reflect.TypeOf((*snscredentialsState)(nil)).Elem()
}
type snscredentialsArgs struct {
// The unique name of the sns credentials.
Name *string `pulumi:"name"`
// . List of permissions associated to these credentials. Only one of permissions may be set.
Permissions *SNSCredentialsPermissions `pulumi:"permissions"`
// `projectId`) The ID of the project the sns is enabled for.
ProjectId *string `pulumi:"projectId"`
// `region`). The region in which sns is enabled.
Region *string `pulumi:"region"`
}
// The set of arguments for constructing a SNSCredentials resource.
type SNSCredentialsArgs struct {
// The unique name of the sns credentials.
Name pulumi.StringPtrInput
// . List of permissions associated to these credentials. Only one of permissions may be set.
Permissions SNSCredentialsPermissionsPtrInput
// `projectId`) The ID of the project the sns is enabled for.
ProjectId pulumi.StringPtrInput
// `region`). The region in which sns is enabled.
Region pulumi.StringPtrInput
}
func (SNSCredentialsArgs) ElementType() reflect.Type {
return reflect.TypeOf((*snscredentialsArgs)(nil)).Elem()
}
type SNSCredentialsInput interface {
pulumi.Input
ToSNSCredentialsOutput() SNSCredentialsOutput
ToSNSCredentialsOutputWithContext(ctx context.Context) SNSCredentialsOutput
}
func (*SNSCredentials) ElementType() reflect.Type {
return reflect.TypeOf((**SNSCredentials)(nil)).Elem()
}
func (i *SNSCredentials) ToSNSCredentialsOutput() SNSCredentialsOutput {
return i.ToSNSCredentialsOutputWithContext(context.Background())
}
func (i *SNSCredentials) ToSNSCredentialsOutputWithContext(ctx context.Context) SNSCredentialsOutput {
return pulumi.ToOutputWithContext(ctx, i).(SNSCredentialsOutput)
}
// SNSCredentialsArrayInput is an input type that accepts SNSCredentialsArray and SNSCredentialsArrayOutput values.
// You can construct a concrete instance of `SNSCredentialsArrayInput` via:
//
// SNSCredentialsArray{ SNSCredentialsArgs{...} }
type SNSCredentialsArrayInput interface {
pulumi.Input
ToSNSCredentialsArrayOutput() SNSCredentialsArrayOutput
ToSNSCredentialsArrayOutputWithContext(context.Context) SNSCredentialsArrayOutput
}
type SNSCredentialsArray []SNSCredentialsInput
func (SNSCredentialsArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SNSCredentials)(nil)).Elem()
}
func (i SNSCredentialsArray) ToSNSCredentialsArrayOutput() SNSCredentialsArrayOutput {
return i.ToSNSCredentialsArrayOutputWithContext(context.Background())
}
func (i SNSCredentialsArray) ToSNSCredentialsArrayOutputWithContext(ctx context.Context) SNSCredentialsArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SNSCredentialsArrayOutput)
}
// SNSCredentialsMapInput is an input type that accepts SNSCredentialsMap and SNSCredentialsMapOutput values.
// You can construct a concrete instance of `SNSCredentialsMapInput` via:
//
// SNSCredentialsMap{ "key": SNSCredentialsArgs{...} }
type SNSCredentialsMapInput interface {
pulumi.Input
ToSNSCredentialsMapOutput() SNSCredentialsMapOutput
ToSNSCredentialsMapOutputWithContext(context.Context) SNSCredentialsMapOutput
}
type SNSCredentialsMap map[string]SNSCredentialsInput
func (SNSCredentialsMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SNSCredentials)(nil)).Elem()
}
func (i SNSCredentialsMap) ToSNSCredentialsMapOutput() SNSCredentialsMapOutput {
return i.ToSNSCredentialsMapOutputWithContext(context.Background())
}
func (i SNSCredentialsMap) ToSNSCredentialsMapOutputWithContext(ctx context.Context) SNSCredentialsMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SNSCredentialsMapOutput)
}
type SNSCredentialsOutput struct{ *pulumi.OutputState }
func (SNSCredentialsOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SNSCredentials)(nil)).Elem()
}
func (o SNSCredentialsOutput) ToSNSCredentialsOutput() SNSCredentialsOutput {
return o
}
func (o SNSCredentialsOutput) ToSNSCredentialsOutputWithContext(ctx context.Context) SNSCredentialsOutput {
return o
}
// The ID of the key.
func (o SNSCredentialsOutput) AccessKey() pulumi.StringOutput {
return o.ApplyT(func(v *SNSCredentials) pulumi.StringOutput { return v.AccessKey }).(pulumi.StringOutput)
}
// The unique name of the sns credentials.
func (o SNSCredentialsOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *SNSCredentials) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// . List of permissions associated to these credentials. Only one of permissions may be set.
func (o SNSCredentialsOutput) Permissions() SNSCredentialsPermissionsOutput {
return o.ApplyT(func(v *SNSCredentials) SNSCredentialsPermissionsOutput { return v.Permissions }).(SNSCredentialsPermissionsOutput)
}
// `projectId`) The ID of the project the sns is enabled for.
func (o SNSCredentialsOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *SNSCredentials) pulumi.StringOutput { return v.ProjectId }).(pulumi.StringOutput)
}
// `region`). The region in which sns is enabled.
func (o SNSCredentialsOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v *SNSCredentials) pulumi.StringOutput { return v.Region }).(pulumi.StringOutput)
}
// The secret value of the key.
func (o SNSCredentialsOutput) SecretKey() pulumi.StringOutput {
return o.ApplyT(func(v *SNSCredentials) pulumi.StringOutput { return v.SecretKey }).(pulumi.StringOutput)
}
type SNSCredentialsArrayOutput struct{ *pulumi.OutputState }
func (SNSCredentialsArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SNSCredentials)(nil)).Elem()
}
func (o SNSCredentialsArrayOutput) ToSNSCredentialsArrayOutput() SNSCredentialsArrayOutput {
return o
}
func (o SNSCredentialsArrayOutput) ToSNSCredentialsArrayOutputWithContext(ctx context.Context) SNSCredentialsArrayOutput {
return o
}
func (o SNSCredentialsArrayOutput) Index(i pulumi.IntInput) SNSCredentialsOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SNSCredentials {
return vs[0].([]*SNSCredentials)[vs[1].(int)]
}).(SNSCredentialsOutput)
}
type SNSCredentialsMapOutput struct{ *pulumi.OutputState }
func (SNSCredentialsMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SNSCredentials)(nil)).Elem()
}
func (o SNSCredentialsMapOutput) ToSNSCredentialsMapOutput() SNSCredentialsMapOutput {
return o
}
func (o SNSCredentialsMapOutput) ToSNSCredentialsMapOutputWithContext(ctx context.Context) SNSCredentialsMapOutput {
return o
}
func (o SNSCredentialsMapOutput) MapIndex(k pulumi.StringInput) SNSCredentialsOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SNSCredentials {
return vs[0].(map[string]*SNSCredentials)[vs[1].(string)]
}).(SNSCredentialsOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SNSCredentialsInput)(nil)).Elem(), &SNSCredentials{})
pulumi.RegisterInputType(reflect.TypeOf((*SNSCredentialsArrayInput)(nil)).Elem(), SNSCredentialsArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SNSCredentialsMapInput)(nil)).Elem(), SNSCredentialsMap{})
pulumi.RegisterOutputType(SNSCredentialsOutput{})
pulumi.RegisterOutputType(SNSCredentialsArrayOutput{})
pulumi.RegisterOutputType(SNSCredentialsMapOutput{})
}