title: Terraform AWS ACM certificates in us-east-1 for resources in eu-west-1
body: <p>I have a terraform module that provisions resources primarily in eu-west-1. I need an ACM certificate to attach to a Cloudfront distribution. The certificate must be provisioned in us-east-1.</p>
  
  <p>I have thus configured two providers:</p>
  
  <pre><code>provider "aws" {
    version = "~&gt; 1.0"
    region = "eu-west-1"
  }
  
  provider "aws" {
    version = "~&gt; 1.0"
    region = "us-east-1"
    alias = "us-east-1"
  }
  </code></pre>
  
  <p>In my module, I provision the certificate like so:</p>
  
  <pre><code>resource "aws_acm_certificate" "cert" {
    provider = "aws.us-east-1"
    domain_name = "${var.domain_name}"
    validation_method = "DNS"
    tags = "${var.tags}"
  
    lifecycle {
      create_before_destroy = true
    }
  }
  </code></pre>
  
  <p><strong>Problem #1</strong>: I tried to import my existing ACM certificate using:</p>
  
  <pre><code>terraform import module.mymod.aws_acm_certificate.cert arn:aws:acm:us-east-1:xyz:certificate/uuid
  </code></pre>
  
  <p>This fails with: "Could not find certificate with id". Is terraform looking in the wrong region? I confirmed with the aws CLI that the certificate does indeed exist (e.g. no typos in the ARN).</p>
  
  <p>Ok, so I figured I could just create new certificate. This does work, and I now have two certificates, but I then run into problem #2:</p>
  
  <pre><code>resource "aws_route53_record" "cert_validation" {
    name = "${aws_acm_certificate.cert.domain_validation_options.0.resource_record_name}"
    type = "${aws_acm_certificate.cert.domain_validation_options.0.resource_record_type}"
    zone_id = "${data.aws_route53_zone.zone.id}"
    records = ["${aws_acm_certificate.cert.domain_validation_options.0.resource_record_value}"]
    ttl = 60
  }
  </code></pre>
  
  <p>This attempts to set up DNS validation for ACM. The hosted zone exists in eu-west-1, so I'm expecting problems here. However, this still fails with "Could not find certificate ...", and I'm assuming terraform gets confused about regions. I tried adding <code>provider = "aws.us-east-1"</code> to this resource as well, but it still fails the same way.</p>
  
  <p>So, no matter what I do, Terraform is unable to locate my certificate, even it has created it itself. Am I doing something wrong?</p>