From cbb12a8461ed665b9486ea07fc78128d4ce72179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Gonz=C3=A1lez?= Date: Sun, 8 Oct 2017 21:27:05 +0200 Subject: [PATCH] Fill base case fields when nil. --- aws/data_source_aws_acm_certificate.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/data_source_aws_acm_certificate.go b/aws/data_source_aws_acm_certificate.go index abf87350715..66709ddc0e6 100644 --- a/aws/data_source_aws_acm_certificate.go +++ b/aws/data_source_aws_acm_certificate.go @@ -124,6 +124,14 @@ func dataSourceAwsAcmCertificateRead(d *schema.ResourceData, meta interface{}) e _, ok = d.GetOk("most_recent") if ok { mr := arns[0] + if mr.notBefore == nil { + description, err := describeCertificate(mr, conn) + if err != nil { + return errwrap.Wrapf("Error describing certificates: {{err}}", err) + } + + mr.notBefore = description.Certificate.NotBefore + } for _, arn := range arns[1:] { if arn.notBefore == nil { description, err := describeCertificate(arn, conn)