From a35c88c0fc3b64d97b6f99d22455981a7829d7f7 Mon Sep 17 00:00:00 2001 From: Roberth Kulbin Date: Thu, 9 Jul 2020 11:16:47 +0100 Subject: [PATCH] d/aws_prefix_list: error check when setting cidr_blocks --- aws/data_source_aws_prefix_list.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aws/data_source_aws_prefix_list.go b/aws/data_source_aws_prefix_list.go index 54adc054b89..fdb0fe24a39 100644 --- a/aws/data_source_aws_prefix_list.go +++ b/aws/data_source_aws_prefix_list.go @@ -71,7 +71,9 @@ func dataSourceAwsPrefixListRead(d *schema.ResourceData, meta interface{}) error cidrs := aws.StringValueSlice(pl.Cidrs) sort.Strings(cidrs) - d.Set("cidr_blocks", cidrs) + if err := d.Set("cidr_blocks", cidrs); err != nil { + return fmt.Errorf("failed to set cidr blocks of prefix list %s: %s", d.Id(), err) + } return nil }