terraform-provider-opsgenie icon indicating copy to clipboard operation
terraform-provider-opsgenie copied to clipboard

Team will not updated in existing OpsGenie Service

Open 0x46616c6b opened this issue 4 years ago • 4 comments

Hello,

we run the latest version of the provider (v0.5.7) and try to adjust the resource opsgenie_service and want to change the team_id. In every plan and run the output brings changes to the resources but after successful run the origin is not adjusted.

Terraform Version

0.14.3

Affected Resource(s)

  • opsgenie_service

Terraform Configuration Files

resource "opsgenie_team" "team_one" {
  name = "Team One"
}

resource "opsgenie_team" "team_two" {
  name = "Team two"
}

resource "opsgenie_service" "service_name" {
  name        = "Service"
  team_id     = opsgenie_team_one.team.id
  description = "Example Team"
}

Expected Behavior

When I change the team_id property I expected that the team will changed.

Actual Behavior

The old team is not replaced with the new one.

Steps to Reproduce

  1. Apply this config (two teams and one service)

    resource "opsgenie_team" "team_one" {
      name = "Team One"
    }
    
    resource "opsgenie_team" "team_two" {
      name = "Team two"
    }
    
    resource "opsgenie_service" "service_name" {
      name        = "Service"
      team_id     = opsgenie_team_one.team.id
      description = "Example Team"
    }
    
  2. Apply with changed team_id

    resource "opsgenie_team" "team_one" {
      name = "Team One"
    }
    
    resource "opsgenie_team" "team_two" {
      name = "Team two"
    }
    
    resource "opsgenie_service" "service_name" {
      name        = "Service"
      team_id     = opsgenie_team_two.team.id
      description = "Example Team"
    }
    
  3. You will see that still Team One is connected with the service.

0x46616c6b avatar Jan 14 '21 14:01 0x46616c6b

https://github.com/opsgenie/terraform-provider-opsgenie/blob/6f098f5469224f725f6894a90f3b6a1496ba803f/opsgenie/resource_opsgenie_service.go#L97-L106

Seems that the team never read from the update request.

0x46616c6b avatar Jan 14 '21 14:01 0x46616c6b

Hey Opsgenie team, is this going to be fixed soon?

liamkinne avatar Feb 28 '22 01:02 liamkinne

The API behind this request doesn't accept team at this point-->

https://docs.opsgenie.com/docs/service-api#update-service

NickAdolf avatar Mar 03 '23 13:03 NickAdolf