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

Error if aws_route53_query_log deleted outside of terraform - NoSuchQueryLoggingConfig #17954

Closed
jantman opened this issue Mar 5, 2021 · 3 comments · Fixed by #20666
Closed
Labels
bug Addresses a defect in current functionality. service/route53 Issues and PRs that pertain to the route53 service.
Milestone

Comments

@jantman
Copy link

jantman commented Mar 5, 2021

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 other comments that do not add relevant new information or questions, 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

Terraform CLI and Terraform AWS Provider Version

Terraform v0.14.7
+ provider registry.terraform.io/hashicorp/aws v3.31.0

Affected Resource(s)

  • aws_route53_query_log

Terraform Configuration Files

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

resource "aws_cloudwatch_log_group" "log_group" {
  name              = "/aws/route53/testquerylogs"
  retention_in_days = 30
}

resource "aws_route53_query_log" "log" {
  cloudwatch_log_group_arn = aws_cloudwatch_log_group.log_group.arn
  zone_id                  = "Z05329843NO0XUPWNUWNK"
}

Debug Output

https://gist.github.com/jantman/6ee4a2973afe3795381bb45a0d29be4e#file-tf-aws-provider-r53-query-bug-txt-L694-L739

Expected Behavior

Terraform will show the query log resource as needing to be created.

Actual Behavior

Terraform exits with an error:

Error: Error reading Route53 query logging configuration: NoSuchQueryLoggingConfig: The query logging configuration does not exist.
        status code: 404, request id: 849074c6-90c5-47f6-9710-c70d38e24cef

Steps to Reproduce

  1. terraform apply ; note the ID of the query log that was created
  2. Delete the Hosted Zone itself from Route53, entirely.
  3. terraform plan or terraform apply - either fails with an error when refreshing the resource

Important Factoids

It looks to me like the provider isn't properly handling the NoSuchQueryLoggingConfig exception that the SDK is returning.

@ghost ghost added service/cloudwatchlogs service/cloudwatch Issues and PRs that pertain to the cloudwatch service. service/route53 Issues and PRs that pertain to the route53 service. labels Mar 5, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 5, 2021
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. service/cloudwatch Issues and PRs that pertain to the cloudwatch service. service/cloudwatchlogs labels Mar 5, 2021
@ewbankkit
Copy link
Contributor

Relevant code:

out, err := r53.GetQueryLoggingConfig(input)
if err != nil {
return fmt.Errorf("Error reading Route53 query logging configuration: %s", err)
}

This resource needs a _disappears test.

Related:

@github-actions
Copy link

This functionality has been released in v3.56.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2022
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
2 participants