Skip to content

Commit

Permalink
Add heartbeat_timeout validation function in autoscaling lifecycle hook
Browse files Browse the repository at this point in the history
Noticed that when trying to set a value lower than 30 seconds and got rejected at during `terraform apply`. Adding that to nicely fail during `terraform plan` when that happens.

This is not documented in [ec2/APIReference/API_LifecycleHook](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_LifecycleHook.html) but can be found in the [Autoscaling user guide](https://github.com/awsdocs/amazon-ec2-auto-scaling-user-guide/blob/master/doc_source/lifecycle-hooks.md#add-lifecycle-hooks-console)
  • Loading branch information
jphuynh committed Aug 22, 2020
1 parent 5e80237 commit 33b9cc4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aws/resource_aws_autoscaling_lifecycle_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ func resourceAwsAutoscalingLifecycleHook() *schema.Resource {
ValidateFunc: validation.StringInSlice([]string{"CONTINUE", "ABANDON"}, false),
},
"heartbeat_timeout": {
Type: schema.TypeInt,
Optional: true,
Type: schema.TypeInt,
Optional: true,
ValidateFunc: validation.IntBetween(30, 7200),
},
"lifecycle_transition": {
Type: schema.TypeString,
Expand Down

0 comments on commit 33b9cc4

Please sign in to comment.