-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
vpc block in aws_route53_zone causes issues with aws_route53_zone_association #7946
Comments
+1 and I'd also add that it's somewhat documented here, but it makes it apparent that it won't work properly (paradoxical docs): https://www.terraform.io/docs/providers/aws/r/route53_zone_association.html says
but that sounds like it's a workaround only. The paradox here is that you have to give at least one Didn't test the workaround yet, will report if it works. EDIT - yes it works, however the issue of not being able to update the default VPC for the zone is still present, so still needs fixing |
bump |
Workaround could be better documented with a concrete example. |
Hi folks 👋 The
And the following example configuration: resource "aws_vpc" "primary" {
cidr_block = "10.6.0.0/16"
enable_dns_hostnames = true
enable_dns_support = true
}
resource "aws_vpc" "secondary" {
cidr_block = "10.7.0.0/16"
enable_dns_hostnames = true
enable_dns_support = true
}
resource "aws_route53_zone" "example" {
name = "example.com"
# NOTE: The aws_route53_zone vpc argument accepts multiple configuration
# blocks. The below usage of the single vpc configuration, the
# lifecycle configuration, and the aws_route53_zone_association
# resource is for illustrative purposes (e.g. for a separate
# cross-account authorization process, which is not shown here).
vpc {
vpc_id = aws_vpc.primary.id
}
lifecycle {
ignore_changes = [vpc]
}
}
resource "aws_route53_zone_association" "secondary" {
zone_id = aws_route53_zone.example.zone_id
vpc_id = aws_vpc.secondary.id
} Due to how the Route 53 API and Terraform are designed, it is not possible for the Terraform AWS Provider to support this functionality better without removing functionality. If you feel this documentation can be improved still, please open a new issue and we will take a fresh look. Thanks! |
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! |
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
vpc_id
invpc
block ofaws_route53_zone
resourceaws_route53_zone_association
resourceActual Behavior
terraform apply
runs would remove the association(s) with add the additional vpc(s), next one would recreate it again, and so on back and forth.Steps to Reproduce
terraform apply
Important Factoids
vpc_id
(withoutvpc
block) inaws_route53_zone
worked correctly for the described scenario (before it got deprecated in removed in [Version 2 Release] resource/aws_route53_zone: Remove deprecated top-level vpc_id and vpc_region arguments #7693)vpc
blocks inaws_route53_zone
, but it doesn't allow dynamic associations configuration and not documented.References
The text was updated successfully, but these errors were encountered: