data.vault_generic_secret.datadog_vault_path: Reading...
module.vault_engine_kvv2.vault_mount.this: Refreshing state... [id=/secret/lambda_pdf/lambda_pdf/kv]
data.aws_caller_identity.current: Reading...
module.bucket_lambda_pdf.aws_s3_bucket.this: Refreshing state... [id=lambda-pdf-doctrine-production]
data.aws_caller_identity.current: Read complete after 0s [id=756057317366]
aws_iam_role.this: Refreshing state... [id=pdf-generator-production]
data.vault_generic_secret.datadog_vault_path: Read complete after 0s [id=secret/lambda_pdf/lambda_pdf/kv/datadog]
module.vault_engine_kvv2.vault_kv_secret_backend_v2.this: Refreshing state... [id=/secret/lambda_pdf/lambda_pdf/kv/config]
module.datadog_monitor.datadog_monitor.error_rate_too_high: Refreshing state... [id=15776469]
module.bucket_lambda_pdf.aws_s3_bucket_public_access_block.this: Refreshing state... [id=lambda-pdf-doctrine-production]
module.bucket_lambda_pdf.aws_s3_bucket_policy.this[0]: Refreshing state... [id=lambda-pdf-doctrine-production]
module.lambda-pdf-generator-url.aws_lambda_function.this: Refreshing state... [id=pdf-generator-production-url]
module.lambda-pdf-generator-html.aws_lambda_function.this: Refreshing state... [id=pdf-generator-production-html]
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: 1 error occurred:
│ * error validating monitor from /api/v1/monitor/15776469/validate: 400 Bad Request: {"errors":["Missing required tag key(s): repository, service, env, aws_account"]}
│
│
│
│ with module.datadog_monitor.datadog_monitor.error_rate_too_high,
│ on ../_modules/datadog/monitor.tf line 1, in resource "datadog_monitor" "error_rate_too_high":
│ 1: resource "datadog_monitor" "error_rate_too_high" {
Expected Behavior
The default tags should be taken into account during the plan, even if the current state does not comply with the policy
Actual Behavior
The datadog_monitor_config_policy resources are already created.
Since I have specified the default tags in the Datadog provider configuration, I expect the Terraform plan to reflect the changes that align with the monitor policy. However, the provider does not account for the default tags
Steps to Reproduce
Create a Terraform stack that includes a datadog_monitor
establish the Datadog monitor tag policy with the new required tags.
Use the default_tags field in the Datadog provider configuration to fill the datadog_monitor with these new required tags.
Datadog Terraform Provider Version
3.48.0
Terraform Version
1.9.3
What resources or data sources are affected?
datadog_monitor
Terraform Configuration Files
Relevant debug or panic output
Expected Behavior
The default tags should be taken into account during the plan, even if the current state does not comply with the policy
Actual Behavior
The
datadog_monitor_config_policy
resources are already created.Since I have specified the default tags in the Datadog provider configuration, I expect the Terraform plan to reflect the changes that align with the monitor policy. However, the provider does not account for the default tags
Steps to Reproduce
datadog_monitor
default_tags
field in the Datadog provider configuration to fill thedatadog_monitor
with these new required tags.Important Factoids
No response
References
https://github.com/DataDog/terraform-provider-datadog/issues/1478