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

[BUG] route53_record: Records with same ID possible #1094

Closed
Dominik-K opened this issue Jul 10, 2017 · 2 comments
Closed

[BUG] route53_record: Records with same ID possible #1094

Dominik-K opened this issue Jul 10, 2017 · 2 comments
Labels
bug Addresses a defect in current functionality. service/route53 Issues and PRs that pertain to the route53 service.
Milestone

Comments

@Dominik-K
Copy link
Contributor

Terraform Version

Terraform: v.0.10.0-dev (a4ee13b8c), AWS provider: 27b3b71

Affected Resource(s)

  • aws_route53_record

Terraform Configuration Files

resource "aws_route53_record" "net_example_TXT1" {
  name = ""
  type = "TXT"
  zone_id = "ZONE_REDACTED"
  ttl = "300"
  records = ["Test1"]
}

resource "aws_route53_record" "net_example_TXT2" {
  name = ""
  type = "TXT"
  zone_id = "ZONE_REDACTED"
  ttl = "300"
  records = ["Test2"]
}

Expected Behavior

plan & apply should throw an error that net_example_TXT1 & net_example_TXT2 will create or change the same resource ID.

Actual Behavior

  • First run (record not existent):

    • plan:

      + aws_route53_record.net_example_TXT1
       fqdn:               "<computed>"
       records.#:          "1"
       records.1265890278: "Test1"
       ttl:                "300"
       type:               "TXT"
       zone_id:            "ZONE_REDACTED"
      
      + aws_route53_record.net_example_TXT2
       fqdn:               "<computed>"
       records.#:          "1"
       records.3531252316: "Test2"
       ttl:                "300"
       type:               "TXT"
       zone_id:            "ZONE_REDACTED"
      
    • apply:
      Outputs that both resources are created, but only "Test1" is set.

  • Second run ("Test1" entry existent):

    • plan:
            ~ aws_route53_record.net_example_TXT2
                  records.1265890278: "Test1" => ""
                  records.3531252316: "" => "Test2"
      
    • apply:
      Does what plan shows: "Test1" -> "Test2"
  • Loop between values of net_example_TXT1 and net_example_TXT2

@radeksimko radeksimko added the bug Addresses a defect in current functionality. label Oct 23, 2017
@bflad bflad added the service/route53 Issues and PRs that pertain to the route53 service. label Jan 19, 2018
@bflad
Copy link
Contributor

bflad commented Mar 30, 2018

Contrary to how almost all Terraform resources work, the aws_route53_record resource was incorrectly using the UPSERT action in the Route53 ResourceRecordSet changeset during Terraform resource creation instead of the CREATE action. Its been like this since it was created a few years ago.

In #2926, released in v1.10.0 of the AWS provider, we introduced the allow_override attribute that will allow you to set false that will switch the creation action to CREATE and properly error when you try to overwrite an existing record. It defaults to true currently to not break backwards compatibility.

In the next major version of the AWS provider, we plan to switch the attribute so it defaults to false but potentially will still allow true for the corner cases where UPSERT on creation is desired.

@ghost
Copy link

ghost commented Apr 7, 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 Apr 7, 2020
This issue was closed.
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/route53 Issues and PRs that pertain to the route53 service.
Projects
None yet
Development

No branches or pull requests

3 participants