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

issue on "no matching Route53 Hosted Zone Found" #1

Open
alessandrocarrettoni opened this issue Oct 18, 2024 · 1 comment
Open

issue on "no matching Route53 Hosted Zone Found" #1

alessandrocarrettoni opened this issue Oct 18, 2024 · 1 comment

Comments

@alessandrocarrettoni
Copy link

Hi in terraform plan

we have the error:

Error: no matching Route 53 Hosted Zone found

│ with data.aws_route53_zone.aws_rke2_zone,
│ on route53.tf line 1, in data "aws_route53_zone" "aws_rke2_zone":
│ 1: data "aws_route53_zone" "aws_rke2_zone" {



│ Error: no matching Route 53 Hosted Zone found

│ with module.rke2-cluster.data.aws_route53_zone.aws_rke2_zone,
│ on .terraform\modules\rke2-cluster\route53.tf line 1, in data "aws_route53_zone" "aws_rke2_zone":
│ 1: data "aws_route53_zone" "aws_rke2_zone" {

below you can see

route53.tf

..............................
data "aws_route53_zone" "aws_rke2_zone" {
name = var.domain
}
resource "aws_route53_record" "aws_rke2_record_rke2" {
zone_id = data.aws_route53_zone.aws_rke2_zone.zone_id
name = ""
type = "A"
alias {
name = aws_elb.aws_rke2_elb.dns_name
zone_id = aws_elb.aws_rke2_elb.zone_id
evaluate_target_health = false
}
depends_on = [aws_elb.aws_rke2_elb]
}

resource "aws_route53_record" "aws_rke2_record_ingress" {
zone_id = data.aws_route53_zone.aws_rke2_zone.zone_id
name = "*"
type = "A"
alias {
name = aws_elb.aws_rke2_ingress_elb.dns_name
zone_id = aws_elb.aws_rke2_ingress_elb.zone_id
evaluate_target_health = false
}
depends_on = [aws_elb.aws_rke2_ingress_elb]
}
.....................................................................

variables.tf
........................................

variable "domain" {
default = "rke2.internal"
type = string
description = "(Required) The AWS Route53 domain to use for the cluster(s)."
..................
.................
................
.....................................................................

I've created private hosted zone rke2.internal and with terraform user i'm able to do the following command:

aws route53 list-hosted-zones-by-name
{
"HostedZones": [
{
"Id": "/hostedzone/Z09559122E6WUXQPDD1M7",
"Name": "rke2.internal.",
"CallerReference": "eb23bdf3-d3ac-4e7b-8797-a1aa3e3cae44",
"Config": {
"Comment": "",
"PrivateZone": true
},
"ResourceRecordSetCount": 2
}

Do you have any suggestion?
thank you in advance
Alex

@alessandrocarrettoni
Copy link
Author

Issue Solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant