Terraform will perform the following actions:
# aws_instance.example-list will be updated in-place
~ resource "aws_instance" "example-list" {
id = "i-0e0f189eb341d211f"
tags = {}
~ vpc_security_group_ids = [
- "sg-0541801a7a059ba17",
+ "default",
]
# (30 unchanged attributes hidden)
# (8 unchanged blocks hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
aws_instance.example-list: Modifying... [id=i-0e0f189eb341d211f]
╷
│ Error: updating EC2 Instance (i-0e0f189eb341d211f): modifying network interface: InvalidGroup.NotFound: The security group 'default' does not exist
│ status code: 400, request id: 0aaeef89-d273-470f-9a39-9e298de841c9
│
│ with aws_instance.example-list,
│ on list.tf line 7, in resource "aws_instance" "example-list":
│ 7: resource "aws_instance" "example-list" {
│
╵
Answer
USE Security Group ID instead of Security Group Name.

Latest posts by rajeshkumar (see all)
- Best DevOps is redefining the DevOps landscape - January 28, 2025
- Unlocking the Power of DevOps: How DevOps Consulting Drives Business Success - January 23, 2025
- DevOps Support: Ensuring Seamless Operations and Continuous Improvement - January 23, 2025