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

datadog_api_key Error: Provider produced inconsistent result after apply #2847

Open
mhmcdonald opened this issue Feb 18, 2025 · 6 comments · Fixed by #2857
Open

datadog_api_key Error: Provider produced inconsistent result after apply #2847

mhmcdonald opened this issue Feb 18, 2025 · 6 comments · Fixed by #2857

Comments

@mhmcdonald
Copy link

mhmcdonald commented Feb 18, 2025

Datadog Terraform Provider Version

v.3.55.0

Terraform Version

v1.5.7

What resources or data sources are affected?

datadog_api_key

Terraform Configuration Files

resource "datadog_api_key" "api-key" {
  name = "my-new-key"
}

Relevant debug or panic output

With version 3.55.0 that was just published, I'm running into the following error when trying to deploy a new datadog_api_key resource.

When applying changes to module.operator.datadog_api_key.api-key, provider "module.operator.provider[\"registry.terraform.io/datadog/datadog\"]" produced an unexpected new value: .remote_config_read_enabled: was cty.True, but now cty.False.

This is a bug in the provider, which should be reported in the provider's own issue tracker.

I see that the docs say: Warning : default value is true for backwards compatibility Defaults to true. Should this be part of a major version release?

Expected Behavior

deploys a new datadog_api_key

Actual Behavior

The apply fails.

When applying changes to module.operator.datadog_api_key.api-key, provider "module.operator.provider[\"registry.terraform.io/datadog/datadog\"]" produced an unexpected new value: .remote_config_read_enabled: was cty.True, but now cty.False.

This is a bug in the provider, which should be reported in the provider's own issue tracker.

Steps to Reproduce

terraform apply

Important Factoids

No response

References

#2831

@mhmcdonald mhmcdonald added the bug label Feb 18, 2025
@ecdatadog
Copy link
Contributor

Hello @mhmcdonald ,

Looking at the issue to reproduce and fix

@ecdatadog
Copy link
Contributor

ecdatadog commented Feb 19, 2025

I tried 2 scenarios with terraform 1.5.7 :

  • create directly the resource with terraform provider v3.55.0
  • create the resource with provider v3.54.0 then upgrade the provider to v3.55.0 and do again a terraform apply

For

resource "datadog_api_key" "api-key" {
  name = "my-new-key"
}

I got an api key with Remote config activated in both scenario and I don't achieve to get your error. What is your scenario ?

About the default value, with specifying the default value at True, it should not be a breaking change.

@aanogueira
Copy link

aanogueira commented Feb 20, 2025

Hello,

Same is happening to me:

When applying changes to datadog_api_key.example["testerino"], provider "provider[\"registry.terraform.io/datadog/datadog\"]" produced an unexpected new value: .remote_config_read_enabled: was cty.True, but now cty.False.

This is a bug in the provider, which should be reported in the provider's own issue tracker.

With the config:

resource "datadog_api_key" "example" {
  for_each = var.examples
  name = each.key
  remote_config_read_enabled = true # same happens when I remove this
}

Version: v3.55.0

It worked when updating existing resources but is failing when creating new ones.

@ecdatadog
Copy link
Contributor

ecdatadog commented Feb 21, 2025

I tested :

resource "datadog_api_key" "norc" {
  name = "api_key_no_rc"
}

resource "datadog_api_key" "rctrue" {
  name = "api_key_rc_true"
  remote_config_read_enabled = true
}

resource "datadog_api_key" "rcfalse" {
  name = "api_key_rc_false"
  remote_config_read_enabled = false
}

and the 3 resources are properly created with terraform 1.5.7 / provider 3.55.0 when tested against some of our test organisations .
But in our organisations the remote config parameter is enabled . Could you look at /organization-settings/remote-config to see what is the configuration in your organisation ?

@ecdatadog
Copy link
Contributor

Fix : #2857

@ecdatadog
Copy link
Contributor

Fix is released in 3.56.0.
Please confirm the issue is solved for you ! (reaction to this post will be great)

Without additional elements, this PR will be closed in one week

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