/
containerNamespace.go
408 lines (352 loc) · 15.9 KB
/
containerNamespace.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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
// 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 scaleway
import (
"context"
"reflect"
"github.com/dirien/pulumi-scaleway/sdk/v2/go/scaleway/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates and manages Scaleway Serverless Container Namespace.
// For more information see [the documentation](https://developers.scaleway.com/en/products/containers/api/#namespaces-cdce79).
//
// ## Examples
//
// ### Basic
//
// ```go
// package main
//
// import (
//
// "github.com/dirien/pulumi-scaleway/sdk/v2/go/scaleway"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := scaleway.NewContainerNamespace(ctx, "main", &scaleway.ContainerNamespaceArgs{
// Description: pulumi.String("Main container namespace"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Namespaces can be imported using the `{region}/{id}`, e.g. bash
//
// ```sh
//
// $ pulumi import scaleway:index/containerNamespace:ContainerNamespace main fr-par/11111111-1111-1111-1111-111111111111
//
// ```
type ContainerNamespace struct {
pulumi.CustomResourceState
// The description of the namespace.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Destroy registry on deletion
//
// Deprecated: Registry namespace is automatically destroyed with namespace
DestroyRegistry pulumi.BoolPtrOutput `pulumi:"destroyRegistry"`
// The environment variables of the namespace.
EnvironmentVariables pulumi.StringMapOutput `pulumi:"environmentVariables"`
// The unique name of the container namespace.
//
// > **Important** Updates to `name` will recreate the namespace.
Name pulumi.StringOutput `pulumi:"name"`
// The organization ID the namespace is associated with.
OrganizationId pulumi.StringOutput `pulumi:"organizationId"`
// `projectId`) The ID of the project the namespace is associated with.
ProjectId pulumi.StringOutput `pulumi:"projectId"`
// `region`). The region in which the namespace should be created.
Region pulumi.StringOutput `pulumi:"region"`
// The registry endpoint of the namespace.
RegistryEndpoint pulumi.StringOutput `pulumi:"registryEndpoint"`
// The registry namespace ID of the namespace.
RegistryNamespaceId pulumi.StringOutput `pulumi:"registryNamespaceId"`
// The secret environment variables of the namespace.
SecretEnvironmentVariables pulumi.StringMapOutput `pulumi:"secretEnvironmentVariables"`
}
// NewContainerNamespace registers a new resource with the given unique name, arguments, and options.
func NewContainerNamespace(ctx *pulumi.Context,
name string, args *ContainerNamespaceArgs, opts ...pulumi.ResourceOption) (*ContainerNamespace, error) {
if args == nil {
args = &ContainerNamespaceArgs{}
}
if args.SecretEnvironmentVariables != nil {
args.SecretEnvironmentVariables = pulumi.ToSecret(args.SecretEnvironmentVariables).(pulumi.StringMapInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"secretEnvironmentVariables",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource ContainerNamespace
err := ctx.RegisterResource("scaleway:index/containerNamespace:ContainerNamespace", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetContainerNamespace gets an existing ContainerNamespace 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 GetContainerNamespace(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ContainerNamespaceState, opts ...pulumi.ResourceOption) (*ContainerNamespace, error) {
var resource ContainerNamespace
err := ctx.ReadResource("scaleway:index/containerNamespace:ContainerNamespace", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ContainerNamespace resources.
type containerNamespaceState struct {
// The description of the namespace.
Description *string `pulumi:"description"`
// Destroy registry on deletion
//
// Deprecated: Registry namespace is automatically destroyed with namespace
DestroyRegistry *bool `pulumi:"destroyRegistry"`
// The environment variables of the namespace.
EnvironmentVariables map[string]string `pulumi:"environmentVariables"`
// The unique name of the container namespace.
//
// > **Important** Updates to `name` will recreate the namespace.
Name *string `pulumi:"name"`
// The organization ID the namespace is associated with.
OrganizationId *string `pulumi:"organizationId"`
// `projectId`) The ID of the project the namespace is associated with.
ProjectId *string `pulumi:"projectId"`
// `region`). The region in which the namespace should be created.
Region *string `pulumi:"region"`
// The registry endpoint of the namespace.
RegistryEndpoint *string `pulumi:"registryEndpoint"`
// The registry namespace ID of the namespace.
RegistryNamespaceId *string `pulumi:"registryNamespaceId"`
// The secret environment variables of the namespace.
SecretEnvironmentVariables map[string]string `pulumi:"secretEnvironmentVariables"`
}
type ContainerNamespaceState struct {
// The description of the namespace.
Description pulumi.StringPtrInput
// Destroy registry on deletion
//
// Deprecated: Registry namespace is automatically destroyed with namespace
DestroyRegistry pulumi.BoolPtrInput
// The environment variables of the namespace.
EnvironmentVariables pulumi.StringMapInput
// The unique name of the container namespace.
//
// > **Important** Updates to `name` will recreate the namespace.
Name pulumi.StringPtrInput
// The organization ID the namespace is associated with.
OrganizationId pulumi.StringPtrInput
// `projectId`) The ID of the project the namespace is associated with.
ProjectId pulumi.StringPtrInput
// `region`). The region in which the namespace should be created.
Region pulumi.StringPtrInput
// The registry endpoint of the namespace.
RegistryEndpoint pulumi.StringPtrInput
// The registry namespace ID of the namespace.
RegistryNamespaceId pulumi.StringPtrInput
// The secret environment variables of the namespace.
SecretEnvironmentVariables pulumi.StringMapInput
}
func (ContainerNamespaceState) ElementType() reflect.Type {
return reflect.TypeOf((*containerNamespaceState)(nil)).Elem()
}
type containerNamespaceArgs struct {
// The description of the namespace.
Description *string `pulumi:"description"`
// Destroy registry on deletion
//
// Deprecated: Registry namespace is automatically destroyed with namespace
DestroyRegistry *bool `pulumi:"destroyRegistry"`
// The environment variables of the namespace.
EnvironmentVariables map[string]string `pulumi:"environmentVariables"`
// The unique name of the container namespace.
//
// > **Important** Updates to `name` will recreate the namespace.
Name *string `pulumi:"name"`
// `projectId`) The ID of the project the namespace is associated with.
ProjectId *string `pulumi:"projectId"`
// `region`). The region in which the namespace should be created.
Region *string `pulumi:"region"`
// The secret environment variables of the namespace.
SecretEnvironmentVariables map[string]string `pulumi:"secretEnvironmentVariables"`
}
// The set of arguments for constructing a ContainerNamespace resource.
type ContainerNamespaceArgs struct {
// The description of the namespace.
Description pulumi.StringPtrInput
// Destroy registry on deletion
//
// Deprecated: Registry namespace is automatically destroyed with namespace
DestroyRegistry pulumi.BoolPtrInput
// The environment variables of the namespace.
EnvironmentVariables pulumi.StringMapInput
// The unique name of the container namespace.
//
// > **Important** Updates to `name` will recreate the namespace.
Name pulumi.StringPtrInput
// `projectId`) The ID of the project the namespace is associated with.
ProjectId pulumi.StringPtrInput
// `region`). The region in which the namespace should be created.
Region pulumi.StringPtrInput
// The secret environment variables of the namespace.
SecretEnvironmentVariables pulumi.StringMapInput
}
func (ContainerNamespaceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*containerNamespaceArgs)(nil)).Elem()
}
type ContainerNamespaceInput interface {
pulumi.Input
ToContainerNamespaceOutput() ContainerNamespaceOutput
ToContainerNamespaceOutputWithContext(ctx context.Context) ContainerNamespaceOutput
}
func (*ContainerNamespace) ElementType() reflect.Type {
return reflect.TypeOf((**ContainerNamespace)(nil)).Elem()
}
func (i *ContainerNamespace) ToContainerNamespaceOutput() ContainerNamespaceOutput {
return i.ToContainerNamespaceOutputWithContext(context.Background())
}
func (i *ContainerNamespace) ToContainerNamespaceOutputWithContext(ctx context.Context) ContainerNamespaceOutput {
return pulumi.ToOutputWithContext(ctx, i).(ContainerNamespaceOutput)
}
// ContainerNamespaceArrayInput is an input type that accepts ContainerNamespaceArray and ContainerNamespaceArrayOutput values.
// You can construct a concrete instance of `ContainerNamespaceArrayInput` via:
//
// ContainerNamespaceArray{ ContainerNamespaceArgs{...} }
type ContainerNamespaceArrayInput interface {
pulumi.Input
ToContainerNamespaceArrayOutput() ContainerNamespaceArrayOutput
ToContainerNamespaceArrayOutputWithContext(context.Context) ContainerNamespaceArrayOutput
}
type ContainerNamespaceArray []ContainerNamespaceInput
func (ContainerNamespaceArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ContainerNamespace)(nil)).Elem()
}
func (i ContainerNamespaceArray) ToContainerNamespaceArrayOutput() ContainerNamespaceArrayOutput {
return i.ToContainerNamespaceArrayOutputWithContext(context.Background())
}
func (i ContainerNamespaceArray) ToContainerNamespaceArrayOutputWithContext(ctx context.Context) ContainerNamespaceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ContainerNamespaceArrayOutput)
}
// ContainerNamespaceMapInput is an input type that accepts ContainerNamespaceMap and ContainerNamespaceMapOutput values.
// You can construct a concrete instance of `ContainerNamespaceMapInput` via:
//
// ContainerNamespaceMap{ "key": ContainerNamespaceArgs{...} }
type ContainerNamespaceMapInput interface {
pulumi.Input
ToContainerNamespaceMapOutput() ContainerNamespaceMapOutput
ToContainerNamespaceMapOutputWithContext(context.Context) ContainerNamespaceMapOutput
}
type ContainerNamespaceMap map[string]ContainerNamespaceInput
func (ContainerNamespaceMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ContainerNamespace)(nil)).Elem()
}
func (i ContainerNamespaceMap) ToContainerNamespaceMapOutput() ContainerNamespaceMapOutput {
return i.ToContainerNamespaceMapOutputWithContext(context.Background())
}
func (i ContainerNamespaceMap) ToContainerNamespaceMapOutputWithContext(ctx context.Context) ContainerNamespaceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ContainerNamespaceMapOutput)
}
type ContainerNamespaceOutput struct{ *pulumi.OutputState }
func (ContainerNamespaceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ContainerNamespace)(nil)).Elem()
}
func (o ContainerNamespaceOutput) ToContainerNamespaceOutput() ContainerNamespaceOutput {
return o
}
func (o ContainerNamespaceOutput) ToContainerNamespaceOutputWithContext(ctx context.Context) ContainerNamespaceOutput {
return o
}
// The description of the namespace.
func (o ContainerNamespaceOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ContainerNamespace) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Destroy registry on deletion
//
// Deprecated: Registry namespace is automatically destroyed with namespace
func (o ContainerNamespaceOutput) DestroyRegistry() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *ContainerNamespace) pulumi.BoolPtrOutput { return v.DestroyRegistry }).(pulumi.BoolPtrOutput)
}
// The environment variables of the namespace.
func (o ContainerNamespaceOutput) EnvironmentVariables() pulumi.StringMapOutput {
return o.ApplyT(func(v *ContainerNamespace) pulumi.StringMapOutput { return v.EnvironmentVariables }).(pulumi.StringMapOutput)
}
// The unique name of the container namespace.
//
// > **Important** Updates to `name` will recreate the namespace.
func (o ContainerNamespaceOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *ContainerNamespace) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The organization ID the namespace is associated with.
func (o ContainerNamespaceOutput) OrganizationId() pulumi.StringOutput {
return o.ApplyT(func(v *ContainerNamespace) pulumi.StringOutput { return v.OrganizationId }).(pulumi.StringOutput)
}
// `projectId`) The ID of the project the namespace is associated with.
func (o ContainerNamespaceOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *ContainerNamespace) pulumi.StringOutput { return v.ProjectId }).(pulumi.StringOutput)
}
// `region`). The region in which the namespace should be created.
func (o ContainerNamespaceOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v *ContainerNamespace) pulumi.StringOutput { return v.Region }).(pulumi.StringOutput)
}
// The registry endpoint of the namespace.
func (o ContainerNamespaceOutput) RegistryEndpoint() pulumi.StringOutput {
return o.ApplyT(func(v *ContainerNamespace) pulumi.StringOutput { return v.RegistryEndpoint }).(pulumi.StringOutput)
}
// The registry namespace ID of the namespace.
func (o ContainerNamespaceOutput) RegistryNamespaceId() pulumi.StringOutput {
return o.ApplyT(func(v *ContainerNamespace) pulumi.StringOutput { return v.RegistryNamespaceId }).(pulumi.StringOutput)
}
// The secret environment variables of the namespace.
func (o ContainerNamespaceOutput) SecretEnvironmentVariables() pulumi.StringMapOutput {
return o.ApplyT(func(v *ContainerNamespace) pulumi.StringMapOutput { return v.SecretEnvironmentVariables }).(pulumi.StringMapOutput)
}
type ContainerNamespaceArrayOutput struct{ *pulumi.OutputState }
func (ContainerNamespaceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ContainerNamespace)(nil)).Elem()
}
func (o ContainerNamespaceArrayOutput) ToContainerNamespaceArrayOutput() ContainerNamespaceArrayOutput {
return o
}
func (o ContainerNamespaceArrayOutput) ToContainerNamespaceArrayOutputWithContext(ctx context.Context) ContainerNamespaceArrayOutput {
return o
}
func (o ContainerNamespaceArrayOutput) Index(i pulumi.IntInput) ContainerNamespaceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ContainerNamespace {
return vs[0].([]*ContainerNamespace)[vs[1].(int)]
}).(ContainerNamespaceOutput)
}
type ContainerNamespaceMapOutput struct{ *pulumi.OutputState }
func (ContainerNamespaceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ContainerNamespace)(nil)).Elem()
}
func (o ContainerNamespaceMapOutput) ToContainerNamespaceMapOutput() ContainerNamespaceMapOutput {
return o
}
func (o ContainerNamespaceMapOutput) ToContainerNamespaceMapOutputWithContext(ctx context.Context) ContainerNamespaceMapOutput {
return o
}
func (o ContainerNamespaceMapOutput) MapIndex(k pulumi.StringInput) ContainerNamespaceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ContainerNamespace {
return vs[0].(map[string]*ContainerNamespace)[vs[1].(string)]
}).(ContainerNamespaceOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ContainerNamespaceInput)(nil)).Elem(), &ContainerNamespace{})
pulumi.RegisterInputType(reflect.TypeOf((*ContainerNamespaceArrayInput)(nil)).Elem(), ContainerNamespaceArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ContainerNamespaceMapInput)(nil)).Elem(), ContainerNamespaceMap{})
pulumi.RegisterOutputType(ContainerNamespaceOutput{})
pulumi.RegisterOutputType(ContainerNamespaceArrayOutput{})
pulumi.RegisterOutputType(ContainerNamespaceMapOutput{})
}