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

Resource newrelic_synthetics_script_monitor: Terraform State not Updated when Commiting High Number of Synthetics at Once #2792

Open
squad-chat opened this issue Jan 17, 2025 · 0 comments
Labels

Comments

@squad-chat
Copy link

Terraform Version

1.9.7

Affected Resource(s)

  • newrelic_synthetic_monitor

Terraform Configuration

Actual Behavior

required_providers {
vault = {
source = "hashicorp/vault"
version = "3.20.1"
}
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
mysql = {
source = "petoju/mysql"
version = "3.0.43"
}
random = {
source = "hashicorp/random"
version = "3.5.1"
}
newrelic = {
source = "newrelic/newrelic"
version = "3.45.2"
}
}

What actually happened?

When trying to submit an high number of synthetics, it seems that state file is not properly updated by NR TF API. So if we try to add or modify existing checks, terraform apply returned this message randomly:

Error: BAD_REQUEST: Monitor name already exists.

│ with module.synthetics_scripted_browser["blablabla"].newrelic_synthetics_script_monitor.monitor,
│ on .terraform/modules/synthetics_scripted_browser/synthetics_api.tf line 1, in resource "newrelic_synthetics_script_monitor" "monitor":
│ 1: resource "newrelic_synthetics_script_monitor" "monitor" {

What should have happened?

Apply new synthetics configuration on NR UI

Steps to Reproduce

  1. terraform plan -var-file newrelic-stg-euc1.tfvars -var="new_relic_account_id=xxxxxxx" -var="new_relic_api_key=xxxxx" -var="aws_account_name=xxxxx"
  2. terraform apply-var-file newrelic-stg-euc1.tfvars -var="new_relic_account_id=xxxxxxx" -var="new_relic_api_key=xxxxx" -var="aws_account_name=xxxxx"

Debug Output

Error: BAD_REQUEST: Monitor name already exists.

│ with module.synthetics_scripted_browser["blablabla"].newrelic_synthetics_script_monitor.monitor,
│ on .terraform/modules/synthetics_scripted_browser/synthetics_api.tf line 1, in resource "newrelic_synthetics_script_monitor" "monitor":
│ 1: resource "newrelic_synthetics_script_monitor" "monitor" {

@pranav-new-relic pranav-new-relic changed the title TF state not updated when commiting high number of synthetics at once Resource newrelic_synthetics_script_monitor: Terraform State not Updated when Commiting High Number of Synthetics at Once Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants