Parameter | Default | Description |
---|---|---|
AWS_PROFILE | default |
Current AWS profile |
STACK_ACCOUNT_NUMBER | AWS account number (aws sts get-caller-identity --profile default ) |
|
STACK_REGION | eu-west-1 |
AWS region (aws configure get region --profile prod ) |
Last active
March 17, 2022 12:00
-
-
Save wmakeev/cd709af0a8ba56dc85aa5d8abfb779ac to your computer and use it in GitHub Desktop.
[AWS CDK stack (rev.2)] #template #aws #cdk #stack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AWS CDK | |
npm i -E aws-cdk-lib constructs | |
# dependencies | |
npm i envalid lodash.once |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/cdk.out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# npm | |
.npmrc | |
# build | |
/layer | |
#cdk | |
/cdk.out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
name: "%PROJECT_NAME%-stack", | |
private: true, | |
publishConfig: undefined, | |
scripts: { | |
"cleanup": $.scripts['cleanup'] + " && rm -rf __", | |
"build:layer": "touch .npmrc && LAYER_DIR=layer/dependencies && rm -rf $LAYER_DIR && mkdir -p \"${LAYER_DIR}/nodejs\" && cp package.json \"${LAYER_DIR}/nodejs\" && cp .npmrc \"${LAYER_DIR}/nodejs\" && npm install --production --prefix \"${LAYER_DIR}/nodejs\" && rm \"${LAYER_DIR}/nodejs/package.json\" && rm \"${LAYER_DIR}/nodejs/package-lock.json\" && rm \"${LAYER_DIR}/nodejs/.npmrc\"", | |
"build:app:dev": $.scripts['build:dev'], | |
"build:app": $.scripts['build'], | |
"build:stack": "npm run cdk:synth", | |
"build": "npm run build:app && npm run build:layer && npm run build:stack", | |
"test:app": "npm run build:app && NODE_OPTIONS=--enable-source-maps node -r dotenv/config ./build/test", | |
"test": "npm run build && NODE_OPTIONS=--enable-source-maps node -r dotenv/config ./build/test", | |
"version": "npm run env:example && auto-changelog -p && git add CHANGELOG.md .env.example", | |
"release": "np", | |
"release:stage": "npm run test:app && npm run build:stack && git push origin stage", | |
"deploy": "npx cdk deploy --all --profile $PROFILE" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"app": "NODE_OPTIONS=--enable-source-maps node build/stack/synth.js", | |
"context": { | |
"@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true, | |
"@aws-cdk/core:stackRelativeExports": true, | |
"@aws-cdk/aws-rds:lowercaseDbIdentifier": true, | |
"@aws-cdk/aws-lambda:recognizeVersionProps": true, | |
"@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": true, | |
"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true, | |
"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true, | |
"@aws-cdk/core:target-partitions": [ | |
"aws", | |
"aws-cn" | |
] | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SHOULD BE EMPTY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment