Skip to content

Instantly share code, notes, and snippets.

View jmparsons's full-sized avatar

Jonathan Parsons jmparsons

View GitHub Profile
@alexpulver
alexpulver / toolchain.py
Last active November 12, 2021 07:12
Enable CodeBuild cache for CDK Pipelines synth step
synth_codebuild_step = pipelines.CodeBuildStep(...)
codepipeline = pipelines.CodePipeline(
self,
"CodePipeline",
synth=synth_codebuild_step,
)
# That should be called at the end of the pipeline definition, because the pipeline can't be changed afterwards
codepipeline.build_pipeline()
synth_cfn_project: codebuild.CfnProject = codepipeline.synth_project.node.default_child
synth_cfn_project.cache = codebuild.CfnProject.ProjectCacheProperty(type="LOCAL", modes=["LOCAL_SOURCE_CACHE"])