Skip to content

AWS Credentials & Bootstrap

Open in ChatGPTOpen in Claude

An Axis project is a standard AWS CDK app — deploying it needs AWS credentials, a region, and a one-time cdk bootstrap per account/region pair. Nothing here is Axis-specific magic; Axis just makes the environment selection explicit and typed.

Use whichever standard AWS credential mechanism your team already uses — the CDK CLI picks them up like any AWS tool:

  • Named profiles in ~/.aws/credentials / ~/.aws/config, selected with AWS_PROFILE=myprofile or --profile myprofile on cdk commands.
  • AWS IAM Identity Center (SSO) via aws sso login with a configured profile.
  • Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN) — typical for CI.

Never commit credentials to the project. The scaffolded .gitignore and the token rules from Install apply the same discipline to AWS secrets: long-lived keys don’t belong in the repository, in project config files, or in shell rc files.

Every Axis project ships typed per-environment config in config/dev-config.ts and config/prod-config.ts, selected at synth time through CDK context and loaded by config/loader.ts (createEnvLoader):

Terminal window
npx cdk synth --context env=dev

The environment name flows through BaseEnvConfig.stageName into physical resource names (${baseName}-${stageName}), SSM parameter paths, and removal policies (dev tears down cleanly; prod retains stateful resources). Before your first deploy, open config/dev-config.ts and review the values the scaffold seeded — app name, region, and any starter-specific settings.

CDK needs a small set of bootstrap resources (an asset bucket and deployment roles) in each account/region combination before the first deploy. From the project root:

Terminal window
npx cdk bootstrap --context env=dev

This is the same command the CLI prints in its post-scaffold next steps. Run it once per account/region; re-running is a safe no-op that upgrades the bootstrap stack if needed.

The scaffolded package.json wraps the common CDK invocations so the environment context is never forgotten:

{
"cdk:synth": "cdk synth",
"cdk:diff": "cdk diff --context env=dev",
"cdk:deploy": "cdk deploy --all --context env=dev"
}
Terminal window
pnpm run cdk:deploy

Deploy order between stacks does not need hand-holding: cross-stack references travel through SSM Parameter Store, not CloudFormation exports, so stacks stay independently deployable. See Stacks & SSM Wiring for the model.

Walk the whole loop end-to-end in the Tutorial.

© 2026 Axis Tech. Powered by axis-tech.co.