Skip to content

remove deprecated integration client fields #7977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/11450.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:breaking-change
integrations: `create_sample_workflows` and `provision_gmek` are removed from `google_integrations_client`
```
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func testAccIntegrationsAuthConfig_full(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_integrations_client" "client" {
location = "southamerica-west1"
provision_gmek = true
create_sample_integrations = true
}

resource "google_integrations_auth_config" "update_example" {
Expand All @@ -74,7 +74,7 @@ func testAccIntegrationsAuthConfig_update(context map[string]interface{}) string
return acctest.Nprintf(`
resource "google_integrations_client" "client" {
location = "southamerica-west1"
provision_gmek = true
create_sample_integrations = true
}

resource "google_integrations_auth_config" "update_example" {
Expand Down
46 changes: 4 additions & 42 deletions google-beta/services/integrations/resource_integrations_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,30 +107,12 @@ encrypted with GMEK.`,
},
},
},
ConflictsWith: []string{"provision_gmek"},
},
"create_sample_integrations": {
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
Description: `Indicates if sample integrations should be created along with provisioning.`,
ConflictsWith: []string{"create_sample_workflows"},
},
"create_sample_workflows": {
Type: schema.TypeBool,
Optional: true,
Deprecated: "`create_sample_workflows` is deprecated and will be removed in a future major release. Use `create_sample_integrations` instead.",
ForceNew: true,
Description: `Indicates if sample workflow should be created along with provisioning.`,
ConflictsWith: []string{"create_sample_integrations"},
},
"provision_gmek": {
Type: schema.TypeBool,
Optional: true,
Deprecated: "`provision_gmek` is deprecated and will be removed in a future major release. Client would be provisioned as gmek if `cloud_kms_config` is not given.",
ForceNew: true,
Description: `Indicates provision with GMEK or CMEK.`,
ConflictsWith: []string{"cloud_kms_config"},
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
Description: `Indicates if sample integrations should be created along with provisioning.`,
},
"run_as_service_account": {
Type: schema.TypeString,
Expand Down Expand Up @@ -163,24 +145,12 @@ func resourceIntegrationsClientCreate(d *schema.ResourceData, meta interface{})
} else if v, ok := d.GetOkExists("cloud_kms_config"); !tpgresource.IsEmptyValue(reflect.ValueOf(cloudKmsConfigProp)) && (ok || !reflect.DeepEqual(v, cloudKmsConfigProp)) {
obj["cloudKmsConfig"] = cloudKmsConfigProp
}
createSampleWorkflowsProp, err := expandIntegrationsClientCreateSampleWorkflows(d.Get("create_sample_workflows"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("create_sample_workflows"); !tpgresource.IsEmptyValue(reflect.ValueOf(createSampleWorkflowsProp)) && (ok || !reflect.DeepEqual(v, createSampleWorkflowsProp)) {
obj["createSampleWorkflows"] = createSampleWorkflowsProp
}
createSampleIntegrationsProp, err := expandIntegrationsClientCreateSampleIntegrations(d.Get("create_sample_integrations"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("create_sample_integrations"); !tpgresource.IsEmptyValue(reflect.ValueOf(createSampleIntegrationsProp)) && (ok || !reflect.DeepEqual(v, createSampleIntegrationsProp)) {
obj["createSampleIntegrations"] = createSampleIntegrationsProp
}
provisionGmekProp, err := expandIntegrationsClientProvisionGmek(d.Get("provision_gmek"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("provision_gmek"); !tpgresource.IsEmptyValue(reflect.ValueOf(provisionGmekProp)) && (ok || !reflect.DeepEqual(v, provisionGmekProp)) {
obj["provisionGmek"] = provisionGmekProp
}
runAsServiceAccountProp, err := expandIntegrationsClientRunAsServiceAccount(d.Get("run_as_service_account"), d, config)
if err != nil {
return err
Expand Down Expand Up @@ -445,18 +415,10 @@ func expandIntegrationsClientCloudKmsConfigKmsProjectId(v interface{}, d tpgreso
return v, nil
}

func expandIntegrationsClientCreateSampleWorkflows(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}

func expandIntegrationsClientCreateSampleIntegrations(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}

func expandIntegrationsClientProvisionGmek(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}

func expandIntegrationsClientRunAsServiceAccount(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestAccIntegrationsClient_integrationsClientBasicExample(t *testing.T) {
ResourceName: "google_integrations_client.example",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"cloud_kms_config", "create_sample_integrations", "create_sample_workflows", "location", "provision_gmek", "run_as_service_account"},
ImportStateVerifyIgnore: []string{"cloud_kms_config", "create_sample_integrations", "location", "run_as_service_account"},
},
},
})
Expand Down Expand Up @@ -83,7 +83,7 @@ func TestAccIntegrationsClient_integrationsClientFullExample(t *testing.T) {
ResourceName: "google_integrations_client.example",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"cloud_kms_config", "create_sample_integrations", "create_sample_workflows", "location", "provision_gmek", "run_as_service_account"},
ImportStateVerifyIgnore: []string{"cloud_kms_config", "create_sample_integrations", "location", "run_as_service_account"},
},
},
})
Expand Down Expand Up @@ -129,41 +129,6 @@ resource "google_integrations_client" "example" {
`, context)
}

func TestAccIntegrationsClient_integrationsClientDeprecatedFieldsExample(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": acctest.RandString(t, 10),
}

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
CheckDestroy: testAccCheckIntegrationsClientDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccIntegrationsClient_integrationsClientDeprecatedFieldsExample(context),
},
{
ResourceName: "google_integrations_client.example",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"cloud_kms_config", "create_sample_integrations", "create_sample_workflows", "location", "provision_gmek", "run_as_service_account"},
},
},
})
}

func testAccIntegrationsClient_integrationsClientDeprecatedFieldsExample(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_integrations_client" "example" {
location = "asia-south1"
provision_gmek = true
create_sample_workflows = true
}
`, context)
}

func testAccCheckIntegrationsClientDestroyProducer(t *testing.T) func(s *terraform.State) error {
return func(s *terraform.State) error {
for name, rs := range s.RootModule().Resources {
Expand Down
6 changes: 6 additions & 0 deletions website/docs/guides/version_6_upgrade.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,12 @@ in GCP, including the labels configured through Terraform, the system, and other

`google_identity_platform_project_default_config` is removed in favor of `google_identity_platform_project_config`

## Resource: `google_integrations_client`

### `create_sample_worklfows` and `provision_gmek` is now removed

`create_sample_worklfows` and `provision_gmek` is now removed in favor of `create_sample_integrations`

## Resource: `google_project`

### Project deletion now prevented by default with `deletion_policy`
Expand Down
12 changes: 0 additions & 12 deletions website/docs/r/integrations_client.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,10 @@ The following arguments are supported:
Cloud KMS config for AuthModule to encrypt/decrypt credentials.
Structure is [documented below](#nested_cloud_kms_config).

* `create_sample_workflows` -
(Optional, Deprecated)
Indicates if sample workflow should be created along with provisioning.

~> **Warning:** `create_sample_workflows` is deprecated and will be removed in a future major release. Use `create_sample_integrations` instead.

* `create_sample_integrations` -
(Optional)
Indicates if sample integrations should be created along with provisioning.

* `provision_gmek` -
(Optional, Deprecated)
Indicates provision with GMEK or CMEK.

~> **Warning:** `provision_gmek` is deprecated and will be removed in a future major release. Client would be provisioned as gmek if `cloud_kms_config` is not given.

* `run_as_service_account` -
(Optional)
User input run-as service account, if empty, will bring up a new default service account.
Expand Down