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

Terraform plan gen showing changes to all existing records with cloudflare provider version >=4.41.0 #4684

Closed
3 tasks done
maheedharTumpudi opened this issue Dec 2, 2024 · 5 comments
Labels
working-as-intended Indicates an issue is working as designed.

Comments

@maheedharTumpudi
Copy link

maheedharTumpudi commented Dec 2, 2024

Confirmation

  • This is a bug with an existing resource and is not a feature request or enhancement. Feature requests should be submitted with Cloudflare Support or your account team.
  • I have searched the issue tracker and my issue isn't already found.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

terraform version : 1.9.8
cloudflare provider version : 4.46.0

Affected resource(s)

cloudflare_record

Terraform configuration files

module "cusip-com-cname-record" {
  source = "git::https://github.<org>.com/neteng/dns-modules.git//cloudflare//cname-record"
  email-address = data.aws_ssm_parameter.email-address.value
  api-key       = data.aws_ssm_parameter.api-key.value

  cname-records = {
          "cusip.com/1/test1._domainkey" = {
            zone-id = local.cusip-com
            name    = "test1._domainkey"
            value   = "target1.amazonses.com"
            ttl     = 600
          }
          "cusip.com/1/test2._domainkey" = {
            zone-id = local.cusip-com
            name    = "test2._domainkey"
            value   = "target2.amazonses.com"
            ttl     = 600
          }
}

Link to debug output

******************************* TERRAFORM INIT *******************************

Initializing modules...
Downloading git::https://github.factset.com/neteng/dns-modules.git for cusip-com-a-record...

Initializing the backend...

Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.

Initializing provider plugins...

  • Finding latest version of hashicorp/aws...
  • Finding latest version of cloudflare/cloudflare...
  • Installing hashicorp/aws v5.76.0...
  • Installed hashicorp/aws v5.76.0 (signed by HashiCorp)
  • Installing cloudflare/cloudflare v4.46.0...
  • Installed cloudflare/cloudflare v4.46.0 (self-signed, key ID )

Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

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.

Panic output

No response

Expected output

As these records already exist
I expect terraform plan to give - No changes. Your infrastructure matches the configuration.

Actual output

Though there are no changes to the configurations in .tf files the terraform plan gen is still showing changes as below:

module.cusip-com-cname-record.cloudflare_record.cname-record["cusip.com/1/test1._domainkey"] will be updated in-place
~ resource "cloudflare_record" "cname-record" {
id = ""
name = "test1._domainkey"
tags = []
+ value = "target1.amazonses.com"
# (10 unchanged attributes hidden)
}

module.cusip-com-cname-record.cloudflare_record.cname-record["cusip.com/1/test2._domainkey"] will be updated in-place
~ resource "cloudflare_record" "cname-record" {
id = ""
name = "test2._domainkey"
tags = []
+ value = "target2.amazonses.com"
# (10 unchanged attributes hidden)
}
Plan: 0 to add, 2 to change, 0 to destroy.

Steps to reproduce

  1. Use cloudflare provider >= 4.41.0
  2. Run terraform plan

Additional factoids

This issue is observed only with the terraform cloudflare provider versions >= 4.41.0 . It was working fine until we were using cloudflare provider of version 4.40.0

References

No response

@maheedharTumpudi maheedharTumpudi added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 2, 2024
Copy link
Contributor

github-actions bot commented Dec 2, 2024

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

Copy link
Contributor

github-actions bot commented Dec 2, 2024

Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of TF_LOG=DEBUG output to be provided. The only parts that should be redacted are your user credentials in the X-Auth-Key, X-Auth-Email and Authorization HTTP headers. Details such as zone or account identifiers are not considered sensitive but can be redacted if you are very cautious. This log file provides additional context from Terraform, the provider and the Cloudflare API that helps in debugging issues. Without it, maintainers are very limited in what they can do and may hamper diagnosis efforts.

This issue has been marked with triage/needs-information and is unlikely to receive maintainer attention until the log file is provided making this a complete bug report.

@github-actions github-actions bot added triage/needs-information Indicates an issue needs more information in order to work on it. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 2, 2024
@jacobbednarz
Copy link
Member

value was deprecated in favour of content in v4.39.0 and a bug was fixed in the handling of v4.41.0 so this is expected. you need to update your configuration/module appropriately once the values have been correctly saved to state.

@jacobbednarz jacobbednarz closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2024
@jacobbednarz jacobbednarz added working-as-intended Indicates an issue is working as designed. and removed kind/bug Categorizes issue or PR as related to a bug. triage/needs-information Indicates an issue needs more information in order to work on it. labels Dec 2, 2024
@maheedharTumpudi
Copy link
Author

@jacobbednarz as the bug is fixed in v4.41.0 it should basically accept the existing configuration that has value attribute right? but why is it still showing changes even though nothing changed

@jacobbednarz
Copy link
Member

only if you've run an apply since the changes. you'll also want to check your module abstraction to make sure that isn't interfering by not posing through the correct values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
working-as-intended Indicates an issue is working as designed.
Projects
None yet
Development

No branches or pull requests

2 participants