From cf43d9dfad75a468c80a37ee6e4079094b8093c5 Mon Sep 17 00:00:00 2001 From: Siddarth Baldwa <50803248+Siddarth-Baldwa@users.noreply.github.com> Date: Fri, 3 Jan 2025 13:40:32 +0530 Subject: [PATCH] [CLOUDGA-25427] Remove GOOGLECLOUD integration Feature flag and add documentation (#146) Remove GCP integration FF --- docs/resources/integration.md | 22 +++++++++++++++++++ .../googlecloud-integration.tf | 17 ++++++++++++++ managed/fflags/feature_flags.go | 10 ++++----- managed/resource_integration.go | 5 ----- templates/resources/integration.md.tmpl | 4 ++++ 5 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 examples/resources/ybm_integration/googlecloud-integration.tf diff --git a/docs/resources/integration.md b/docs/resources/integration.md index 421e0b0..eedd0f9 100644 --- a/docs/resources/integration.md +++ b/docs/resources/integration.md @@ -82,6 +82,28 @@ resource "ybm_integration" "victoriametrics" { } ``` +To create GoogleCloud integration + +```terraform +resource "ybm_integration" "gcp" { + config_name = "gcp-example" + type = "GOOGLECLOUD" + googlecloud_spec = { + type = "service_account" + project_id = "" + private_key_id = "" + private_key = "" + client_email = "" + client_id = "" + auth_uri = "" + token_uri = "" + auth_provider_x509_cert_url = "" + client_x509_cert_url = "" + universe_domain = "" + } +} +``` + ## Schema diff --git a/examples/resources/ybm_integration/googlecloud-integration.tf b/examples/resources/ybm_integration/googlecloud-integration.tf new file mode 100644 index 0000000..bbbe38b --- /dev/null +++ b/examples/resources/ybm_integration/googlecloud-integration.tf @@ -0,0 +1,17 @@ +resource "ybm_integration" "gcp" { + config_name = "gcp-example" + type = "GOOGLECLOUD" + googlecloud_spec = { + type = "service_account" + project_id = "" + private_key_id = "" + private_key = "" + client_email = "" + client_id = "" + auth_uri = "" + token_uri = "" + auth_provider_x509_cert_url = "" + client_x509_cert_url = "" + universe_domain = "" + } +} diff --git a/managed/fflags/feature_flags.go b/managed/fflags/feature_flags.go index fb22cf2..4171f15 100644 --- a/managed/fflags/feature_flags.go +++ b/managed/fflags/feature_flags.go @@ -13,15 +13,13 @@ import ( type FeatureFlag string const ( - GOOGLECLOUD_INTEGRATION_ENABLED FeatureFlag = "GOOGLECLOUD_INTEGRATION_ENABLED" - CONNECTION_POOLING FeatureFlag = "CONNECTION_POOLING" - DR FeatureFlag = "DR" + CONNECTION_POOLING FeatureFlag = "CONNECTION_POOLING" + DR FeatureFlag = "DR" ) var flagEnabled = map[FeatureFlag]bool{ - GOOGLECLOUD_INTEGRATION_ENABLED: false, - CONNECTION_POOLING: false, - DR: false, + CONNECTION_POOLING: false, + DR: false, } func (f FeatureFlag) String() string { diff --git a/managed/resource_integration.go b/managed/resource_integration.go index 93bc813..4f01b70 100644 --- a/managed/resource_integration.go +++ b/managed/resource_integration.go @@ -16,7 +16,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" - "github.com/yugabyte/terraform-provider-ybm/managed/fflags" planmodifier "github.com/yugabyte/terraform-provider-ybm/managed/plan_modifier" openapiclient "github.com/yugabyte/yugabytedb-managed-go-client-internal" ) @@ -329,10 +328,6 @@ func (r resourceIntegration) Create(ctx context.Context, req tfsdk.CreateResourc resp.Diagnostics.AddError(GetApiErrorDetails(err), "") return } - if *telemetrySinkTypeEnum == openapiclient.TELEMETRYPROVIDERTYPEENUM_GOOGLECLOUD && !fflags.IsFeatureFlagEnabled(fflags.GOOGLECLOUD_INTEGRATION_ENABLED) { - resp.Diagnostics.AddError("Invalid integration type", "Integration of type GOOGLECLOUD is currently not supported") - return - } apiClient := r.p.client diff --git a/templates/resources/integration.md.tmpl b/templates/resources/integration.md.tmpl index a4533e6..62276de 100644 --- a/templates/resources/integration.md.tmpl +++ b/templates/resources/integration.md.tmpl @@ -31,4 +31,8 @@ To create VictoriaMetrics integration {{ tffile "examples/resources/ybm_integration/victoriametrics-integration.tf" }} +To create GoogleCloud integration + +{{ tffile "examples/resources/ybm_integration/googlecloud-integration.tf" }} + {{ .SchemaMarkdown | trimspace }}