3.3.5 Manage Environments in AWS Services

Manage Environments in Individual AWS Services

API Gateway

FeatureDevStagingProd
Stage/dev/staging/prod
ThrottlingLowMediumHigh
LoggingFullFullErrors only
CachingOffOffOn

Lambda

FeatureDevProd
Alias→ $LATEST→ Version N
ConcurrencyUnreservedReserved
ProvisionedNoYes (if needed)
Env varsDev configProd config

DynamoDB

# Conditional capacity per environment
MyTable:
  Type: AWS::DynamoDB::Table
  Properties:
    BillingMode: !If [IsProd, PROVISIONED, PAY_PER_REQUEST]
    ProvisionedThroughput: !If
      - IsProd
      - ReadCapacityUnits: 100
        WriteCapacityUnits: 50
      - !Ref AWS::NoValue

Elastic Beanstalk

eb create my-app-dev --envvars STAGE=dev
eb create my-app-prod --envvars STAGE=prod
eb use my-app-dev     # Switch active environment

Parameter Store per Environment

/myapp/dev/db-host    → dev-db.example.com
/myapp/prod/db-host   → prod-db.example.com
/myapp/dev/log-level  → DEBUG
/myapp/prod/log-level → ERROR

Exam Tip: API Gateway stages for environment separation. Lambda aliases for version management. Parameter Store hierarchy for per-env config. CloudFormation Conditions for env-specific resources.