Skip to content

Commit

Permalink
Avoid new cert / ELB error
Browse files Browse the repository at this point in the history
There is a race condition in Terraform when it creates an ELB with a newly created certificate:

```
* aws_elb.concourse: [WARN] Error creating ELB Listener with SSL Cert, retrying: CertificateNotFound: Server Certificate not found for the key: arn:aws:iam::xxxx:server-certificate/xxxx
	status code: 400, request id: xxxx
```
Here we add a sleep to give time to the IAM certificate to propagate.
This has already been raised: hashicorp/terraform#3275
  • Loading branch information
saliceti committed Jan 27, 2016
1 parent 4fa9f64 commit c71e106
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions terraform/concourse/elb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ resource "aws_iam_server_certificate" "concourse" {
name = "${var.env}-concourse"
certificate_body = "${file("concourse.crt")}"
private_key = "${file("concourse.key")}"

provisioner "local-exec" {
command = "sleep 10"
}
}

resource "aws_elb" "concourse" {
Expand Down

0 comments on commit c71e106

Please sign in to comment.