You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to update the ttl on a weighted record, we get " RRSet with DNS name repo.wtest.com. and type CNAME, SetIdentifier live cannot be created as weighted sets must contain the same TTL."
I believe the work around will be to remove one of the records, update the TTL, then recreate both.
provider "aws" {
region = "us-west-2"
}
resource "aws_route53_record" "dns" {
zone_id = "${var.r53_zone_id}"
name = "repo.wtest.com"
type = "CNAME"
ttl = "300"
weighted_routing_policy {
weight = 99
}
set_identifier = "live"
records = ["wtest1.wtest.com"]
}
resource "aws_route53_record" "dns-canary" {
zone_id = "${var.r53_zone_id}"
name = "repo.wtest.com"
type = "CNAME"
ttl = "300"
weighted_routing_policy {
weight = 1
}
set_identifier = "canary"
records = ["wtest2.wtest.com"]
}
$ terraform init
Initializing provider plugins...
- Checking for available provider plugins on https://releases.hashicorp.com...
- Downloading plugin for provider "aws" (1.1.0)...
The following providers do not have any version constraints in configuration,
so the latest version was installed.
To prevent automatic upgrades to new major versions that may contain breaking
changes, it is recommended to add version = "..." constraints to the
corresponding provider blocks in configuration, with the constraint strings
suggested below.
* provider.aws: version = "~> 1.1"
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
------------------------------------------------------------------------
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ aws_route53_record.dns
id: <computed>
fqdn: <computed>
name: "repo.wtest.com"
records.#: "1"
records.3989897057: "wtest1.wtest.com"
set_identifier: "live"
ttl: "300"
type: "CNAME"
weighted_routing_policy.#: "1"
weighted_routing_policy.0.weight: "99"
zone_id: "ZMNK49HC1KU29"
+ aws_route53_record.dns-canary
id: <computed>
fqdn: <computed>
name: "repo.wtest.com"
records.#: "1"
records.1949473120: "wtest2.wtest.com"
set_identifier: "canary"
ttl: "300"
type: "CNAME"
weighted_routing_policy.#: "1"
weighted_routing_policy.0.weight: "1"
zone_id: "ZMNK49HC1KU29"
Plan: 2 to add, 0 to change, 0 to destroy.
provider "aws" {
region = "us-west-2"
}
resource "aws_route53_record" "dns" {
zone_id = "${var.r53_zone_id}"
name = "repo.wtest.com"
type = "CNAME"
ttl = "60"
weighted_routing_policy {
weight = 99
}
set_identifier = "live"
records = ["wtest1.wtest.com"]
}
resource "aws_route53_record" "dns-canary" {
zone_id = "${var.r53_zone_id}"
name = "repo.wtest.com"
type = "CNAME"
ttl = "60"
weighted_routing_policy {
weight = 1
}
set_identifier = "canary"
records = ["wtest2.wtest.com"]
}
$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
aws_route53_record.dns: Refreshing state... (ID: ZMNK49HC1KU29_repo.wtest.com_CNAME_live)
aws_route53_record.dns-canary: Refreshing state... (ID: ZMNK49HC1KU29_repo.wtest.com_CNAME_canary)
------------------------------------------------------------------------
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
~ aws_route53_record.dns
ttl: "300" => "60"
~ aws_route53_record.dns-canary
ttl: "300" => "60"
Plan: 0 to add, 2 to change, 0 to destroy.
$ terraform apply
aws_route53_record.dns-canary: Refreshing state... (ID: ZMNK49HC1KU29_repo.wtest.com_CNAME_canary)
aws_route53_record.dns: Refreshing state... (ID: ZMNK49HC1KU29_repo.wtest.com_CNAME_live)
aws_route53_record.dns-canary: Modifying... (ID: ZMNK49HC1KU29_repo.wtest.com_CNAME_canary)
ttl: "300" => "60"
aws_route53_record.dns: Modifying... (ID: ZMNK49HC1KU29_repo.wtest.com_CNAME_live)
ttl: "300" => "60"
Error applying plan:
2 error(s) occurred:
* aws_route53_record.dns-canary: 1 error(s) occurred:
* aws_route53_record.dns-canary: [ERR]: Error building changeset: InvalidChangeBatch: RRSet with DNS name repo.wtest.com. and type CNAME, SetIdentifier canary cannot be created as weighted sets must contain the same TTL.
status code: 400, request id: d1c7083e-b429-11e7-988f-49557008bbb1
* aws_route53_record.dns: 1 error(s) occurred:
* aws_route53_record.dns: [ERR]: Error building changeset: InvalidChangeBatch: RRSet with DNS name repo.wtest.com. and type CNAME, SetIdentifier live cannot be created as weighted sets must contain the same TTL.
status code: 400, request id: d1d5d48f-b429-11e7-8c55-4f8351d87dd9
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
Let me know if you need any further information.
The text was updated successfully, but these errors were encountered:
This issue has been automatically migrated to hashicorp/terraform-provider-aws#1961 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to this issue and let us know.
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.
ghost
locked and limited conversation to collaborators
Apr 6, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello!
When trying to update the ttl on a weighted record, we get " RRSet with DNS name repo.wtest.com. and type CNAME, SetIdentifier live cannot be created as weighted sets must contain the same TTL."
I believe the work around will be to remove one of the records, update the TTL, then recreate both.
This can be produced by taking the example from https://www.terraform.io/docs/providers/aws/r/route53_record.html applying it, then changing the ttl and applying again.
repo:
Original:
$ terraform init
$ terraform plan
$ terraform apply
Change the ttl to 60, new terraform:
$ terraform plan
$ terraform apply
Let me know if you need any further information.
The text was updated successfully, but these errors were encountered: