My AWS Project builds a Docker Image, pushes it to ECR and then deploys it to an ECS container.
The source code is on CodeCommit, and I already have two working CDK Stacks to 1) Build the Docker image, and 2) Deploy to ECS.
I would like to setup a pipeline via CDK. If I use the console, it is very straightforward to setup the pipeline adding the “Build” and “Deploy” stages defined by the stacks.
If I want to setup the pipeline via CDK, I could use a CDK Python code like this one:
# Create a source action for CodeCommit
source_action = cpactions.CodeCommitSourceAction(
action_name="CodeCommit",
repository=codecommit.Repository(self, "SourceRepo",
repository_name=SOURCE_GIT_REPOSITORY),
branch=SOURCE_GIT_BRANCH
)
# Create a ShellStep for the synth action (BUT I DO NOT NEED THIS!!!)
synth_action = pipelines.ShellStep("Synth",
input=source_action.output,
commands=[])
# Create a new CodePipeline
pipeline = pipelines.CodePipeline(self, PIPELINE_NAME,
pipeline_name=PIPELINE_NAME,
synth=synth_action, # THIS IS NOT OPTIONAL!
self_mutation=False,
docker_enabled_for_synth=True
)
# Add the build stage
pipeline.add_stage(build_stack, "Build")
# Add the deploy stage
pipeline.add_stage(deploy_stack, "Deploy")
the problem is that the ‘synth’ parameter is required, but I definetely do not need it! What can I do to have my pipeline working without a “synth”? I just need to have source code, and then Build and Deploy stages.
What am I missing?