@mapbox/cloudfriend-to-cdk
Description
This package is meant to use in cloudfriend projects and make these stacks
compatible with cdk-aio workflow.
Getting Started
Installing
- npm install @mapbox/cloudfriend-to-cdk "@mapbox/cloudfriend-to-cdk":
"file:../cloud-platform/cloudfriend-aio/cloudfriend-to-cdk-0.1.0.tgz",
Deploy via Github Actions
Follow
this
guide to configure the cdk-aio workflow.
File location and other parameters are passed to cdk-aio via context arguments.
The required context arguments are environment (passed by default),
cloudfriendFile, and parametersFile. Check out the example below for how you
might configure the cdk.deploy.yml
that orchestrates cdk-aio.
environments:
my-api-staging:
environment: staging
account-id: AWS_ACCOUNT_ID_SHARED_SVC_STG
aws-login-region: us-east-2
require-approval: true
diff-refs:
- refs/pull/.+/merge
additional-args:
- -c cloudfriendFile=test/cloudformation/my-api.template.js
- -c parametersFile=test/cloudformation/my-api.parameters.staging.json
my-api-production:
environment: staging
account-id: AWS_ACCOUNT_ID_SHARED_SVC_PROD
aws-login-region: us-east-2
require-approval: true
diff-refs:
- refs/heads/main
additional-args:
- -c cloudfriendFile=test/cloudformation/my-api.template.js
- -c parametersFile=test/cloudformation/my-api.parameters.production.json
Deploy Locally
You can mimic cdk-aio by using the cdk cli directly. Note that this wont include
any extras like slack notifications or reports. For a full guide to cdk cli
commands check out this doc
npx cdk deploy -a "npx ts-node src/index.ts" \
-c environment=staging \
-c cloudfriendFile=test/cloudformation/api-rasterarrays.template.js \
-c parametersFile=test/cloudformation/api-rasterarrays.staging.parameters.json
/
FAQ's