App needs to publish a business KPI (e.g. orders/min) to CloudWatch.
`PutMetricData` API with custom namespace + dimensions. For high-volume use embedded metric format (EMF) - write structured JSON to logs and CW extracts metrics automatically.
Embedded Metric Format (EMF). Log a structured event once; CW pulls metrics out of it. One log + one metric = cheaper than separate `PutMetricData` calls per dimension combo.
Page on-call only when BOTH high-error-rate AND low-traffic - not when either fires alone.
Composite alarm with rule expression `ALARM(errors) AND ALARM(low_traffic)`. Underlying alarms still fire individually but only the composite notifies SNS.
Centralize logs from 50 accounts into one security account.
Subscription filter on each source log group β Kinesis Data Streams or Firehose in the central account. CloudWatch cross-account observability for metrics + traces.
Run an ASG mostly on Spot to save cost but with a baseline of On-Demand for stability.
Mixed Instances Policy - launch template + base capacity (On-Demand) + percentage above base on Spot. Use multiple instance types for Spot diversification.
Use Launch Templates. AWS deprecated Launch Configurations for new ASGs; only LTs support newer features (warm pool, mixed instances, IMDSv2 enforcement, EBS gp3, etc.).
Long-lived connections drop when ALB removes a target during deploy.
Target group deregistration delay (default 300s, increase as needed). New requests stop flowing immediately; in-flight connections drain until delay expires.
Switch to Elastic Throughput mode (auto-scales). Or Provisioned Throughput for predictable workloads. Default Bursting is credit-based and runs out under sustained load.
Prevent accidental update to a critical resource (e.g. production RDS) inside a stack.
CloudFormation stack policy - IAM-style document allowing or denying `Update:*` on specific logical resource IDs. Applied to the stack, separate from IAM.
Run config + signal completion to CloudFormation from EC2 user-data.
cfn-init (config), cfn-signal (signal CreationPolicy), cfn-hup (apply metadata changes). CreationPolicy makes the stack wait for the signal before marking CREATE_COMPLETE.
Let dev teams self-serve approved infrastructure (e.g. VPC, S3 bucket) without giving full IAM.
AWS Service Catalog - admin publishes products (CFN templates), users launch via IAM permission to launch the product role, not the underlying resources.
OpsWorks Stacks is end-of-life. Migrate to AWS Systems Manager + native Chef/Puppet on EC2, or convert to ECS/EKS, or rebuild via SSM Automation + CFN.
Pick between nested stacks and cross-stack references.
Nested stacks: tightly coupled, lifecycle managed together (single update). Cross-stack `Export`/`ImportValue`: loosely coupled, independent lifecycles, exports immutable while imported.
Identify IAM users with access keys older than 90 days.
Generate Credential Report (`generate-credential-report` + `get-credential-report`). CSV with last-used + key-age per user. Combine with Access Analyzer for least-privilege review.
Audit all API calls across every account in the org with central storage.
Organization trail in management or delegated admin account. Single S3 bucket; covers all current + future member accounts; cannot be disabled by members.
Rotate KMS encryption keys without re-encrypting data.
Enable automatic key rotation on customer-managed CMKs (annual). KMS keeps old key material to decrypt existing ciphertexts; new encryptions use latest material.
AWS Config Conformance Pack - bundle of Config rules + remediation actions. Deploy via Config to all accounts via aggregator; org-level via management account.
NAT Gateway data-processing fees dominate the bill.
Move S3/DynamoDB traffic to gateway endpoints (free). Move other AWS service traffic to interface endpoints. For inter-VPC, use Transit Gateway / VPC peering instead of routing through NAT.
Maximize cache hit ratio for largely-static content.
Set `Cache-Control: max-age=...` on origin responses; configure CloudFront to forward only required cache keys (avoid forwarding all headers/cookies/query strings, which destroys cache effectiveness).
Block SQL injection + rate-limit aggressive clients on ALB.
AWS WAFv2 web ACL: AWS managed rule group `AWSManagedRulesSQLiRuleSet` + rate-based rule (e.g. 2000 req / 5 min per IP). Associate to ALB / API Gateway / CloudFront / AppSync.