I have my production infrastructure deployed via CDK pipelines.CodePipeline. This is a CDK construct that uses AWS CodePipeline service to deploy CDK apps.
Since this is fully managed, I don't need to put cdk deploy
command in the pipeline stage, and it automatically builds it for me.
Unfortunately, it doesn't seem to have an option to disable auto-rollback. Does it?
My code:
from aws_cdk import pipelines
# ... builds cdk synth
pipeline = pipelines.CodePipeline(
self,
"Pipeline",
cli_version=Toolchain._get_cdk_cli_version(),
cross_account_keys=True,
docker_enabled_for_synth=True,
publish_assets_in_parallel=False,
synth=synth,
)
production = cdk.Stage(
pipeline,
PRODUCTION_ENV_NAME,
env=cdk.Environment(account=PRODUCTION_ENV_ACCOUNT, region=PRODUCTION_ENV_REGION),
)
Backend(
production,
constants.APP_NAME + PRODUCTION_ENV_NAME,
env=cdk.Environment(account=PRODUCTION_ENV_ACCOUNT, region=PRODUCTION_ENV_REGION),
stack_name=constants.APP_NAME + PRODUCTION_ENV_NAME,
github_branch="production",
image_tag="prod",
)
pipeline.add_stage(production)