Detaching an internet gateway fails: `Network vpc-0abc has some mapped public address(es). Please unmap those public address(es) before detaching the gateway.`
IntermediateTroubleshootingAuthentication and Cloud API Errors
Answer
Likely causes → Elastic IPs or public IPs (NAT gateways, instances, load balancers) are still in the VPC, possibly not managed by this stack.
Diagnose → aws ec2 describe-addresses --filters Name=domain,Values=vpc and check NAT gateways in the VPC.
Fix → Delete NAT gateways/EIPs/instances first, then destroy again. Make the IGW explicitly depend on nothing that outlives it.
Prevent → Keep the network stack's dependents in other stacks destroyed first.
More on Authentication and Cloud API Errors
`Error: No valid credential sources found` followed by `no EC2 IMDS role found ... context deadline exceeded`.Beginner`Error: Cannot assume IAM Role` — `api error AccessDenied: User: arn:aws:iam::111111111111:user/ci is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::222222222222:role/terraform`.IntermediateGitHub Actions: `Could not assume role with OIDC: Not authorized to perform sts:AssumeRoleWithWebIdentity`.IntermediateGitHub Actions log says `It looks like you might be trying to authenticate with OIDC. Did you mean to set the id-token permission?`BeginnerApplies that run longer than an hour fail with `ExpiredToken: The security token included in the request is expired`.Intermediate`InvalidClientTokenId: The security token included in the request is invalid.`Beginner