A routine `terraform apply` replaced a security group and the site went down for 4 minutes.
IntermediateTroubleshootingSite down
Answer
Likely causes → A change to an immutable attribute (name, description, vpc_id) forces -/+ destroy and then create replacement. The ENIs lost the old group before the new one attached, or inline rules and aws_security_group_rule resources fought each other.
Diagnose → Read the plan output in the CI log for must be replaced and # forces replacement. Check CloudTrail for DeleteSecurityGroup and RevokeSecurityGroupIngress at the outage time.
Fix → Re-apply the rules (or roll back the code), confirm targets are healthy.
Prevent →
lifecycle { create_before_destroy = true }
Use name_prefix instead of name, fail CI on any replacement of network resources without explicit approval, and use aws_vpc_security_group_ingress_rule resources instead of inline rules.
More on Site down
Every user reports "This site can't be reached — ERR_NAME_NOT_RESOLVED" for your domain.BeginnerRight after a deploy, nginx returns "502 Bad Gateway" on every page.BeginnerALB returns "503 Service Temporarily Unavailable" and the target group shows 0 healthy targets.Beginner`curl https://app.example.com` hangs and ends with "Connection timed out" on port 443.BeginnerAfter a Helm upgrade, the ingress returns "default backend - 404" for your domain.IntermediateAll pods are Running and Ready, but the Service has no endpoints and traffic fails.Intermediate