Terraform: Error describing certificates: SerializationError: 400 Bad Request

Created on 22 Feb 2017  ยท  4Comments  ยท  Source: hashicorp/terraform

We have a number of certificates issued in AWS Certificate Manager and on the whole terraform finds them and applies them to ELB listeners without issue. Just recently however it will throw the above error at the stage of trying to find the certificate resources. This is very temperamental and not consistent however, sometimes it will run without any problems, other times doing exactly the same thing on exactly the same environment it will throw this error once, twice anything up to 5 times.

In the meantime I have been able to work around it but simply using the arn value directly in the aws_elb configuration but this is obviously not ideal. It appear that terraform cannot consistently retrieve the certificate from aws when using the aws_acm_certificate resource.

Terraform Version

v0.8.7

Affected Resource(s)

aws_acm_certificate

Terraform Configuration Files

data "aws_acm_certificate" "sslcert" {
domain = "*.${data.terraform_remote_state.global.dnszones[var.environment]}"
statuses = ["ISSUED"]
}

Debug Output

Error refreshing state: 2 error(s) occurred:

  • data.aws_acm_certificate.sslcert: Error describing certificates: SerializationError: 400 Bad Request
    status code: 400, request id:
  • data.aws_acm_certificate.sslcert: Error describing certificates: SerializationError: 400 Bad Request
    status code: 400, request id:

Expected Behavior

Terraform finds the certificates and stores them in it's resource respresentation

Actual Behavior

Fails to get certificates

Steps to Reproduce

terraform apply / terraform plan

bug provideaws

Most helpful comment

I'm also experiencing this problem suddenly; using Terraform v0.8.6. The first time this happened was today, and so far I've only experienced this in the eu-west-1 region. Currently if I wait a few minutes between making the next request, I've found that it will succeed without any problems.

All 4 comments

I'm also experiencing this problem suddenly; using Terraform v0.8.6. The first time this happened was today, and so far I've only experienced this in the eu-west-1 region. Currently if I wait a few minutes between making the next request, I've found that it will succeed without any problems.

We too are experiencing this problem (Terraform v0.8.7). We recently implemented the use of certificates, and the problems started right away on the first runs. plan worked once, and thus far apply has always resulted in 400 error. We got around it with the suggested arn work around described by ojhilt (thanks so much for that !!).

Our issue was related to the local machines time, which was skewed. Updating through an ntp-server solved that.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings