Skip to content

Commit

Permalink
Update on Default value for rack Param EcsContainerStopTimeout (#3747)
Browse files Browse the repository at this point in the history
* added rack param ecs_container_stop_timeout

* changed default value of EcsContainerStopTimeout param

* adding conditional logic on parameter
  • Loading branch information
numcys authored Nov 11, 2024
1 parent c56d732 commit 4a9b7ed
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions provider/aws/formation/rack.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"BlankExistingVpcAndThirdAvailabilityZone": {
"Fn::And": [ { "Condition": "BlankExistingVpc" }, { "Condition": "ThirdAvailabilityZone" } ]
},
"HasEcsContainerStopTimeout": { "Fn::Not": [ { "Fn::Equals": [ { "Ref": "EcsContainerStopTimeout" }, "" ] } ] } ,
"BlankInstanceBootCommand": { "Fn::Equals": [ { "Ref": "InstanceBootCommand" }, "" ] },
"BlankInstancePolicy": { "Fn::Equals": [ { "Ref": "InstancePolicy" }, "" ] },
"BlankInstanceRunCommand": { "Fn::Equals": [ { "Ref": "InstanceRunCommand" }, "" ] },
Expand Down Expand Up @@ -787,6 +788,10 @@
"Default": "default",
"AllowedValues": ["default", "always", "once", "prefer-cached"]
},
"EcsContainerStopTimeout": {
"Type": "String",
"Description": "The behavior used to customize the timeout on when a container is forcibly stopped by sending a SIGTERM signal to the container. See ECS_CONTAINER_STOP_TIMEOUT https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html"
},
"IMDSHttpTokens": {
"Type": "String",
"Description": "You can set EC2 instances to use only v2 by setting IMDSHttpTokens as 'required', see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html#configuring-IMDS-new-instances",
Expand Down Expand Up @@ -1923,6 +1928,12 @@
] },
" - echo ECS_CLUSTER=", { "Ref": "BuildCluster" }, " >> /etc/ecs/ecs.config\n",
" - echo ECS_IMAGE_PULL_BEHAVIOR=", { "Ref": "ImagePullBehavior" }, " >> /etc/ecs/ecs.config\n",
{ "Fn::If": [ "HasEcsContainerStopTimeout",
{ "Fn::Join": [ "", [
" - echo ECS_CONTAINER_STOP_TIMEOUT=", { "Ref": "EcsContainerStopTimeout" }, " >> /etc/ecs/ecs.config\n"
] ] },
{ "Ref": "AWS::NoValue" }
] },
" - echo ECS_ENGINE_AUTH_TYPE=docker >> /etc/ecs/ecs.config\n",
" - echo 'ECS_INSTANCE_ATTRIBUTES={\"asg\":\"build\"}' >> /etc/ecs/ecs.config\n",
" - echo HTTP_PROXY=", { "Ref": "HttpProxy" }, " >> /etc/ecs/ecs.config\n",
Expand Down Expand Up @@ -2165,6 +2176,12 @@
] },
" - [ cloud-init-per, instance, docker_storage_setup, /usr/bin/docker-storage-setup ]\n",
" - echo ECS_CLUSTER=", { "Ref": "Cluster" }, " >> /etc/ecs/ecs.config\n",
{ "Fn::If": [ "HasEcsContainerStopTimeout",
{ "Fn::Join": [ "", [
" - echo ECS_CONTAINER_STOP_TIMEOUT=", { "Ref": "EcsContainerStopTimeout" }, " >> /etc/ecs/ecs.config\n"
] ] },
{ "Ref": "AWS::NoValue" }
] },
" - echo ECS_ENABLE_CONTAINER_METADATA=true >> /etc/ecs/ecs.config\n",
" - echo ECS_ENGINE_AUTH_TYPE=docker >> /etc/ecs/ecs.config\n",
" - echo 'ECS_INSTANCE_ATTRIBUTES={\"asg\":\"primary\"}' >> /etc/ecs/ecs.config\n",
Expand Down Expand Up @@ -2724,6 +2741,12 @@
] },
" - [ cloud-init-per, instance, docker_storage_setup, /usr/bin/docker-storage-setup ]\n",
" - echo ECS_CLUSTER=", { "Ref": "Cluster" }, " >> /etc/ecs/ecs.config\n",
{ "Fn::If": [ "HasEcsContainerStopTimeout",
{ "Fn::Join": [ "", [
" - echo ECS_CONTAINER_STOP_TIMEOUT=", { "Ref": "EcsContainerStopTimeout" }, " >> /etc/ecs/ecs.config\n"
] ] },
{ "Ref": "AWS::NoValue" }
] },
" - echo ECS_ENABLE_CONTAINER_METADATA=true >> /etc/ecs/ecs.config\n",
" - echo ECS_ENABLE_SPOT_INSTANCE_DRAINING=true >> /etc/ecs/ecs.config\n",
" - echo ECS_ENGINE_AUTH_TYPE=docker >> /etc/ecs/ecs.config\n",
Expand Down Expand Up @@ -3080,6 +3103,12 @@
] },
" - [ cloud-init-per, instance, docker_storage_setup, /usr/bin/docker-storage-setup ]\n",
" - echo ECS_CLUSTER=", { "Ref": "Cluster" }, " >> /etc/ecs/ecs.config\n",
{ "Fn::If": [ "HasEcsContainerStopTimeout",
{ "Fn::Join": [ "", [
" - echo ECS_CONTAINER_STOP_TIMEOUT=", { "Ref": "EcsContainerStopTimeout" }, " >> /etc/ecs/ecs.config\n"
] ] },
{ "Ref": "AWS::NoValue" }
] },
" - echo ECS_ENABLE_CONTAINER_METADATA=true >> /etc/ecs/ecs.config\n",
" - echo ECS_ENABLE_SPOT_INSTANCE_DRAINING=true >> /etc/ecs/ecs.config\n",
" - echo ECS_ENGINE_AUTH_TYPE=docker >> /etc/ecs/ecs.config\n",
Expand Down

0 comments on commit 4a9b7ed

Please sign in to comment.