From a7b31ac40d938720c4a90125c942cfc4352735fc Mon Sep 17 00:00:00 2001 From: Jason Berlinsky Date: Sun, 21 Jun 2015 01:40:09 -0400 Subject: [PATCH] Normalize certificate chains as well as certificate bodies when creating AWS IAM SSL certificates --- builtin/providers/aws/resource_aws_iam_server_certificate.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/providers/aws/resource_aws_iam_server_certificate.go b/builtin/providers/aws/resource_aws_iam_server_certificate.go index 5b5fde9c3..9d5d28b4a 100644 --- a/builtin/providers/aws/resource_aws_iam_server_certificate.go +++ b/builtin/providers/aws/resource_aws_iam_server_certificate.go @@ -30,6 +30,7 @@ func resourceAwsIAMServerCertificate() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, + StateFunc: normalizeCert, }, "path": &schema.Schema{ @@ -106,7 +107,7 @@ func resourceAwsIAMServerCertificateRead(d *schema.ResourceData, meta interface{ // these values should always be present, and have a default if not set in // configuration, and so safe to reference with nil checks d.Set("certificate_body", normalizeCert(resp.ServerCertificate.CertificateBody)) - d.Set("certificate_chain", resp.ServerCertificate.CertificateChain) + d.Set("certificate_chain", normalizeCert(resp.ServerCertificate.CertificateChain)) d.Set("path", resp.ServerCertificate.ServerCertificateMetadata.Path) d.Set("arn", resp.ServerCertificate.ServerCertificateMetadata.ARN)