Skip to content

Instantly share code, notes, and snippets.

@wcheek
Created September 27, 2023 03:00
Show Gist options
  • Save wcheek/384ab30e42b541d6691e2aa2789fa009 to your computer and use it in GitHub Desktop.
Save wcheek/384ab30e42b541d6691e2aa2789fa009 to your computer and use it in GitHub Desktop.
AWS CDK Python with NodeJS Dependencies
from aws_cdk importpipelines
# This pipeline deploys a cdk stack
pipeline = pipelines.CodePipeline(
scope=self,
id="Pipeline",
code_build_defaults=code_build,
synth=pipelines.ShellStep(
id="Synth",
input=pipelines.CodePipelineSource.git_hub(
repo_string="MYREPO",
branch="main",
authentication=github_secret.secret_value_from_json(
key="github_access_token"
),
trigger=GitHubTrigger.WEBHOOK,
),
commands=[
"npm install -g aws-cdk",
"npm i", # Essential if you want your NodeJSFunctions to have access to dependencies defined in the root package.json file
"python -m pip install -r requirements.txt",
"cdk synth",
],
),
docker_enabled_for_synth=True,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment