Skip to content

Commit

Permalink
provider/aws: Fix panic when passing statuses to aws_acm_certificate (#…
Browse files Browse the repository at this point in the history
…9990)

Fixes #9989

When passing a list of statuses to the acm_certificate data source, we
were trying to cast a schema.TypeList directly to []string

We need to do it via an []interface{} and then cast to string when
ranging over the results. Without this, we get a panic
  • Loading branch information
stack72 authored Nov 9, 2016
1 parent 9e0af96 commit d66359b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builtin/providers/aws/data_source_aws_acm_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ func dataSourceAwsAcmCertificateRead(d *schema.ResourceData, meta interface{}) e

statuses, ok := d.GetOk("statuses")
if ok {
statusStrings := statuses.([]string)
statusStrings := statuses.([]interface{})
statusList := make([]*string, len(statusStrings))
for i, status := range statusStrings {
statusList[i] = aws.String(strings.ToUpper(status))
statusList[i] = aws.String(strings.ToUpper(status.(string)))
}
params.CertificateStatuses = statusList
} else {
Expand Down

0 comments on commit d66359b

Please sign in to comment.