AWS ECS scheduled scaling with terraform












0















We are using terraform to schedule more containers to ECS cluster



The problem is that a new deployment (terraform apply) will make the scheduled containers to be terminated



i.e if we schedule more containers to 15 PM and scale down to 20 PM, if we run terraform apply at 16 PM - the containers launched at 15 PM will be terminated



any suggestions?










share|improve this question























  • I am not sure how it works for ECS, but I think it's quite similar to ASG. In ASG when terraform recreate it, there is no way to preserve the latest ASG scale out. We need to do it manually right after the terraform apply

    – shakhawat
    Nov 21 '18 at 16:15
















0















We are using terraform to schedule more containers to ECS cluster



The problem is that a new deployment (terraform apply) will make the scheduled containers to be terminated



i.e if we schedule more containers to 15 PM and scale down to 20 PM, if we run terraform apply at 16 PM - the containers launched at 15 PM will be terminated



any suggestions?










share|improve this question























  • I am not sure how it works for ECS, but I think it's quite similar to ASG. In ASG when terraform recreate it, there is no way to preserve the latest ASG scale out. We need to do it manually right after the terraform apply

    – shakhawat
    Nov 21 '18 at 16:15














0












0








0








We are using terraform to schedule more containers to ECS cluster



The problem is that a new deployment (terraform apply) will make the scheduled containers to be terminated



i.e if we schedule more containers to 15 PM and scale down to 20 PM, if we run terraform apply at 16 PM - the containers launched at 15 PM will be terminated



any suggestions?










share|improve this question














We are using terraform to schedule more containers to ECS cluster



The problem is that a new deployment (terraform apply) will make the scheduled containers to be terminated



i.e if we schedule more containers to 15 PM and scale down to 20 PM, if we run terraform apply at 16 PM - the containers launched at 15 PM will be terminated



any suggestions?







amazon-web-services terraform amazon-ecs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 '18 at 14:46









gCohgCoh

625624




625624













  • I am not sure how it works for ECS, but I think it's quite similar to ASG. In ASG when terraform recreate it, there is no way to preserve the latest ASG scale out. We need to do it manually right after the terraform apply

    – shakhawat
    Nov 21 '18 at 16:15



















  • I am not sure how it works for ECS, but I think it's quite similar to ASG. In ASG when terraform recreate it, there is no way to preserve the latest ASG scale out. We need to do it manually right after the terraform apply

    – shakhawat
    Nov 21 '18 at 16:15

















I am not sure how it works for ECS, but I think it's quite similar to ASG. In ASG when terraform recreate it, there is no way to preserve the latest ASG scale out. We need to do it manually right after the terraform apply

– shakhawat
Nov 21 '18 at 16:15





I am not sure how it works for ECS, but I think it's quite similar to ASG. In ASG when terraform recreate it, there is no way to preserve the latest ASG scale out. We need to do it manually right after the terraform apply

– shakhawat
Nov 21 '18 at 16:15












1 Answer
1






active

oldest

votes


















0














We ended up scheduling the scale up action for every minute during that time



This means that if a new deployment is launched - it will be validated that the number of desired containers is right






share|improve this answer
























  • Why is terraform used for the deployment as well? It makes sense to scale up using Terraform, but deploying through ECS can be done using just the aws cli which will leave your EC2 instances alone, using e.g. ecs-deploy (boto3) or ecs-deploy (shell)

    – Tiemen
    Dec 3 '18 at 16:14











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53414578%2faws-ecs-scheduled-scaling-with-terraform%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














We ended up scheduling the scale up action for every minute during that time



This means that if a new deployment is launched - it will be validated that the number of desired containers is right






share|improve this answer
























  • Why is terraform used for the deployment as well? It makes sense to scale up using Terraform, but deploying through ECS can be done using just the aws cli which will leave your EC2 instances alone, using e.g. ecs-deploy (boto3) or ecs-deploy (shell)

    – Tiemen
    Dec 3 '18 at 16:14
















0














We ended up scheduling the scale up action for every minute during that time



This means that if a new deployment is launched - it will be validated that the number of desired containers is right






share|improve this answer
























  • Why is terraform used for the deployment as well? It makes sense to scale up using Terraform, but deploying through ECS can be done using just the aws cli which will leave your EC2 instances alone, using e.g. ecs-deploy (boto3) or ecs-deploy (shell)

    – Tiemen
    Dec 3 '18 at 16:14














0












0








0







We ended up scheduling the scale up action for every minute during that time



This means that if a new deployment is launched - it will be validated that the number of desired containers is right






share|improve this answer













We ended up scheduling the scale up action for every minute during that time



This means that if a new deployment is launched - it will be validated that the number of desired containers is right







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 21 '18 at 16:11









gCohgCoh

625624




625624













  • Why is terraform used for the deployment as well? It makes sense to scale up using Terraform, but deploying through ECS can be done using just the aws cli which will leave your EC2 instances alone, using e.g. ecs-deploy (boto3) or ecs-deploy (shell)

    – Tiemen
    Dec 3 '18 at 16:14



















  • Why is terraform used for the deployment as well? It makes sense to scale up using Terraform, but deploying through ECS can be done using just the aws cli which will leave your EC2 instances alone, using e.g. ecs-deploy (boto3) or ecs-deploy (shell)

    – Tiemen
    Dec 3 '18 at 16:14

















Why is terraform used for the deployment as well? It makes sense to scale up using Terraform, but deploying through ECS can be done using just the aws cli which will leave your EC2 instances alone, using e.g. ecs-deploy (boto3) or ecs-deploy (shell)

– Tiemen
Dec 3 '18 at 16:14





Why is terraform used for the deployment as well? It makes sense to scale up using Terraform, but deploying through ECS can be done using just the aws cli which will leave your EC2 instances alone, using e.g. ecs-deploy (boto3) or ecs-deploy (shell)

– Tiemen
Dec 3 '18 at 16:14




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53414578%2faws-ecs-scheduled-scaling-with-terraform%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to pass form data using jquery Ajax to insert data in database?

National Museum of Racing and Hall of Fame

Guess what letter conforming each word