diff --git a/.changelog/711.txt b/.changelog/711.txt new file mode 100644 index 000000000..892285039 --- /dev/null +++ b/.changelog/711.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +harness_platform_service_overrides_v2 - Updated docs to use yaml format for the yaml property of overrides instead of json format. +``` diff --git a/docs/data-sources/platform_service_overrides_v2.md b/docs/data-sources/platform_service_overrides_v2.md index 1010b72b0..b531b579c 100644 --- a/docs/data-sources/platform_service_overrides_v2.md +++ b/docs/data-sources/platform_service_overrides_v2.md @@ -35,7 +35,6 @@ data "harness_platform_service_overrides_v2" "test" { ### Read-Only - `id` (String) The ID of this resource. -- `cluster_id` (String) The GitOps cluster ID to which the override entity is associated. - `infra_id` (String) The infrastructure ID to which the override entity is associated. - `service_id` (String) The service ID to which the override entity is associated. - `env_id` (String) The environment ID to which the override entity is associated. diff --git a/docs/resources/platform_service_overrides_v2.md b/docs/resources/platform_service_overrides_v2.md index 87df99d19..2571c6da6 100644 --- a/docs/resources/platform_service_overrides_v2.md +++ b/docs/resources/platform_service_overrides_v2.md @@ -19,53 +19,31 @@ resource "harness_platform_service_overrides_v2" "test" { env_id = "environmentIdentifier" service_id = "serviceIdentifier" infra_id = "infraIdentifier" - cluster_id = "clusterIdentifier" type = "INFRA_SERVICE_OVERRIDE" yaml = <<-EOT - { - "variables": [ - { - "name": "v1", - "type": "String", - "value": "val1" - } - ], - "configFiles": [ - { - "configFile": { - "identifier": "sampleConfigFile", - "spec": { - "store": { - "type": "Harness", - "spec": { - "files": [ - "/launchTemplate2" - ] - } - } - } - } - } - ], - "manifests": [ - { - "manifest": { - "identifier": "sampleManifest", - "type": "AsgLaunchTemplate", - "spec": { - "store": { - "type": "Harness", - "spec": { - "files": [ - "/launchTemplate1" - ] - } - } - } - } - } - ] - } + variables: + - name: var1 + type: String + value: val1 + configFiles: + - configFile: + identifier: sampleConfigFile + spec: + store: + type: Harness + spec: + files: + - account:/configFile1 + manifests: + - manifest: + identifier: sampleManifestFile + type: Values + spec: + store: + type: Harness + spec: + files: + - account:/manifestFile1 EOT } ``` @@ -85,7 +63,6 @@ resource "harness_platform_service_overrides_v2" "test" { ### Optional -- `cluster_id` (String) The GitOps cluster ID to which the override entity is associated. (This is required only when creating overrides for GitOps cluster infrastructure) - `infra_id` (String) The infrastructure ID to which the override entity is associated. - `org_id` (String) Unique identifier of the organization. - `project_id` (String) Unique identifier of the project. diff --git a/examples/resources/harness_platform_service_overrides_v2/resource.tf b/examples/resources/harness_platform_service_overrides_v2/resource.tf index 1d015c6e0..2a306269b 100644 --- a/examples/resources/harness_platform_service_overrides_v2/resource.tf +++ b/examples/resources/harness_platform_service_overrides_v2/resource.tf @@ -4,52 +4,30 @@ resource "harness_platform_service_overrides_v2" "test" { env_id = "environmentIdentifier" service_id = "serviceIdentifier" infra_id = "infraIdentifier" - cluster_id = "clusterIdentifier" - type = "ENV_SERVICE_OVERRIDE" + type = "INFRA_SERVICE_OVERRIDE" yaml = <<-EOT - { - "variables": [ - { - "name": "v1", - "type": "String", - "value": "val1" - } - ], - "configFiles": [ - { - "configFile": { - "identifier": "sampleConfigFile", - "spec": { - "store": { - "type": "Harness", - "spec": { - "files": [ - "/launchTemplate2" - ] - } - } - } - } - } - ], - "manifests": [ - { - "manifest": { - "identifier": "sampleManifest", - "type": "AsgLaunchTemplate", - "spec": { - "store": { - "type": "Harness", - "spec": { - "files": [ - "/launchTemplate1" - ] - } - } - } - } - } - ] - } + variables: + - name: var1 + type: String + value: val1 + configFiles: + - configFile: + identifier: sampleConfigFile + spec: + store: + type: Harness + spec: + files: + - account:/configFile1 + manifests: + - manifest: + identifier: sampleManifestFile + type: Values + spec: + store: + type: Harness + spec: + files: + - account:/manifestFile1 EOT } diff --git a/internal/service/platform/service_overrides_v2/data_source_service_overrides_v2_test.go b/internal/service/platform/service_overrides_v2/data_source_service_overrides_v2_test.go index 78bd9c481..06da9688c 100644 --- a/internal/service/platform/service_overrides_v2/data_source_service_overrides_v2_test.go +++ b/internal/service/platform/service_overrides_v2/data_source_service_overrides_v2_test.go @@ -99,55 +99,34 @@ func testAccDataSourceServiceOverrides(id string, name string) string { service_id = harness_platform_service.test.id type = "ENV_SERVICE_OVERRIDE" yaml = <<-EOT - { - "variables": [ - { - "name": "v1", - "type": "String", - "value": "val1" - } - ], - "manifests": [ - { - "manifest": { - "identifier": "manifest1", - "type": "K8sManifest", - "spec": { - "store": { - "type": "Github", - "spec": { - "connectorRef": "<+input>", - "gitFetchType": "Branch", - "paths": [ - "files1" - ], - "repoName": "<+input>", - "branch": "master" - } - }, - "skipResourceVersioning": false - } - } - } - ], - "configFiles": [ - { - "configFile": { - "identifier": "configFile1", - "spec": { - "store": { - "type": "Harness", - "spec": { - "files": [ - "<+org.description>" - ] - } - } - } - } - } - ] - } +variables: + - name: v1 + type: String + value: val1 +manifests: + - manifest: + identifier: manifest1 + type: K8sManifest + spec: + store: + type: Github + spec: + connectorRef: "<+input>" + gitFetchType: Branch + paths: + - files1 + repoName: "<+input>" + branch: master + skipResourceVersioning: false +configFiles: + - configFile: + identifier: configFile1 + spec: + store: + type: Harness + spec: + files: + - "<+org.description>" EOT } @@ -163,15 +142,10 @@ func testAccDataSourceServiceOverrides(id string, name string) string { env_id = data.harness_platform_service_overrides_v2.test.env_id type = "ENV_GLOBAL_OVERRIDE" yaml = <<-EOT - { - "variables": [ - { - "name": "v2", - "type": "String", - "value": "val2" - } - ] -} +variables: + - name: v2 + type: String + value: val2 EOT } `, id, name)