grafana / terraform-provider-grafana

Terraform Grafana provider
https://www.terraform.io/docs/providers/grafana/
Mozilla Public License 2.0
435 stars 229 forks source link

Update team id at oncall resources are not effective #854

Closed project0 closed 1 year ago

project0 commented 1 year ago

Terraform Version

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

data "grafana_oncall_team" "team" {
  name = "Switch team"
}

resource "grafana_oncall_on_call_shift" "platform_oncall" {
  team_id  = data.grafana_oncall_team.team.id
 ....
}

Expected Behavior

Force replace resources or update the team.

Actual Behavior

When updating the team id it never updates. The plan keeps changing on every run and the resource is never updated with the new team.

  # grafana_oncall_schedule.platform_oncall will be updated in-place
  ~ resource "grafana_oncall_schedule" "platform_oncall" {
        id                 = "SLIWJS4X2UWCE"
        name               = "Platform"
      + team_id            = "TNW1ZIT5HWI1Y"
        # (4 unchanged attributes hidden)
    }

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
prajith-nair commented 1 year ago

Your current configuration looks like below :

data "grafana_oncall_team" "team" {
  name = "Switch team"
}

resource "grafana_oncall_on_call_shift" "platform_oncall" {
  team_id  = data.grafana_oncall_team.id
 ....
}

Are you missing below in your config ?

team_id = data.grafana_oncall_team.**team**.id as opposed to team_id = data.grafana_oncall_team.id

project0 commented 1 year ago

@prajith-nair true, the example was not correct. I have updated the example.