OpsLevel / terraform-provider-opslevel

Terraform provider for OpsLevel.com
https://registry.terraform.io/providers/OpsLevel/opslevel/latest/docs
MIT License
8 stars 5 forks source link

convert service tags to type set from list, skip reorder only updates #359

Closed davidbloss closed 2 months ago

davidbloss commented 2 months ago

Issues

opslevel_serivce tags update errors with the new provider upgrade

Changelog

Convert type of service tags from list to set.

Tophatting

With this Terraform config

resource "opslevel_service" "example" {
  name = "frosting-patrol1"
  tags = []
}

Create a Service with an empty list of tags, terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # opslevel_service.example will be created
  + resource "opslevel_service" "example" {
      + id   = (known after apply)
      + name = "frosting-patrol1"
      + tags = []
    }

Plan: 1 to add, 0 to change, 0 to destroy.
opslevel_service.example: Creating...
opslevel_service.example: Creation complete after 0s [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Update this Terraform config, populate tags and terraform apply

resource "opslevel_service" "example" {
  name = "frosting-patrol1"
  tags = ["one:two", "a:b", "cheese:crackers"]
}

Update Service with populated list of tags, terraform apply

opslevel_service.example: Refreshing state... [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # opslevel_service.example will be updated in-place
  ~ resource "opslevel_service" "example" {
        id   = "Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk"
        name = "frosting-patrol1"
      ~ tags = [
          + "a:b",
          + "cheese:crackers",
          + "one:two",
        ]
    }

Plan: 0 to add, 1 to change, 0 to destroy.
opslevel_service.example: Modifying... [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk]
opslevel_service.example: Modifications complete after 2s [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Update this Terraform config, tags set to empty and terraform apply

resource "opslevel_service" "example" {
  name = "frosting-patrol1"
  tags = []
}

Update Service with tags empty, terraform apply

opslevel_service.example: Refreshing state... [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # opslevel_service.example will be updated in-place
  ~ resource "opslevel_service" "example" {
        id   = "Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk"
        name = "frosting-patrol1"
      ~ tags = [
          - "a:b",
          - "cheese:crackers",
          - "one:two",
        ]
    }

Plan: 0 to add, 1 to change, 0 to destroy.
opslevel_service.example: Modifying... [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk]
opslevel_service.example: Modifications complete after 3s [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Update this Terraform config, tags set to null (same as omitted) and terraform apply

resource "opslevel_service" "example" {
  name = "frosting-patrol1"
  tags = null
}

Update this Terraform config, tags set to null and terraform apply

opslevel_service.example: Refreshing state... [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # opslevel_service.example will be updated in-place
  ~ resource "opslevel_service" "example" {
        id   = "Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk"
        name = "frosting-patrol1"
      - tags = [] -> null
    }

Plan: 0 to add, 1 to change, 0 to destroy.
opslevel_service.example: Modifying... [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk]
opslevel_service.example: Modifications complete after 1s [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Destroy created service, terraform destroy

opslevel_service.example: Refreshing state... [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  # opslevel_service.example will be destroyed
  - resource "opslevel_service" "example" {
      - id   = "Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk" -> null
      - name = "frosting-patrol1" -> null
    }

Plan: 0 to add, 0 to change, 1 to destroy.
opslevel_service.example: Destroying... [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjQwOTk]
opslevel_service.example: Destruction complete after 6s

Destroy complete! Resources: 1 destroyed.