github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/appconfig/deploymentStrategy.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package appconfig 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Provides an AppConfig Deployment Strategy resource. 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appconfig" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := appconfig.NewDeploymentStrategy(ctx, "example", &appconfig.DeploymentStrategyArgs{ 33 // Name: pulumi.String("example-deployment-strategy-tf"), 34 // Description: pulumi.String("Example Deployment Strategy"), 35 // DeploymentDurationInMinutes: pulumi.Int(3), 36 // FinalBakeTimeInMinutes: pulumi.Int(4), 37 // GrowthFactor: pulumi.Float64(10), 38 // GrowthType: pulumi.String("LINEAR"), 39 // ReplicateTo: pulumi.String("NONE"), 40 // Tags: pulumi.StringMap{ 41 // "Type": pulumi.String("AppConfig Deployment Strategy"), 42 // }, 43 // }) 44 // if err != nil { 45 // return err 46 // } 47 // return nil 48 // }) 49 // } 50 // 51 // ``` 52 // <!--End PulumiCodeChooser --> 53 // 54 // ## Import 55 // 56 // Using `pulumi import`, import AppConfig Deployment Strategies using their deployment strategy ID. For example: 57 // 58 // ```sh 59 // $ pulumi import aws:appconfig/deploymentStrategy:DeploymentStrategy example 11xxxxx 60 // ``` 61 type DeploymentStrategy struct { 62 pulumi.CustomResourceState 63 64 // ARN of the AppConfig Deployment Strategy. 65 Arn pulumi.StringOutput `pulumi:"arn"` 66 // Total amount of time for a deployment to last. Minimum value of 0, maximum value of 1440. 67 DeploymentDurationInMinutes pulumi.IntOutput `pulumi:"deploymentDurationInMinutes"` 68 // Description of the deployment strategy. Can be at most 1024 characters. 69 Description pulumi.StringPtrOutput `pulumi:"description"` 70 // Amount of time AWS AppConfig monitors for alarms before considering the deployment to be complete and no longer eligible for automatic roll back. Minimum value of 0, maximum value of 1440. 71 FinalBakeTimeInMinutes pulumi.IntPtrOutput `pulumi:"finalBakeTimeInMinutes"` 72 // Percentage of targets to receive a deployed configuration during each interval. Minimum value of 1.0, maximum value of 100.0. 73 GrowthFactor pulumi.Float64Output `pulumi:"growthFactor"` 74 // Algorithm used to define how percentage grows over time. Valid value: `LINEAR` and `EXPONENTIAL`. Defaults to `LINEAR`. 75 GrowthType pulumi.StringPtrOutput `pulumi:"growthType"` 76 // Name for the deployment strategy. Must be between 1 and 64 characters in length. 77 Name pulumi.StringOutput `pulumi:"name"` 78 // Where to save the deployment strategy. Valid values: `NONE` and `SSM_DOCUMENT`. 79 ReplicateTo pulumi.StringOutput `pulumi:"replicateTo"` 80 // 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. 81 Tags pulumi.StringMapOutput `pulumi:"tags"` 82 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 83 // 84 // Deprecated: Please use `tags` instead. 85 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 86 } 87 88 // NewDeploymentStrategy registers a new resource with the given unique name, arguments, and options. 89 func NewDeploymentStrategy(ctx *pulumi.Context, 90 name string, args *DeploymentStrategyArgs, opts ...pulumi.ResourceOption) (*DeploymentStrategy, error) { 91 if args == nil { 92 return nil, errors.New("missing one or more required arguments") 93 } 94 95 if args.DeploymentDurationInMinutes == nil { 96 return nil, errors.New("invalid value for required argument 'DeploymentDurationInMinutes'") 97 } 98 if args.GrowthFactor == nil { 99 return nil, errors.New("invalid value for required argument 'GrowthFactor'") 100 } 101 if args.ReplicateTo == nil { 102 return nil, errors.New("invalid value for required argument 'ReplicateTo'") 103 } 104 opts = internal.PkgResourceDefaultOpts(opts) 105 var resource DeploymentStrategy 106 err := ctx.RegisterResource("aws:appconfig/deploymentStrategy:DeploymentStrategy", name, args, &resource, opts...) 107 if err != nil { 108 return nil, err 109 } 110 return &resource, nil 111 } 112 113 // GetDeploymentStrategy gets an existing DeploymentStrategy resource's state with the given name, ID, and optional 114 // state properties that are used to uniquely qualify the lookup (nil if not required). 115 func GetDeploymentStrategy(ctx *pulumi.Context, 116 name string, id pulumi.IDInput, state *DeploymentStrategyState, opts ...pulumi.ResourceOption) (*DeploymentStrategy, error) { 117 var resource DeploymentStrategy 118 err := ctx.ReadResource("aws:appconfig/deploymentStrategy:DeploymentStrategy", name, id, state, &resource, opts...) 119 if err != nil { 120 return nil, err 121 } 122 return &resource, nil 123 } 124 125 // Input properties used for looking up and filtering DeploymentStrategy resources. 126 type deploymentStrategyState struct { 127 // ARN of the AppConfig Deployment Strategy. 128 Arn *string `pulumi:"arn"` 129 // Total amount of time for a deployment to last. Minimum value of 0, maximum value of 1440. 130 DeploymentDurationInMinutes *int `pulumi:"deploymentDurationInMinutes"` 131 // Description of the deployment strategy. Can be at most 1024 characters. 132 Description *string `pulumi:"description"` 133 // Amount of time AWS AppConfig monitors for alarms before considering the deployment to be complete and no longer eligible for automatic roll back. Minimum value of 0, maximum value of 1440. 134 FinalBakeTimeInMinutes *int `pulumi:"finalBakeTimeInMinutes"` 135 // Percentage of targets to receive a deployed configuration during each interval. Minimum value of 1.0, maximum value of 100.0. 136 GrowthFactor *float64 `pulumi:"growthFactor"` 137 // Algorithm used to define how percentage grows over time. Valid value: `LINEAR` and `EXPONENTIAL`. Defaults to `LINEAR`. 138 GrowthType *string `pulumi:"growthType"` 139 // Name for the deployment strategy. Must be between 1 and 64 characters in length. 140 Name *string `pulumi:"name"` 141 // Where to save the deployment strategy. Valid values: `NONE` and `SSM_DOCUMENT`. 142 ReplicateTo *string `pulumi:"replicateTo"` 143 // 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. 144 Tags map[string]string `pulumi:"tags"` 145 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 146 // 147 // Deprecated: Please use `tags` instead. 148 TagsAll map[string]string `pulumi:"tagsAll"` 149 } 150 151 type DeploymentStrategyState struct { 152 // ARN of the AppConfig Deployment Strategy. 153 Arn pulumi.StringPtrInput 154 // Total amount of time for a deployment to last. Minimum value of 0, maximum value of 1440. 155 DeploymentDurationInMinutes pulumi.IntPtrInput 156 // Description of the deployment strategy. Can be at most 1024 characters. 157 Description pulumi.StringPtrInput 158 // Amount of time AWS AppConfig monitors for alarms before considering the deployment to be complete and no longer eligible for automatic roll back. Minimum value of 0, maximum value of 1440. 159 FinalBakeTimeInMinutes pulumi.IntPtrInput 160 // Percentage of targets to receive a deployed configuration during each interval. Minimum value of 1.0, maximum value of 100.0. 161 GrowthFactor pulumi.Float64PtrInput 162 // Algorithm used to define how percentage grows over time. Valid value: `LINEAR` and `EXPONENTIAL`. Defaults to `LINEAR`. 163 GrowthType pulumi.StringPtrInput 164 // Name for the deployment strategy. Must be between 1 and 64 characters in length. 165 Name pulumi.StringPtrInput 166 // Where to save the deployment strategy. Valid values: `NONE` and `SSM_DOCUMENT`. 167 ReplicateTo pulumi.StringPtrInput 168 // 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. 169 Tags pulumi.StringMapInput 170 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 171 // 172 // Deprecated: Please use `tags` instead. 173 TagsAll pulumi.StringMapInput 174 } 175 176 func (DeploymentStrategyState) ElementType() reflect.Type { 177 return reflect.TypeOf((*deploymentStrategyState)(nil)).Elem() 178 } 179 180 type deploymentStrategyArgs struct { 181 // Total amount of time for a deployment to last. Minimum value of 0, maximum value of 1440. 182 DeploymentDurationInMinutes int `pulumi:"deploymentDurationInMinutes"` 183 // Description of the deployment strategy. Can be at most 1024 characters. 184 Description *string `pulumi:"description"` 185 // Amount of time AWS AppConfig monitors for alarms before considering the deployment to be complete and no longer eligible for automatic roll back. Minimum value of 0, maximum value of 1440. 186 FinalBakeTimeInMinutes *int `pulumi:"finalBakeTimeInMinutes"` 187 // Percentage of targets to receive a deployed configuration during each interval. Minimum value of 1.0, maximum value of 100.0. 188 GrowthFactor float64 `pulumi:"growthFactor"` 189 // Algorithm used to define how percentage grows over time. Valid value: `LINEAR` and `EXPONENTIAL`. Defaults to `LINEAR`. 190 GrowthType *string `pulumi:"growthType"` 191 // Name for the deployment strategy. Must be between 1 and 64 characters in length. 192 Name *string `pulumi:"name"` 193 // Where to save the deployment strategy. Valid values: `NONE` and `SSM_DOCUMENT`. 194 ReplicateTo string `pulumi:"replicateTo"` 195 // 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. 196 Tags map[string]string `pulumi:"tags"` 197 } 198 199 // The set of arguments for constructing a DeploymentStrategy resource. 200 type DeploymentStrategyArgs struct { 201 // Total amount of time for a deployment to last. Minimum value of 0, maximum value of 1440. 202 DeploymentDurationInMinutes pulumi.IntInput 203 // Description of the deployment strategy. Can be at most 1024 characters. 204 Description pulumi.StringPtrInput 205 // Amount of time AWS AppConfig monitors for alarms before considering the deployment to be complete and no longer eligible for automatic roll back. Minimum value of 0, maximum value of 1440. 206 FinalBakeTimeInMinutes pulumi.IntPtrInput 207 // Percentage of targets to receive a deployed configuration during each interval. Minimum value of 1.0, maximum value of 100.0. 208 GrowthFactor pulumi.Float64Input 209 // Algorithm used to define how percentage grows over time. Valid value: `LINEAR` and `EXPONENTIAL`. Defaults to `LINEAR`. 210 GrowthType pulumi.StringPtrInput 211 // Name for the deployment strategy. Must be between 1 and 64 characters in length. 212 Name pulumi.StringPtrInput 213 // Where to save the deployment strategy. Valid values: `NONE` and `SSM_DOCUMENT`. 214 ReplicateTo pulumi.StringInput 215 // 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. 216 Tags pulumi.StringMapInput 217 } 218 219 func (DeploymentStrategyArgs) ElementType() reflect.Type { 220 return reflect.TypeOf((*deploymentStrategyArgs)(nil)).Elem() 221 } 222 223 type DeploymentStrategyInput interface { 224 pulumi.Input 225 226 ToDeploymentStrategyOutput() DeploymentStrategyOutput 227 ToDeploymentStrategyOutputWithContext(ctx context.Context) DeploymentStrategyOutput 228 } 229 230 func (*DeploymentStrategy) ElementType() reflect.Type { 231 return reflect.TypeOf((**DeploymentStrategy)(nil)).Elem() 232 } 233 234 func (i *DeploymentStrategy) ToDeploymentStrategyOutput() DeploymentStrategyOutput { 235 return i.ToDeploymentStrategyOutputWithContext(context.Background()) 236 } 237 238 func (i *DeploymentStrategy) ToDeploymentStrategyOutputWithContext(ctx context.Context) DeploymentStrategyOutput { 239 return pulumi.ToOutputWithContext(ctx, i).(DeploymentStrategyOutput) 240 } 241 242 // DeploymentStrategyArrayInput is an input type that accepts DeploymentStrategyArray and DeploymentStrategyArrayOutput values. 243 // You can construct a concrete instance of `DeploymentStrategyArrayInput` via: 244 // 245 // DeploymentStrategyArray{ DeploymentStrategyArgs{...} } 246 type DeploymentStrategyArrayInput interface { 247 pulumi.Input 248 249 ToDeploymentStrategyArrayOutput() DeploymentStrategyArrayOutput 250 ToDeploymentStrategyArrayOutputWithContext(context.Context) DeploymentStrategyArrayOutput 251 } 252 253 type DeploymentStrategyArray []DeploymentStrategyInput 254 255 func (DeploymentStrategyArray) ElementType() reflect.Type { 256 return reflect.TypeOf((*[]*DeploymentStrategy)(nil)).Elem() 257 } 258 259 func (i DeploymentStrategyArray) ToDeploymentStrategyArrayOutput() DeploymentStrategyArrayOutput { 260 return i.ToDeploymentStrategyArrayOutputWithContext(context.Background()) 261 } 262 263 func (i DeploymentStrategyArray) ToDeploymentStrategyArrayOutputWithContext(ctx context.Context) DeploymentStrategyArrayOutput { 264 return pulumi.ToOutputWithContext(ctx, i).(DeploymentStrategyArrayOutput) 265 } 266 267 // DeploymentStrategyMapInput is an input type that accepts DeploymentStrategyMap and DeploymentStrategyMapOutput values. 268 // You can construct a concrete instance of `DeploymentStrategyMapInput` via: 269 // 270 // DeploymentStrategyMap{ "key": DeploymentStrategyArgs{...} } 271 type DeploymentStrategyMapInput interface { 272 pulumi.Input 273 274 ToDeploymentStrategyMapOutput() DeploymentStrategyMapOutput 275 ToDeploymentStrategyMapOutputWithContext(context.Context) DeploymentStrategyMapOutput 276 } 277 278 type DeploymentStrategyMap map[string]DeploymentStrategyInput 279 280 func (DeploymentStrategyMap) ElementType() reflect.Type { 281 return reflect.TypeOf((*map[string]*DeploymentStrategy)(nil)).Elem() 282 } 283 284 func (i DeploymentStrategyMap) ToDeploymentStrategyMapOutput() DeploymentStrategyMapOutput { 285 return i.ToDeploymentStrategyMapOutputWithContext(context.Background()) 286 } 287 288 func (i DeploymentStrategyMap) ToDeploymentStrategyMapOutputWithContext(ctx context.Context) DeploymentStrategyMapOutput { 289 return pulumi.ToOutputWithContext(ctx, i).(DeploymentStrategyMapOutput) 290 } 291 292 type DeploymentStrategyOutput struct{ *pulumi.OutputState } 293 294 func (DeploymentStrategyOutput) ElementType() reflect.Type { 295 return reflect.TypeOf((**DeploymentStrategy)(nil)).Elem() 296 } 297 298 func (o DeploymentStrategyOutput) ToDeploymentStrategyOutput() DeploymentStrategyOutput { 299 return o 300 } 301 302 func (o DeploymentStrategyOutput) ToDeploymentStrategyOutputWithContext(ctx context.Context) DeploymentStrategyOutput { 303 return o 304 } 305 306 // ARN of the AppConfig Deployment Strategy. 307 func (o DeploymentStrategyOutput) Arn() pulumi.StringOutput { 308 return o.ApplyT(func(v *DeploymentStrategy) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 309 } 310 311 // Total amount of time for a deployment to last. Minimum value of 0, maximum value of 1440. 312 func (o DeploymentStrategyOutput) DeploymentDurationInMinutes() pulumi.IntOutput { 313 return o.ApplyT(func(v *DeploymentStrategy) pulumi.IntOutput { return v.DeploymentDurationInMinutes }).(pulumi.IntOutput) 314 } 315 316 // Description of the deployment strategy. Can be at most 1024 characters. 317 func (o DeploymentStrategyOutput) Description() pulumi.StringPtrOutput { 318 return o.ApplyT(func(v *DeploymentStrategy) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 319 } 320 321 // Amount of time AWS AppConfig monitors for alarms before considering the deployment to be complete and no longer eligible for automatic roll back. Minimum value of 0, maximum value of 1440. 322 func (o DeploymentStrategyOutput) FinalBakeTimeInMinutes() pulumi.IntPtrOutput { 323 return o.ApplyT(func(v *DeploymentStrategy) pulumi.IntPtrOutput { return v.FinalBakeTimeInMinutes }).(pulumi.IntPtrOutput) 324 } 325 326 // Percentage of targets to receive a deployed configuration during each interval. Minimum value of 1.0, maximum value of 100.0. 327 func (o DeploymentStrategyOutput) GrowthFactor() pulumi.Float64Output { 328 return o.ApplyT(func(v *DeploymentStrategy) pulumi.Float64Output { return v.GrowthFactor }).(pulumi.Float64Output) 329 } 330 331 // Algorithm used to define how percentage grows over time. Valid value: `LINEAR` and `EXPONENTIAL`. Defaults to `LINEAR`. 332 func (o DeploymentStrategyOutput) GrowthType() pulumi.StringPtrOutput { 333 return o.ApplyT(func(v *DeploymentStrategy) pulumi.StringPtrOutput { return v.GrowthType }).(pulumi.StringPtrOutput) 334 } 335 336 // Name for the deployment strategy. Must be between 1 and 64 characters in length. 337 func (o DeploymentStrategyOutput) Name() pulumi.StringOutput { 338 return o.ApplyT(func(v *DeploymentStrategy) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 339 } 340 341 // Where to save the deployment strategy. Valid values: `NONE` and `SSM_DOCUMENT`. 342 func (o DeploymentStrategyOutput) ReplicateTo() pulumi.StringOutput { 343 return o.ApplyT(func(v *DeploymentStrategy) pulumi.StringOutput { return v.ReplicateTo }).(pulumi.StringOutput) 344 } 345 346 // 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. 347 func (o DeploymentStrategyOutput) Tags() pulumi.StringMapOutput { 348 return o.ApplyT(func(v *DeploymentStrategy) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 349 } 350 351 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 352 // 353 // Deprecated: Please use `tags` instead. 354 func (o DeploymentStrategyOutput) TagsAll() pulumi.StringMapOutput { 355 return o.ApplyT(func(v *DeploymentStrategy) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 356 } 357 358 type DeploymentStrategyArrayOutput struct{ *pulumi.OutputState } 359 360 func (DeploymentStrategyArrayOutput) ElementType() reflect.Type { 361 return reflect.TypeOf((*[]*DeploymentStrategy)(nil)).Elem() 362 } 363 364 func (o DeploymentStrategyArrayOutput) ToDeploymentStrategyArrayOutput() DeploymentStrategyArrayOutput { 365 return o 366 } 367 368 func (o DeploymentStrategyArrayOutput) ToDeploymentStrategyArrayOutputWithContext(ctx context.Context) DeploymentStrategyArrayOutput { 369 return o 370 } 371 372 func (o DeploymentStrategyArrayOutput) Index(i pulumi.IntInput) DeploymentStrategyOutput { 373 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DeploymentStrategy { 374 return vs[0].([]*DeploymentStrategy)[vs[1].(int)] 375 }).(DeploymentStrategyOutput) 376 } 377 378 type DeploymentStrategyMapOutput struct{ *pulumi.OutputState } 379 380 func (DeploymentStrategyMapOutput) ElementType() reflect.Type { 381 return reflect.TypeOf((*map[string]*DeploymentStrategy)(nil)).Elem() 382 } 383 384 func (o DeploymentStrategyMapOutput) ToDeploymentStrategyMapOutput() DeploymentStrategyMapOutput { 385 return o 386 } 387 388 func (o DeploymentStrategyMapOutput) ToDeploymentStrategyMapOutputWithContext(ctx context.Context) DeploymentStrategyMapOutput { 389 return o 390 } 391 392 func (o DeploymentStrategyMapOutput) MapIndex(k pulumi.StringInput) DeploymentStrategyOutput { 393 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DeploymentStrategy { 394 return vs[0].(map[string]*DeploymentStrategy)[vs[1].(string)] 395 }).(DeploymentStrategyOutput) 396 } 397 398 func init() { 399 pulumi.RegisterInputType(reflect.TypeOf((*DeploymentStrategyInput)(nil)).Elem(), &DeploymentStrategy{}) 400 pulumi.RegisterInputType(reflect.TypeOf((*DeploymentStrategyArrayInput)(nil)).Elem(), DeploymentStrategyArray{}) 401 pulumi.RegisterInputType(reflect.TypeOf((*DeploymentStrategyMapInput)(nil)).Elem(), DeploymentStrategyMap{}) 402 pulumi.RegisterOutputType(DeploymentStrategyOutput{}) 403 pulumi.RegisterOutputType(DeploymentStrategyArrayOutput{}) 404 pulumi.RegisterOutputType(DeploymentStrategyMapOutput{}) 405 }