[ecs] Circular dependency between EcsDeployAction and Fargate cluster
See original GitHub issueWhen trying to create ECS cluster with image pipeline together, it can form an annoying dependency:
ECS initialization require the image, the image is not there until the pipeline is created and run for once, the pipeline has a EcsDeployAction depending on ECS as deployment target, eventually ECS will wait for the image until timeout:
this.alBFargate = new ecs_patterns.ApplicationLoadBalancedFargateService(this, props.appName, {
cluster: ecsCluster,
taskImageOptions: {
image: ecs.ContainerImage.fromEcrRepository(ecrRepo)
}
})
// . . .
const imgBuildPipeline = new pipeline.Pipeline(this, 'broadworks-auth-pipeline', {
pipelineName: id + '-build-deploy-IMG',
stages: [
{
stageName: 'Build',
actions: [
new pipelineActions.CodeBuildAction({
actionName: 'Img_Build',
project: broadworksAuthBuild,// deploy to ecrRepo
input: sourceOutput,
outputs: [cdkBuildOutput],
}),
],
},
{
stageName: 'Deploy',
actions: [
new pipelineActions.EcsDeployAction({
actionName: 'deployToECS',
service: this.alBFargate.service,
input: cdkBuildOutput
}),
],
}
],
});
I would expect that the ECS cluster can finish initialization without any image.
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:14 (6 by maintainers)
Top Results From Across the Web
aws-cdk/aws-ecs module - AWS Documentation
The following code imports an existing cluster using the ARN which can be used to import an Amazon ECS service either EC2 or...
Read more >How do I resolve this circular reference in AWS ...
Sharing an update from the GitHub issue. The circular dependency has been broken by introducing a new resource: Cluster Capacity Provider ...
Read more >Deploying updates to ECS Fargate services for every ECR ...
How to setup your AWS ECS Fargate service so it automatically gets re-deployed once its ECR image gets updated for continuous delivery with ......
Read more >AWS re:Invent 2019: [REPEAT] Best practices for CI/CD using ...
AWS re:Invent 2019: [REPEAT] Best practices for CI/CD using AWS Fargate and Amazon ECS (CON333-R). 25K views 3 years ago AWS re:Invent 2019 ......
Read more >@aws-cdk/aws-ecs | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My workaround is to split the pipeline into two, the 1st build and push the image into ECR, the 2nd use triggered by the ECR with EcrSourceAction and deploy to ECS.
On Sat, Nov 7, 2020 at 11:47 AM Gary Y flashflexpro@gmail.com wrote:
⚠️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.