npm install -g np@latest
npm install -g aws-cdk@latest
cdk --version
Output:
2.16.0 (build 4c77925)
npm install
npm run test
Update stack props in stack/synth.ts
and commit
For consistence use CammelCase naming convention
APP_NAME=MyAppCamelCaseName
APP_DESCRIPTION="App description"
aws codecommit create-repository --repository-name ${APP_NAME}Stack --repository-description $APP_DESCRIPTION --profile default
command output:
{
"repositoryMetadata": {
...
"cloneUrlSsh": "ssh://git-codecommit.eu-west-1.amazonaws.com/v1/repos/NewOrderProductAppendStack",
...
}
}
Ensure you have valid ssh config for CodeCommit.
REPO_CLONE_URL=[cloneUrlSsh]
Replace host (git-codecommit.eu-west-1.amazonaws.com
) in cloneUrlSsh
to alias, if necessary.
Add origin
git remote add origin $REPO_CLONE_URL
Add stage
branch
git branch stage
Commit all current changes.
Push to master
git push --set-upstream origin master
Push to stage
git push origin stage
Once for each deploy region in current account,
npx cdk bootstrap --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess --profile default
or specific account
npx cdk bootstrap aws://ACCOUNT-NUMBER/REGION --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess --profile default
Get current ACCOUNT-NUMBER
aws sts get-caller-identity
aws sts get-caller-identity --profile default
Get current REGION
aws configure get region
aws configure get region --profile prod
np
Ensure all configs and secrets described in README is existsy.
PROFILE=default npm run deploy