(MODE-11365) fixing local-exec.
This commit is contained in:
parent
16b6970c47
commit
0bcfbdd5b7
1 changed files with 1 additions and 1 deletions
|
|
@ -47,7 +47,7 @@ resource "aws_autoscaling_group" "autoscalinggroup" {
|
|||
|
||||
provisioner "local-exec" {
|
||||
# Wait until the number of "ok" instance status checks is equal to 1
|
||||
command = "sleep 15;expected=2; current=0; retries=0; instances=$(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name \"${aws_autoscaling_group.autoscalinggroup.name}\" --query 'AutoScalingGroups[*].Instances[*].InstanceId' --output text); while [ \"$current\" -lt \"$expected\" ]; do for i in $(echo $instances); do check=$(aws elbv2 describe-target-health --target-group-arn \"${aws_alb_target_group.target_group_this.arn}\" --query \"TargetHealthDescriptions[?Target.Id == '$i'].TargetHealth.State\" --output text); echo \"$check\"; if [ \"$check\" = \"$(echo 'healthy')\" ]; then current=\"$(echo $((++current)))\"; else current=\"$(echo $((--current)))\"; fi; done; if [ \"$current\" -eq \"$expected\" ]; then break; else current=\"0\"; retries=\"$((++retries))\" fi; if [ \"$retries\" = \"3\" ]; then break;fi done"
|
||||
command = "sleep 15;expected=2; current=0; retries=0; instances=$(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name \"${aws_autoscaling_group.autoscalinggroup.name}\" --query 'AutoScalingGroups[*].Instances[*].InstanceId' --output text); while [ \"$current\" -lt \"$expected\" ]; do for i in $(echo $instances); do check=$(aws elbv2 describe-target-health --target-group-arn \"${aws_alb_target_group.target_group_this.arn}\" --query \"TargetHealthDescriptions[?Target.Id == '$i'].TargetHealth.State\" --output text); echo \"$check\"; if [ \"$check\" = \"$(echo 'healthy')\" ]; then current=\"$(echo $((++current)))\"; else current=\"$(echo $((--current)))\"; fi; done; if [ \"$current\" -eq \"$expected\" ]; then break; else current=\"0\"; retries=\"$((++retries))\" fi; if [ \"$retries\" = \"3\" ]; then break;fi; done"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue