-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Labels
bugAddresses a defect in current functionality.Addresses a defect in current functionality.service/ec2Issues and PRs that pertain to the ec2 service.Issues and PRs that pertain to the ec2 service.
Milestone
Description
When using aws_security_group and removing an egress statement; Terraform does not reflect the change. It works fine when adding it; however removing it is completely ignored.
I am unsure how aws_security_group_rule works in this case. I would assume it works fine as it is an individual resource.
Terraform Version
Terraform v0.10.2
Affected Resource(s)
Please list the resources as a list, for example:
- aws_security_group
Terraform Configuration Files
resource "aws_security_group" "a_security_group" {
name = "a_security_group"
vpc_id = "vpc-abcd1234"
ingress {
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
tags {
Name = "a_security_group"
}
}
Expected Behavior
- Create security group with egress rule, and
terraform apply - Group is created
- Remove egress rule and run
terraform apply - Security group exists with all rules; however egress rule is removed
Actual Behavior
- Egress rule is still there; Terraform makes no mention of it.
Steps to Reproduce
- Create security group with any rules you want, add an egress rule as mentioned in the HCL above.
- terraform apply
- Remove the egress statement
- terraform apply
dmlemos, thomasbiddle, dlcc, pmoust, MarkitectRoss and 19 more
Metadata
Metadata
Assignees
Labels
bugAddresses a defect in current functionality.Addresses a defect in current functionality.service/ec2Issues and PRs that pertain to the ec2 service.Issues and PRs that pertain to the ec2 service.