Skip to content

Instantly share code, notes, and snippets.

@alexpulver
Last active November 12, 2021 07:12
Show Gist options
  • Save alexpulver/8f1225d15266ee74d9862be88fd5382f to your computer and use it in GitHub Desktop.
Save alexpulver/8f1225d15266ee74d9862be88fd5382f to your computer and use it in GitHub Desktop.
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"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment