Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(aws-ecs): Update Fargate service with new image tag using typescript cdk code #15300

Closed
revanthalampally opened this issue Jun 24, 2021 · 4 comments
Assignees
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container guidance Question that needs advice or information.

Comments

@revanthalampally
Copy link

revanthalampally commented Jun 24, 2021

I'm trying to update my already created ECS service with a new task definition with typescript cdk But I do not find any ECS.FargateService.Update methods.
What is the best way to update my service in this case?

The reason I need to do this is:
I m trying to achieve Blue-Green deployment whenever my image tag changes in the service. Whenever I try to do a CDK deploy with a new image tag, I get:
Resource handler returned message: "Invalid request provided: UpdateService error: Unable to update task definition on services with a CODE_DEPLOY deployment controller. Use AWS CodeDeploy to trigger a new deployment. (Service: AmazonECS; Status Code: 4
After some reading, I found that CDK deploy tries to change the same task revision which won't work with the BLUE GREEN controller.

Hence I thought of manually writing my own stack to update service consisting of:

  1. Create a new task revision with a new image tag
  2. Update service manually to the new task revision
    Basically, implementing whatever I do from the UI to trigger a Blue-Green Deployment.
    But I am stuck in completing writing step 2 since there is not an option in the CDK code. Wondering if anyone has done this before?

Environment

  • **CDK CLI Version:< 1.95.1 (build ed2bbe6)>
  • **aws-ecs: <1.97.0>
@revanthalampally revanthalampally added guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged. labels Jun 24, 2021
@revanthalampally revanthalampally changed the title (module name): short issue description (aws-ecs): Update Fargate service with new image tag using typescript cdk code Jun 24, 2021
@github-actions github-actions bot added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label Jun 24, 2021
@revanthalampally
Copy link
Author

@SoManyHs / @uttarasridhar : Can I know if there is any workaround? Or if I am doing anything wrong?

@revanthalampally
Copy link
Author

Can anyone please reply to this?

@NGL321 NGL321 removed the needs-triage This issue or PR still needs to be triaged. label Jul 23, 2021
@peterwoodworth
Copy link
Contributor

peterwoodworth commented Dec 27, 2021

Sorry no one has replied to this @revanthalampally,

ECS b/g deployments are really tricky for the CDK to handle, since under the hood CloudFormation's blue/green deployments have some limitations. Please read this thread for more info #1559, I'll be closing this issue in favor of that

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

6 participants