diff --git a/.changelog/22315.txt b/.changelog/22315.txt new file mode 100644 index 00000000000..98b7122cdc8 --- /dev/null +++ b/.changelog/22315.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_ec2_traffic_mirror_filter_rule: Prevent crash during resource read +``` \ No newline at end of file diff --git a/internal/service/ec2/traffic_mirror_filter_rule.go b/internal/service/ec2/traffic_mirror_filter_rule.go index 1e772bd4bc8..4466b4cc64b 100644 --- a/internal/service/ec2/traffic_mirror_filter_rule.go +++ b/internal/service/ec2/traffic_mirror_filter_rule.go @@ -356,7 +356,7 @@ func buildTrafficMirrorFilterRulePortRangeSchema(portRange *ec2.TrafficMirrorPor return nil } - var out [1]interface{} + out := make([]interface{}, 1) elem := make(map[string]interface{}) elem["from_port"] = portRange.FromPort elem["to_port"] = portRange.ToPort