/
deployment.go
444 lines (385 loc) · 19.8 KB
/
deployment.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
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
// 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 appconfig
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an AppConfig Deployment resource for an `appconfig.Application` resource.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appconfig"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := appconfig.NewDeployment(ctx, "example", &appconfig.DeploymentArgs{
// ApplicationId: pulumi.Any(exampleAwsAppconfigApplication.Id),
// ConfigurationProfileId: pulumi.Any(exampleAwsAppconfigConfigurationProfile.ConfigurationProfileId),
// ConfigurationVersion: pulumi.Any(exampleAwsAppconfigHostedConfigurationVersion.VersionNumber),
// DeploymentStrategyId: pulumi.Any(exampleAwsAppconfigDeploymentStrategy.Id),
// Description: pulumi.String("My example deployment"),
// EnvironmentId: pulumi.Any(exampleAwsAppconfigEnvironment.EnvironmentId),
// KmsKeyIdentifier: pulumi.Any(exampleAwsKmsKey.Arn),
// Tags: pulumi.StringMap{
// "Type": pulumi.String("AppConfig Deployment"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Using `pulumi import`, import AppConfig Deployments using the application ID, environment ID, and deployment number separated by a slash (`/`). For example:
//
// ```sh
// $ pulumi import aws:appconfig/deployment:Deployment example 71abcde/11xxxxx/1
// ```
type Deployment struct {
pulumi.CustomResourceState
// Application ID. Must be between 4 and 7 characters in length.
ApplicationId pulumi.StringOutput `pulumi:"applicationId"`
// ARN of the AppConfig Deployment.
Arn pulumi.StringOutput `pulumi:"arn"`
// Configuration profile ID. Must be between 4 and 7 characters in length.
ConfigurationProfileId pulumi.StringOutput `pulumi:"configurationProfileId"`
// Configuration version to deploy. Can be at most 1024 characters.
ConfigurationVersion pulumi.StringOutput `pulumi:"configurationVersion"`
// Deployment number.
DeploymentNumber pulumi.IntOutput `pulumi:"deploymentNumber"`
// Deployment strategy ID or name of a predefined deployment strategy. See [Predefined Deployment Strategies](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-deployment-strategy.html#appconfig-creating-deployment-strategy-predefined) for more details.
DeploymentStrategyId pulumi.StringOutput `pulumi:"deploymentStrategyId"`
// Description of the deployment. Can be at most 1024 characters.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Environment ID. Must be between 4 and 7 characters in length.
EnvironmentId pulumi.StringOutput `pulumi:"environmentId"`
// ARN of the KMS key used to encrypt configuration data.
KmsKeyArn pulumi.StringOutput `pulumi:"kmsKeyArn"`
// The KMS key identifier (key ID, key alias, or key ARN). AppConfig uses this to encrypt the configuration data using a customer managed key.
KmsKeyIdentifier pulumi.StringPtrOutput `pulumi:"kmsKeyIdentifier"`
// State of the deployment.
State pulumi.StringOutput `pulumi:"state"`
// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
}
// NewDeployment registers a new resource with the given unique name, arguments, and options.
func NewDeployment(ctx *pulumi.Context,
name string, args *DeploymentArgs, opts ...pulumi.ResourceOption) (*Deployment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApplicationId == nil {
return nil, errors.New("invalid value for required argument 'ApplicationId'")
}
if args.ConfigurationProfileId == nil {
return nil, errors.New("invalid value for required argument 'ConfigurationProfileId'")
}
if args.ConfigurationVersion == nil {
return nil, errors.New("invalid value for required argument 'ConfigurationVersion'")
}
if args.DeploymentStrategyId == nil {
return nil, errors.New("invalid value for required argument 'DeploymentStrategyId'")
}
if args.EnvironmentId == nil {
return nil, errors.New("invalid value for required argument 'EnvironmentId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Deployment
err := ctx.RegisterResource("aws:appconfig/deployment:Deployment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDeployment gets an existing Deployment 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 GetDeployment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DeploymentState, opts ...pulumi.ResourceOption) (*Deployment, error) {
var resource Deployment
err := ctx.ReadResource("aws:appconfig/deployment:Deployment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Deployment resources.
type deploymentState struct {
// Application ID. Must be between 4 and 7 characters in length.
ApplicationId *string `pulumi:"applicationId"`
// ARN of the AppConfig Deployment.
Arn *string `pulumi:"arn"`
// Configuration profile ID. Must be between 4 and 7 characters in length.
ConfigurationProfileId *string `pulumi:"configurationProfileId"`
// Configuration version to deploy. Can be at most 1024 characters.
ConfigurationVersion *string `pulumi:"configurationVersion"`
// Deployment number.
DeploymentNumber *int `pulumi:"deploymentNumber"`
// Deployment strategy ID or name of a predefined deployment strategy. See [Predefined Deployment Strategies](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-deployment-strategy.html#appconfig-creating-deployment-strategy-predefined) for more details.
DeploymentStrategyId *string `pulumi:"deploymentStrategyId"`
// Description of the deployment. Can be at most 1024 characters.
Description *string `pulumi:"description"`
// Environment ID. Must be between 4 and 7 characters in length.
EnvironmentId *string `pulumi:"environmentId"`
// ARN of the KMS key used to encrypt configuration data.
KmsKeyArn *string `pulumi:"kmsKeyArn"`
// The KMS key identifier (key ID, key alias, or key ARN). AppConfig uses this to encrypt the configuration data using a customer managed key.
KmsKeyIdentifier *string `pulumi:"kmsKeyIdentifier"`
// State of the deployment.
State *string `pulumi:"state"`
// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll map[string]string `pulumi:"tagsAll"`
}
type DeploymentState struct {
// Application ID. Must be between 4 and 7 characters in length.
ApplicationId pulumi.StringPtrInput
// ARN of the AppConfig Deployment.
Arn pulumi.StringPtrInput
// Configuration profile ID. Must be between 4 and 7 characters in length.
ConfigurationProfileId pulumi.StringPtrInput
// Configuration version to deploy. Can be at most 1024 characters.
ConfigurationVersion pulumi.StringPtrInput
// Deployment number.
DeploymentNumber pulumi.IntPtrInput
// Deployment strategy ID or name of a predefined deployment strategy. See [Predefined Deployment Strategies](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-deployment-strategy.html#appconfig-creating-deployment-strategy-predefined) for more details.
DeploymentStrategyId pulumi.StringPtrInput
// Description of the deployment. Can be at most 1024 characters.
Description pulumi.StringPtrInput
// Environment ID. Must be between 4 and 7 characters in length.
EnvironmentId pulumi.StringPtrInput
// ARN of the KMS key used to encrypt configuration data.
KmsKeyArn pulumi.StringPtrInput
// The KMS key identifier (key ID, key alias, or key ARN). AppConfig uses this to encrypt the configuration data using a customer managed key.
KmsKeyIdentifier pulumi.StringPtrInput
// State of the deployment.
State pulumi.StringPtrInput
// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapInput
}
func (DeploymentState) ElementType() reflect.Type {
return reflect.TypeOf((*deploymentState)(nil)).Elem()
}
type deploymentArgs struct {
// Application ID. Must be between 4 and 7 characters in length.
ApplicationId string `pulumi:"applicationId"`
// Configuration profile ID. Must be between 4 and 7 characters in length.
ConfigurationProfileId string `pulumi:"configurationProfileId"`
// Configuration version to deploy. Can be at most 1024 characters.
ConfigurationVersion string `pulumi:"configurationVersion"`
// Deployment strategy ID or name of a predefined deployment strategy. See [Predefined Deployment Strategies](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-deployment-strategy.html#appconfig-creating-deployment-strategy-predefined) for more details.
DeploymentStrategyId string `pulumi:"deploymentStrategyId"`
// Description of the deployment. Can be at most 1024 characters.
Description *string `pulumi:"description"`
// Environment ID. Must be between 4 and 7 characters in length.
EnvironmentId string `pulumi:"environmentId"`
// The KMS key identifier (key ID, key alias, or key ARN). AppConfig uses this to encrypt the configuration data using a customer managed key.
KmsKeyIdentifier *string `pulumi:"kmsKeyIdentifier"`
// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a Deployment resource.
type DeploymentArgs struct {
// Application ID. Must be between 4 and 7 characters in length.
ApplicationId pulumi.StringInput
// Configuration profile ID. Must be between 4 and 7 characters in length.
ConfigurationProfileId pulumi.StringInput
// Configuration version to deploy. Can be at most 1024 characters.
ConfigurationVersion pulumi.StringInput
// Deployment strategy ID or name of a predefined deployment strategy. See [Predefined Deployment Strategies](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-deployment-strategy.html#appconfig-creating-deployment-strategy-predefined) for more details.
DeploymentStrategyId pulumi.StringInput
// Description of the deployment. Can be at most 1024 characters.
Description pulumi.StringPtrInput
// Environment ID. Must be between 4 and 7 characters in length.
EnvironmentId pulumi.StringInput
// The KMS key identifier (key ID, key alias, or key ARN). AppConfig uses this to encrypt the configuration data using a customer managed key.
KmsKeyIdentifier pulumi.StringPtrInput
// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
}
func (DeploymentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*deploymentArgs)(nil)).Elem()
}
type DeploymentInput interface {
pulumi.Input
ToDeploymentOutput() DeploymentOutput
ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput
}
func (*Deployment) ElementType() reflect.Type {
return reflect.TypeOf((**Deployment)(nil)).Elem()
}
func (i *Deployment) ToDeploymentOutput() DeploymentOutput {
return i.ToDeploymentOutputWithContext(context.Background())
}
func (i *Deployment) ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput {
return pulumi.ToOutputWithContext(ctx, i).(DeploymentOutput)
}
// DeploymentArrayInput is an input type that accepts DeploymentArray and DeploymentArrayOutput values.
// You can construct a concrete instance of `DeploymentArrayInput` via:
//
// DeploymentArray{ DeploymentArgs{...} }
type DeploymentArrayInput interface {
pulumi.Input
ToDeploymentArrayOutput() DeploymentArrayOutput
ToDeploymentArrayOutputWithContext(context.Context) DeploymentArrayOutput
}
type DeploymentArray []DeploymentInput
func (DeploymentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Deployment)(nil)).Elem()
}
func (i DeploymentArray) ToDeploymentArrayOutput() DeploymentArrayOutput {
return i.ToDeploymentArrayOutputWithContext(context.Background())
}
func (i DeploymentArray) ToDeploymentArrayOutputWithContext(ctx context.Context) DeploymentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DeploymentArrayOutput)
}
// DeploymentMapInput is an input type that accepts DeploymentMap and DeploymentMapOutput values.
// You can construct a concrete instance of `DeploymentMapInput` via:
//
// DeploymentMap{ "key": DeploymentArgs{...} }
type DeploymentMapInput interface {
pulumi.Input
ToDeploymentMapOutput() DeploymentMapOutput
ToDeploymentMapOutputWithContext(context.Context) DeploymentMapOutput
}
type DeploymentMap map[string]DeploymentInput
func (DeploymentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Deployment)(nil)).Elem()
}
func (i DeploymentMap) ToDeploymentMapOutput() DeploymentMapOutput {
return i.ToDeploymentMapOutputWithContext(context.Background())
}
func (i DeploymentMap) ToDeploymentMapOutputWithContext(ctx context.Context) DeploymentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DeploymentMapOutput)
}
type DeploymentOutput struct{ *pulumi.OutputState }
func (DeploymentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Deployment)(nil)).Elem()
}
func (o DeploymentOutput) ToDeploymentOutput() DeploymentOutput {
return o
}
func (o DeploymentOutput) ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput {
return o
}
// Application ID. Must be between 4 and 7 characters in length.
func (o DeploymentOutput) ApplicationId() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.ApplicationId }).(pulumi.StringOutput)
}
// ARN of the AppConfig Deployment.
func (o DeploymentOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// Configuration profile ID. Must be between 4 and 7 characters in length.
func (o DeploymentOutput) ConfigurationProfileId() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.ConfigurationProfileId }).(pulumi.StringOutput)
}
// Configuration version to deploy. Can be at most 1024 characters.
func (o DeploymentOutput) ConfigurationVersion() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.ConfigurationVersion }).(pulumi.StringOutput)
}
// Deployment number.
func (o DeploymentOutput) DeploymentNumber() pulumi.IntOutput {
return o.ApplyT(func(v *Deployment) pulumi.IntOutput { return v.DeploymentNumber }).(pulumi.IntOutput)
}
// Deployment strategy ID or name of a predefined deployment strategy. See [Predefined Deployment Strategies](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-deployment-strategy.html#appconfig-creating-deployment-strategy-predefined) for more details.
func (o DeploymentOutput) DeploymentStrategyId() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.DeploymentStrategyId }).(pulumi.StringOutput)
}
// Description of the deployment. Can be at most 1024 characters.
func (o DeploymentOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Environment ID. Must be between 4 and 7 characters in length.
func (o DeploymentOutput) EnvironmentId() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.EnvironmentId }).(pulumi.StringOutput)
}
// ARN of the KMS key used to encrypt configuration data.
func (o DeploymentOutput) KmsKeyArn() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.KmsKeyArn }).(pulumi.StringOutput)
}
// The KMS key identifier (key ID, key alias, or key ARN). AppConfig uses this to encrypt the configuration data using a customer managed key.
func (o DeploymentOutput) KmsKeyIdentifier() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringPtrOutput { return v.KmsKeyIdentifier }).(pulumi.StringPtrOutput)
}
// State of the deployment.
func (o DeploymentOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
func (o DeploymentOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
func (o DeploymentOutput) TagsAll() pulumi.StringMapOutput {
return o.ApplyT(func(v *Deployment) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
}
type DeploymentArrayOutput struct{ *pulumi.OutputState }
func (DeploymentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Deployment)(nil)).Elem()
}
func (o DeploymentArrayOutput) ToDeploymentArrayOutput() DeploymentArrayOutput {
return o
}
func (o DeploymentArrayOutput) ToDeploymentArrayOutputWithContext(ctx context.Context) DeploymentArrayOutput {
return o
}
func (o DeploymentArrayOutput) Index(i pulumi.IntInput) DeploymentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Deployment {
return vs[0].([]*Deployment)[vs[1].(int)]
}).(DeploymentOutput)
}
type DeploymentMapOutput struct{ *pulumi.OutputState }
func (DeploymentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Deployment)(nil)).Elem()
}
func (o DeploymentMapOutput) ToDeploymentMapOutput() DeploymentMapOutput {
return o
}
func (o DeploymentMapOutput) ToDeploymentMapOutputWithContext(ctx context.Context) DeploymentMapOutput {
return o
}
func (o DeploymentMapOutput) MapIndex(k pulumi.StringInput) DeploymentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Deployment {
return vs[0].(map[string]*Deployment)[vs[1].(string)]
}).(DeploymentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DeploymentInput)(nil)).Elem(), &Deployment{})
pulumi.RegisterInputType(reflect.TypeOf((*DeploymentArrayInput)(nil)).Elem(), DeploymentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DeploymentMapInput)(nil)).Elem(), DeploymentMap{})
pulumi.RegisterOutputType(DeploymentOutput{})
pulumi.RegisterOutputType(DeploymentArrayOutput{})
pulumi.RegisterOutputType(DeploymentMapOutput{})
}