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

400 Bad Request after import and change *first* time of opsgenie_service #441

Open
Mazorius opened this issue Jul 13, 2024 · 0 comments
Open

Comments

@Mazorius
Copy link

Terraform Version

1.5.7

Affected Resource(s)

  • opsgenie_service

Terraform Configuration Files

locals {
  test = {
    services = [
      {
        name        = "Test 1"
        description = "description"
        tags        = ["TEST-1", "TAG"]
      },
      {
        name        = "Test 2"
        description = "description"
        tags        = ["TEST-2", "TAG"]
      },
    ]
  }
}


resource "opsgenie_service" "test" {
  for_each = {
    for service in local.test.services : service.name => service
  }

  name        = each.value.name
  description = each.value.description
  tags        = each.value.tags
  team_id     = opsgenie_team.test.id
}

Expected Behavior

The scripts run successful every time.

Actual Behavior

During initial run after import a 400 bad request happens.
A second run is successful.

Steps to Reproduce

  1. Get ID of already manually created service inside a team.
  2. Import into state terraform import 'opsgenie_service.test["Test 1"]' 2387A5D4-21AC-4D94-B431-7313786F66D2
  3. terraform plan -out plan.cache
  4. terraform apply plan.cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant