Skip to content

Commit

Permalink
aws.ec2.SecurityGroupRule: Ensure DeleteBeforeReplace
Browse files Browse the repository at this point in the history
The current implementation of SGRule means that only description
can be changed. Everything else on the resource is ForceNew by
default

Unfortunately, when a SGRule changes, we try and create a new rule
before deleting the old one. We can't create 2 rules of the same
in a SG therefore, we get an error

This ensures we delete the rule first before creating the new one
  • Loading branch information
stack72 committed Aug 17, 2022
1 parent 5e1b4ec commit f40cce9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,8 @@ func Provider() tfbridge.ProviderInfo {
},
},
"aws_security_group_rule": {
Tok: awsResource(ec2Mod, "SecurityGroupRule"),
Tok: awsResource(ec2Mod, "SecurityGroupRule"),
DeleteBeforeReplace: true,
Fields: map[string]*tfbridge.SchemaInfo{
"protocol": {
Type: "string",
Expand Down

0 comments on commit f40cce9

Please sign in to comment.