Skip to content

Commit

Permalink
d/aws_prefix_list: error check when setting cidr_blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth-k committed Jul 21, 2020
1 parent 3d2ca8e commit a35c88c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aws/data_source_aws_prefix_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit a35c88c

Please sign in to comment.