Circular dependency problem with self-mutating CDK pipeline and ECS Fargate #22947
Unanswered
suavelizard
asked this question in
Q&A
Replies: 1 comment
-
Can Lazy be used to get around this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
TL;DR All I want to is to write CDK code to create a service + pipeline to deploy the service but cannot because of circular dependency
I have a CDK project with 2 stacks
This CDK project is attempting to do the following
1 - Create all resources via CDK (ECS cluster app, Loadbalancer, ECR, Pipeline etc.)
2 - Deploy changes in a self mutating pipeline
The problems arise when I attempt to do the following:
new PipelineStack()
-> Pulls CDK code
-> Creates ECR Repo
-> Creates Pipeline
-> Adds ECRDeployment action
new ApplicationStack()
-> Creates ECS Service
-> Reads from ECR
-> Runs Container with ECR image
I encounter an issue where the deployment and the creation of the services conflict:
and
The service needs the ECR respository to exist and the ECSDeploy needs the service to exist.
How can I automate this? I havent found any examples which is surprising since deploying a self mutating pipeline that updates an ECS service seems like a common usecase.
Solutions like this do not seem to work in CDKV2 (PR here: flochaz@3fdb78e#diff-774d4642172b82145ae731a64631ebcbbde6d0af076c8ea23bb8cb33c21aa400)
Similar:
Beta Was this translation helpful? Give feedback.
All reactions