Environments
drive-apig deploys to three stages across two AWS accounts.
| Stage | AWS account | AWS profile | API domain |
|---|---|---|---|
| dev | non-prod | aws-drive-staging-admin | dev-api.drivemustang.com.au |
| staging | non-prod | aws-drive-staging-admin | staging-api.drivemustang.com.au |
| prod | prod | aws-drive-prod-admin | api.drive.com.au |
Dev and staging share the non-prod account and *.drivemustang.com.au certificate. Prod is isolated on the prod account and api.drive.com.au.
Stage resolution
Serverless defaults to dev unless --stage is passed:
provider:
stage: ${opt:stage, 'dev'}Most resource names and SSM params are stage-prefixed:
Per-stage config
Service behavior toggles live under custom.app.* in each service's serverless.yml and are read with ${self:custom.app.<key>.${self:provider.stage}}.
Example from leads:
custom:
app:
rateLimitsEnabled:
dev: 0
staging: 1
prod: 0
emailMode:
dev: dryrun
staging: live
prod: live
enquiryEndpoints:
dev: https://staging-leads-api.drive.com.au/v1/
staging: https://staging-leads-api.drive.com.au/v1/
prod: https://leads-api.drive.com.au/v1/Tracing
The shared config enables Lambda tracing through TRACING_LAMBDA with a default of true; custom.tracing also records the intended stage policy:
custom:
tracing:
dev: false
staging: false
prod: trueOpenTelemetry export is configured for all stages through the shared collector and tags signals with deployment.environment.