Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_acm_certificate conflict with same domain_name in the same region #7760

Closed
vhiairrassary opened this issue Feb 28, 2019 · 3 comments
Closed
Labels
bug Addresses a defect in current functionality. service/acm Issues and PRs that pertain to the acm service.
Milestone

Comments

@vhiairrassary
Copy link
Contributor

vhiairrassary commented Feb 28, 2019

When creating two aws_acm_certificate resources with the same domain_name (and optionally same subject_alternative_names) only one resource is created in AWS while both resources point to the same id. If I create both certificate manually in the console it works as expected.

One workaround is to add a dummy value in subject_alternative_names to differentiate both resources.

My use case is to have two times the same certificate:

  • one in the current region like eu-west-1
  • one in us-east-1 for CloudFront

The bug happens when the current region is us-east-1.

Terraform Version

> terraform -v
Terraform v0.11.11
+ provider.aws v2.0.0

Affected Resource(s)

  • aws_acm_certificate

Terraform Configuration Files

provider "aws" {
  region = "us-east-1"
}

resource "aws_acm_certificate" "cert1" {
  domain_name = "example.com"
  validation_method = "DNS"
}

resource "aws_acm_certificate" "cert2" {
  domain_name = "example.com"
  validation_method = "DNS"
}

resource "aws_acm_certificate" "cert3" {
  domain_name = "other.com"
  validation_method = "DNS"
}

Expected Behavior

I should see 3 certificates in my AWS console.

Actual Behavior

I see only 2 certificates in my AWS console (one for example.com & one for other.com).

Steps to Reproduce

  1. terraform apply
  2. terraform state pull

In the output we can see that aws_acm_certificate.cert1 & aws_acm_certificate.cert2 have the same id.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@bflad bflad added the service/acm Issues and PRs that pertain to the acm service. label Mar 4, 2019
@blckct
Copy link
Contributor

blckct commented Mar 5, 2019

Well, it should work with two certificates that are the same but why are you creating them in the same region if you say you want them in different regions?

provider "aws" {
  region    = "us-east-1"
  alias     = "america"
}

resource "aws_acm_certificate" "cert2" {
  domain_name = "example.com"
  validation_method = "DNS"
  provider = "aws.america"
}

@nywilken nywilken added thinking bug Addresses a defect in current functionality. and removed thinking labels Apr 19, 2019
@bflad bflad added this to the v2.23.0 milestone May 26, 2020
@bflad
Copy link
Contributor

bflad commented May 26, 2020

Hi folks 👋 This issue was resolved awhile ago in version 2.23.0 of the Terraform AWS Provider and should have been fixed in all versions since. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

If you are still having trouble on recent versions of the Terraform AWS Provider, please create a new GitHub issue following the bug report template. Thanks!

@bflad bflad closed this as completed May 26, 2020
@ghost
Copy link

ghost commented Jun 26, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/acm Issues and PRs that pertain to the acm service.
Projects
None yet
Development

No branches or pull requests

4 participants