Skip to content
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

V1 #2760

Merged

V1 #2760

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
4 changes: 4 additions & 0 deletions .changelog/4253.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:enhancement
notebooks: promoted `google_notebooks_instance` to GA
notebooks: promoted `google_notebooks_environment` to GA
```
1 change: 0 additions & 1 deletion google-beta/iam_api_gateway_api_config_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ resource "google_api_gateway_api_config" "api_cfg" {
}

resource "google_api_gateway_api_config_iam_binding" "foo" {

provider = google-beta
api = google_api_gateway_api_config.api_cfg.api
api_config = google_api_gateway_api_config.api_cfg.api_config_id
Expand Down
1 change: 0 additions & 1 deletion google-beta/iam_api_gateway_api_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ resource "google_api_gateway_api" "api" {
}

resource "google_api_gateway_api_iam_binding" "foo" {

provider = google-beta
project = google_api_gateway_api.api.project
api = google_api_gateway_api.api.api_id
Expand Down
1 change: 0 additions & 1 deletion google-beta/iam_api_gateway_gateway_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ resource "google_api_gateway_gateway" "api_gw" {
}

resource "google_api_gateway_gateway_iam_binding" "foo" {

provider = google-beta
project = google_api_gateway_gateway.api_gw.project
region = google_api_gateway_gateway.api_gw.region
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ resource "google_artifact_registry_repository" "my-repo" {
}

resource "google_artifact_registry_repository_iam_binding" "foo" {

provider = google-beta
project = google_artifact_registry_repository.my-repo.project
location = google_artifact_registry_repository.my-repo.location
Expand Down
1 change: 0 additions & 1 deletion google-beta/iam_compute_machine_image_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ resource "google_compute_machine_image" "image" {
}

resource "google_compute_machine_image_iam_binding" "foo" {

provider = google-beta
project = google_compute_machine_image.image.project
machine_image = google_compute_machine_image.image.name
Expand Down
1 change: 0 additions & 1 deletion google-beta/iam_data_catalog_policy_tag_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ resource "google_data_catalog_taxonomy" "my_taxonomy" {
}

resource "google_data_catalog_policy_tag_iam_binding" "foo" {

provider = google-beta
policy_tag = google_data_catalog_policy_tag.basic_policy_tag.name
role = "%{role}"
Expand Down
1 change: 0 additions & 1 deletion google-beta/iam_data_catalog_taxonomy_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ resource "google_data_catalog_taxonomy" "basic_taxonomy" {
}

resource "google_data_catalog_taxonomy_iam_binding" "foo" {

provider = google-beta
taxonomy = google_data_catalog_taxonomy.basic_taxonomy.name
role = "%{role}"
Expand Down
1 change: 0 additions & 1 deletion google-beta/iam_healthcare_consent_store_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ resource "google_healthcare_consent_store" "my-consent" {
}

resource "google_healthcare_consent_store_iam_binding" "foo" {

provider = google-beta
dataset = google_healthcare_consent_store.my-consent.dataset
consent_store_id = google_healthcare_consent_store.my-consent.name
Expand Down
50 changes: 34 additions & 16 deletions google-beta/iam_notebooks_instance_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package google

import (
"fmt"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
Expand All @@ -30,15 +31,27 @@ func TestAccNotebooksInstanceIamBindingGenerated(t *testing.T) {

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccNotebooksInstanceIamBinding_basicGenerated(context),
},
{
ResourceName: "google_notebooks_instance_iam_binding.foo",
ImportStateId: fmt.Sprintf("projects/%s/locations/%s/instances/%s roles/viewer", getTestProjectFromEnv(), "us-west1-a", fmt.Sprintf("tf-test-notebooks-instance%s", context["random_suffix"])),
ImportState: true,
ImportStateVerify: true,
},
{
// Test Iam Binding update
Config: testAccNotebooksInstanceIamBinding_updateGenerated(context),
},
{
ResourceName: "google_notebooks_instance_iam_binding.foo",
ImportStateId: fmt.Sprintf("projects/%s/locations/%s/instances/%s roles/viewer", getTestProjectFromEnv(), "us-west1-a", fmt.Sprintf("tf-test-notebooks-instance%s", context["random_suffix"])),
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand All @@ -53,12 +66,18 @@ func TestAccNotebooksInstanceIamMemberGenerated(t *testing.T) {

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
Steps: []resource.TestStep{
{
// Test Iam Member creation (no update for member, no need to test)
Config: testAccNotebooksInstanceIamMember_basicGenerated(context),
},
{
ResourceName: "google_notebooks_instance_iam_member.foo",
ImportStateId: fmt.Sprintf("projects/%s/locations/%s/instances/%s roles/viewer user:[email protected]", getTestProjectFromEnv(), "us-west1-a", fmt.Sprintf("tf-test-notebooks-instance%s", context["random_suffix"])),
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand All @@ -73,22 +92,33 @@ func TestAccNotebooksInstanceIamPolicyGenerated(t *testing.T) {

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccNotebooksInstanceIamPolicy_basicGenerated(context),
},
{
ResourceName: "google_notebooks_instance_iam_policy.foo",
ImportStateId: fmt.Sprintf("projects/%s/locations/%s/instances/%s", getTestProjectFromEnv(), "us-west1-a", fmt.Sprintf("tf-test-notebooks-instance%s", context["random_suffix"])),
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccNotebooksInstanceIamPolicy_emptyBinding(context),
},
{
ResourceName: "google_notebooks_instance_iam_policy.foo",
ImportStateId: fmt.Sprintf("projects/%s/locations/%s/instances/%s", getTestProjectFromEnv(), "us-west1-a", fmt.Sprintf("tf-test-notebooks-instance%s", context["random_suffix"])),
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccNotebooksInstanceIamMember_basicGenerated(context map[string]interface{}) string {
return Nprintf(`
resource "google_notebooks_instance" "instance" {
provider = google-beta
name = "tf-test-notebooks-instance%{random_suffix}"
location = "us-west1-a"
machine_type = "e2-medium"
Expand All @@ -99,7 +129,6 @@ resource "google_notebooks_instance" "instance" {
}

resource "google_notebooks_instance_iam_member" "foo" {
provider = google-beta
project = google_notebooks_instance.instance.project
location = google_notebooks_instance.instance.location
instance_name = google_notebooks_instance.instance.name
Expand All @@ -112,7 +141,6 @@ resource "google_notebooks_instance_iam_member" "foo" {
func testAccNotebooksInstanceIamPolicy_basicGenerated(context map[string]interface{}) string {
return Nprintf(`
resource "google_notebooks_instance" "instance" {
provider = google-beta
name = "tf-test-notebooks-instance%{random_suffix}"
location = "us-west1-a"
machine_type = "e2-medium"
Expand All @@ -123,15 +151,13 @@ resource "google_notebooks_instance" "instance" {
}

data "google_iam_policy" "foo" {
provider = google-beta
binding {
role = "%{role}"
members = ["user:[email protected]"]
}
}

resource "google_notebooks_instance_iam_policy" "foo" {
provider = google-beta
project = google_notebooks_instance.instance.project
location = google_notebooks_instance.instance.location
instance_name = google_notebooks_instance.instance.name
Expand All @@ -143,7 +169,6 @@ resource "google_notebooks_instance_iam_policy" "foo" {
func testAccNotebooksInstanceIamPolicy_emptyBinding(context map[string]interface{}) string {
return Nprintf(`
resource "google_notebooks_instance" "instance" {
provider = google-beta
name = "tf-test-notebooks-instance%{random_suffix}"
location = "us-west1-a"
machine_type = "e2-medium"
Expand All @@ -154,11 +179,9 @@ resource "google_notebooks_instance" "instance" {
}

data "google_iam_policy" "foo" {
provider = google-beta
}

resource "google_notebooks_instance_iam_policy" "foo" {
provider = google-beta
project = google_notebooks_instance.instance.project
location = google_notebooks_instance.instance.location
instance_name = google_notebooks_instance.instance.name
Expand All @@ -170,7 +193,6 @@ resource "google_notebooks_instance_iam_policy" "foo" {
func testAccNotebooksInstanceIamBinding_basicGenerated(context map[string]interface{}) string {
return Nprintf(`
resource "google_notebooks_instance" "instance" {
provider = google-beta
name = "tf-test-notebooks-instance%{random_suffix}"
location = "us-west1-a"
machine_type = "e2-medium"
Expand All @@ -181,8 +203,6 @@ resource "google_notebooks_instance" "instance" {
}

resource "google_notebooks_instance_iam_binding" "foo" {

provider = google-beta
project = google_notebooks_instance.instance.project
location = google_notebooks_instance.instance.location
instance_name = google_notebooks_instance.instance.name
Expand All @@ -195,7 +215,6 @@ resource "google_notebooks_instance_iam_binding" "foo" {
func testAccNotebooksInstanceIamBinding_updateGenerated(context map[string]interface{}) string {
return Nprintf(`
resource "google_notebooks_instance" "instance" {
provider = google-beta
name = "tf-test-notebooks-instance%{random_suffix}"
location = "us-west1-a"
machine_type = "e2-medium"
Expand All @@ -206,7 +225,6 @@ resource "google_notebooks_instance" "instance" {
}

resource "google_notebooks_instance_iam_binding" "foo" {
provider = google-beta
project = google_notebooks_instance.instance.project
location = google_notebooks_instance.instance.location
instance_name = google_notebooks_instance.instance.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ resource "google_service_directory_namespace" "example" {
}

resource "google_service_directory_namespace_iam_binding" "foo" {

provider = google-beta
name = google_service_directory_namespace.example.name
role = "%{role}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ resource "google_service_directory_service" "example" {
}

resource "google_service_directory_service_iam_binding" "foo" {

provider = google-beta
name = google_service_directory_service.example.name
role = "%{role}"
Expand Down
8 changes: 7 additions & 1 deletion google-beta/resource_notebooks_environment_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestAccNotebooksEnvironment_notebookEnvironmentBasicExample(t *testing.T) {

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
ExternalProviders: map[string]resource.ExternalProvider{
"random": {},
},
Expand All @@ -41,6 +41,12 @@ func TestAccNotebooksEnvironment_notebookEnvironmentBasicExample(t *testing.T) {
{
Config: testAccNotebooksEnvironment_notebookEnvironmentBasicExample(context),
},
{
ResourceName: "google_notebooks_environment.environment",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"name", "location"},
},
},
})
}
Expand Down
Loading