Closed davidbloss closed 4 months ago
fix unsetting Service lifecycleAlias and tierAlias fields
Use downstream String scalar that matches our GraphQL API. See opslevel-go PR ⚠️ Depends on this opslevel-go PR being merged first.
String
changie
resource "opslevel_service" "test" { api_document_path = "my/path/doc.yaml" description = "fancy things" framework = "da-best" language = "go" lifecycle_alias = "alpha" name = "tophatting-service" owner = "platform" preferred_api_document_source = "PUSH" product = "tophat" tags = ["key:value"] tier_alias = "tier_2" }
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.test will be created + resource "opslevel_service" "test" { + api_document_path = "my/path/doc.yaml" + description = "fancy things" + framework = "da-best" + id = (known after apply) + language = "go" + last_updated = (known after apply) + lifecycle_alias = "alpha" + name = "tophatting-service" + owner = "platform" + preferred_api_document_source = "PUSH" + product = "tophat" + tags = [ + "key:value", ] + tier_alias = "tier_2" } Plan: 1 to add, 0 to change, 0 to destroy. opslevel_service.test: Creating... opslevel_service.test: Creation complete after 3s [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjE4MjM] Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
lifecycle_alias
tier_alias
resource "opslevel_service" "test" { api_document_path = "my/path/doc.yaml" description = "fancy things" framework = "da-best" language = "go" # lifecycle_alias = "alpha" name = "tophatting-service" owner = "platform" preferred_api_document_source = "PUSH" product = "tophat" tags = ["key:value"] # tier_alias = "tier_2" }
null
opslevel_service.test: Refreshing state... [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjE4MjM] 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.test will be updated in-place ~ resource "opslevel_service" "test" { id = "Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjE4MjM" + last_updated = (known after apply) - lifecycle_alias = "alpha" -> null name = "tophatting-service" tags = [ "key:value", ] - tier_alias = "tier_2" -> null # (7 unchanged attributes hidden) } Plan: 0 to add, 1 to change, 0 to destroy. opslevel_service.test: Modifying... [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjE4MjM] opslevel_service.test: Modifications complete after 3s [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjE4MjM] Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
task destroy
opslevel_service.test: Refreshing state... [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjE4MjM] 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.test will be destroyed - resource "opslevel_service" "test" { - api_document_path = "my/path/doc.yaml" -> null - description = "fancy things" -> null - framework = "da-best" -> null - id = "Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjE4MjM" -> null - language = "go" -> null - name = "tophatting-service" -> null - owner = "platform" -> null - preferred_api_document_source = "PUSH" -> null - product = "tophat" -> null - tags = [ - "key:value", ] -> null } Plan: 0 to add, 0 to change, 1 to destroy. opslevel_service.test: Destroying... [id=Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS8xMjE4MjM] opslevel_service.test: Destruction complete after 3s Destroy complete! Resources: 1 destroyed.
Issues
fix unsetting Service lifecycleAlias and tierAlias fields
Changelog
Use downstream
String
scalar that matches our GraphQL API. See opslevel-go PR ⚠️ Depends on this opslevel-go PR being merged first.changie
entryTophatting
With this config
Create service with tierAlias and lifecycleAlias fields defined. Run
terraform apply
Unset
lifecycle_alias
andtier_alias
fieldsUpdate service, setting tierAlias and lifecycleAlias fields to
null
. Runterraform apply
Destroy service,
task destroy