diff --git a/.changelog/4323.txt b/.changelog/4323.txt new file mode 100644 index 0000000000..8ec013c069 --- /dev/null +++ b/.changelog/4323.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` diff --git a/google-beta/data_source_google_composer_environment.go b/google-beta/data_source_google_composer_environment.go index 6713545b03..9c39c0c04b 100644 --- a/google-beta/data_source_google_composer_environment.go +++ b/google-beta/data_source_google_composer_environment.go @@ -7,9 +7,17 @@ import ( ) func dataSourceGoogleComposerEnvironment() *schema.Resource { + dsSchema := datasourceSchemaFromResourceSchema(resourceComposerEnvironment().Schema) + + // Set 'Required' schema elements + addRequiredFieldsToSchema(dsSchema, "name") + + // Set 'Optional' schema elements + addOptionalFieldsToSchema(dsSchema, "project", "region") + return &schema.Resource{ Read: dataSourceGoogleComposerEnvironmentRead, - Schema: resourceComposerEnvironment().Schema, + Schema: dsSchema, } } diff --git a/google-beta/data_source_google_composer_environment_test.go b/google-beta/data_source_google_composer_environment_test.go index 9fe045bd6c..5291d590f2 100644 --- a/google-beta/data_source_google_composer_environment_test.go +++ b/google-beta/data_source_google_composer_environment_test.go @@ -104,9 +104,8 @@ resource "google_compute_subnetwork" "test" { } data "google_composer_environment" "test" { - name = google_composer_environment.test.name - - depends_on = [google_composer_environment.test] + name = google_composer_environment.test.name + region = google_composer_environment.test.region } `, context) } diff --git a/google-beta/resource_composer_environment_test.go b/google-beta/resource_composer_environment_test.go index 9750ee8783..9279d1462b 100644 --- a/google-beta/resource_composer_environment_test.go +++ b/google-beta/resource_composer_environment_test.go @@ -881,7 +881,7 @@ resource "google_composer_environment" "test" { } software_config { pypi_packages = { - scipy = "==1.1.0" + numpy = "" } } }