From 386807b865ebeb19d46151e320cd13ef2cc58003 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Wed, 22 Dec 2021 22:06:41 +0900 Subject: [PATCH 1/2] fix: change the type from array to slice to prevent a panic --- internal/service/ec2/traffic_mirror_filter_rule.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From dae3e0c704add7139134f3bdbd284110cc312a62 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 22 Dec 2021 09:43:15 -0500 Subject: [PATCH 2/2] Add CHANGELOG entry. --- .changelog/22315.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/22315.txt 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