Skip to content

Commit

Permalink
[CLOUDGA-25427] Remove GOOGLECLOUD integration Feature flag and add d…
Browse files Browse the repository at this point in the history
…ocumentation (#146)

Remove GCP integration FF
  • Loading branch information
Siddarth-Baldwa authored Jan 3, 2025
1 parent 7c17d25 commit cf43d9d
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 11 deletions.
22 changes: 22 additions & 0 deletions docs/resources/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<project_id>"
private_key_id = "<private_key_id>"
private_key = "<private_key>"
client_email = "<client_email>"
client_id = "<client_id>"
auth_uri = "<auth_uri>"
token_uri = "<token_uri>"
auth_provider_x509_cert_url = "<auth_provider_x509_cert_url>"
client_x509_cert_url = "<client_x509_cert_url>"
universe_domain = "<universe_domain>"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand Down
17 changes: 17 additions & 0 deletions examples/resources/ybm_integration/googlecloud-integration.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
resource "ybm_integration" "gcp" {
config_name = "gcp-example"
type = "GOOGLECLOUD"
googlecloud_spec = {
type = "service_account"
project_id = "<project_id>"
private_key_id = "<private_key_id>"
private_key = "<private_key>"
client_email = "<client_email>"
client_id = "<client_id>"
auth_uri = "<auth_uri>"
token_uri = "<token_uri>"
auth_provider_x509_cert_url = "<auth_provider_x509_cert_url>"
client_x509_cert_url = "<client_x509_cert_url>"
universe_domain = "<universe_domain>"
}
}
10 changes: 4 additions & 6 deletions managed/fflags/feature_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 0 additions & 5 deletions managed/resource_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions templates/resources/integration.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit cf43d9d

Please sign in to comment.