aws:SourceIp, aws:RequestedRegion, MFA required, etc.ec2:TerminateInstances, no IAM policy can allow itsts:AssumeRole requests temporary credentials from AWS STS to act as a different role. For cross-account:
aws sts assume-role --role-arn arn:aws:iam::ACCOUNT_B:role/MyRoleAccessKeyId, SecretAccessKey, and SessionToken (valid 15 min – 12 hrs)0.0.0.0/0 pointing to a NAT Gateway (not IGW)?0.0.0.0/0 → IGW?enableDnsSupport and enableDnsHostnames true on the VPC?buildspec.yml. Scales to zero between builds. Outputs artifacts to S3.mainbuildspec.yml under env.secrets-manager or env.parameter-store — CodeBuild fetches and injects at runtimeenv:\n secrets-manager:\n MY_TOKEN: "arn:aws:secretsmanager:..."
aws ecs describe-tasks on a stopped task — stoppedReason and containers[].reason often tell you everything.exit 1 — application errorexit 137 — OOM kill (SIGKILL). Increase memory reservation.exit 143 — SIGTERM received, app didn't handle graceful shutdown fast enoughAccessDeniedException in logs → task role missing permissions.
taskRoleArn in the task definitionexecutionRoleArn — the execution role is used by ECS agent to pull images and write to CloudWatch; the task role is used by your application codeterraform plan output and how do you read it?
terraform plan shows the diff between current state and desired state. Symbol key:
+ — resource will be created- — resource will be destroyed~ — resource will be updated in-place-/+ — resource will be destroyed and recreated (forces replacement)forces replacement annotations — these indicate that changing this attribute requires the resource to be deleted and re-created, which can cause downtime or data loss (e.g., changing an RDS storage type, renaming a security group).
-/+ symbols on stateful resources like RDS, ElastiCache, and ASGs.terraform.tfstate in S3 (with versioning enabled). Never commit state to Git.backend "s3" block with dynamodb_table.terraform plan will show the drift as a diff — it'll want to revert the manual change back to what's in code.terraform apply to bring reality back to the declared state. Correct if the manual change was unauthorized.terraform apply (should show no changes).terraform import: For resources created entirely outside Terraform that you now want to manage, import them into state.terraform plan in CI on a schedule (drift detection).
Errors metric for the function. Set threshold, evaluation periods, and datapoints-to-alarm to avoid noise.Throttles and Duration alongside Errors — throttles spike before errors become visible.TargetResponseTime P99 in CloudWatch. Is the latency at the ALB or inside the target?DatabaseConnections, ReadLatency, WriteLatency, CPUUtilization, FreeableMemory. Use RDS Performance Insights to see query-level breakdown — often a missing index or N+1 query.amazon-cloudwatch-agent.json to tail log files and stream to CloudWatch Log Groups./app/myservice/prod