diff --git a/.ci/containers/gcb-terraform-vcr-tester/test_terraform_vcr.sh b/.ci/containers/gcb-terraform-vcr-tester/test_terraform_vcr.sh index b62e4c6e9dab..58b5449d51df 100755 --- a/.ci/containers/gcb-terraform-vcr-tester/test_terraform_vcr.sh +++ b/.ci/containers/gcb-terraform-vcr-tester/test_terraform_vcr.sh @@ -98,7 +98,7 @@ while [[ -n $TESTS_TERMINATED ]]; do gsutil -h "Content-Type:text/plain" -q cp replaying_test$test_suffix.log gs://ci-vcr-logs/beta/refs/heads/auto-pr-$pr_number/artifacts/$build_id/build-log/ if [[ $counter -gt 3 ]]; then - comment="Failed to run VCR tests in REPLAYING mode${NEWLINE}" + comment="$\textcolor{red}{\textsf{Failed to run VCR tests in REPLAYING mode}}$ ${NEWLINE}" comment+="View the [build log](https://storage.cloud.google.com/ci-vcr-logs/beta/refs/heads/auto-pr-$pr_number/artifacts/$build_id/build-log/replaying_test$test_suffix.log)${NEWLINE}" comment+="If you believe the error is unrelated to your PR, please rerun the tests" add_comment "${comment}" @@ -128,8 +128,8 @@ gsutil -h "Content-Type:text/plain" -m -q cp testlog/replaying/* gs://ci-vcr-log TESTS_PANIC=$(grep "^panic: " replaying_test$test_suffix.log) if [[ -n $TESTS_PANIC ]]; then - comment="The provider crashed while running the VCR tests in REPLAYING mode${NEWLINE}" - comment+="Please fix it to complete your PR${NEWLINE}" + comment="$\textcolor{red}{\textsf{The provider crashed while running the VCR tests in REPLAYING mode}}$ ${NEWLINE}" + comment+="$\textcolor{red}{\textsf{Please fix it to complete your PR}}$ ${NEWLINE}" comment+="View the [build log](https://storage.cloud.google.com/ci-vcr-logs/beta/refs/heads/auto-pr-$pr_number/artifacts/$build_id/build-log/replaying_test$test_suffix.log)" add_comment "${comment}" update_status "failure" @@ -181,7 +181,7 @@ if [[ -n $FAILED_TESTS_PATTERN ]]; then export VCR_MODE=RECORDING FAILED_TESTS=$(grep "^--- FAIL: TestAcc" replaying_test$test_suffix.log | awk '{print $3}') # test_exit_code=0 - parallel --jobs 16 TF_LOG=DEBUG TF_LOG_PATH_MASK=$local_path/testlog/recording/%s.log TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test $GOOGLE_TEST_DIRECTORY -parallel 1 -v -run="{}$" -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc" ">" testlog/recording_build/{}_recording_test.log ::: $FAILED_TESTS + parallel --jobs 16 TF_LOG=DEBUG TF_LOG_PATH_MASK=$local_path/testlog/recording/%s.log TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test {1} -parallel 1 -v -run="{2}$" -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc" ">>" testlog/recording_build/{2}_recording_test.log ::: $GOOGLE_TEST_DIRECTORY ::: $FAILED_TESTS test_exit_code=$? @@ -208,8 +208,9 @@ if [[ -n $FAILED_TESTS_PATTERN ]]; then RECORDING_TESTS_PANIC=$(grep "^panic: " recording_test.log) if [[ -n $RECORDING_TESTS_PANIC ]]; then - comment="The provider crashed while running the VCR tests in RECORDING mode${NEWLINE}" - comment+="Please fix it to complete your PR${NEWLINE}" + + comment="$\textcolor{red}{\textsf{The provider crashed while running the VCR tests in RECORDING mode}}$ ${NEWLINE}" + comment+="$\textcolor{red}{\textsf{Please fix it to complete your PR}}$ ${NEWLINE}" comment+="View the [build log](https://storage.cloud.google.com/ci-vcr-logs/beta/refs/heads/auto-pr-$pr_number/artifacts/$build_id/build-log/recording_test.log)" add_comment "${comment}" update_status "failure" @@ -225,16 +226,16 @@ if [[ -n $FAILED_TESTS_PATTERN ]]; then RECORDING_PASSED_TESTS_COUNT=0 RECORDING_FAILED_TESTS_COUNT=0 if [[ -n $RECORDING_PASSED_TESTS ]]; then - comment+="Tests passed during RECORDING mode:${NEWLINE} $RECORDING_PASSED_TESTS ${NEWLINE}${NEWLINE}" + comment+="$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$ ${NEWLINE} $RECORDING_PASSED_TESTS ${NEWLINE}${NEWLINE}" RECORDING_PASSED_TESTS_COUNT=$(echo "$RECORDING_PASSED_TESTS" | wc -l) comment+="##### Rerun these tests in REPLAYING mode to catch issues ${NEWLINE}${NEWLINE}" # Rerun passed tests in REPLAYING mode 3 times to catch issues export VCR_MODE=REPLAYING count=3 - parallel --jobs 16 TF_LOG=DEBUG TF_LOG_PATH_MASK=$local_path/testlog/replaying_after_recording/%s.log TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test $GOOGLE_TEST_DIRECTORY -parallel 1 -count=$count -v -run="{}$" -timeout 120m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc" ">" testlog/replaying_build_after_recording/{}_replaying_test.log ::: $RECORDING_PASSED_TEST_LIST + parallel --jobs 16 TF_LOG=DEBUG TF_LOG_PATH_MASK=$local_path/testlog/replaying_after_recording/%s.log TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test {1} -parallel 1 -count=$count -v -run="{2}$" -timeout 120m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc" ">>" testlog/replaying_build_after_recording/{2}_replaying_test.log ::: $GOOGLE_TEST_DIRECTORY ::: $RECORDING_PASSED_TEST_LIST - test_exit_code=$? + test_exit_code=$(($test_exit_code || $?)) # Concatenate recording build logs to one file for test in $RECORDING_PASSED_TEST_LIST @@ -250,11 +251,11 @@ if [[ -n $FAILED_TESTS_PATTERN ]]; then REPLAYING_FAILED_TESTS=$(grep "^--- FAIL: TestAcc" replaying_build_after_recording.log | sort -u -t' ' -k3,3 | awk -v pr_number=$pr_number -v build_id=$build_id '{print "`"$3"`[[Error message](https://storage.cloud.google.com/ci-vcr-logs/beta/refs/heads/auto-pr-"pr_number"/artifacts/"build_id"/build-log/replaying_build_after_recording/"$3"_replaying_test.log)] [[Debug log](https://storage.cloud.google.com/ci-vcr-logs/beta/refs/heads/auto-pr-"pr_number"/artifacts/"build_id"/replaying_after_recording/"$3".log)]"}') if [[ -n $REPLAYING_FAILED_TESTS ]]; then - comment+="Tests failed when rerunning REPLAYING mode:${NEWLINE} $REPLAYING_FAILED_TESTS ${NEWLINE}${NEWLINE}" + comment+="$\textcolor{red}{\textsf{Tests failed when rerunning REPLAYING mode:}}$ ${NEWLINE} $REPLAYING_FAILED_TESTS ${NEWLINE}${NEWLINE}" comment+="Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.${NEWLINE}${NEWLINE}" - comment+="Please fix these to complete your PR. If you do not know how VCR tests work, please work with the code reviewer to figure out the reason why the tests failed and fix the tests.${NEWLINE}" + comment+="Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.${NEWLINE}" else - comment+="All tests passed after rerunning REPLAYING mode.${NEWLINE}" + comment+="$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$ ${NEWLINE}" fi comment+="${NEWLINE}---${NEWLINE}" @@ -264,18 +265,20 @@ if [[ -n $FAILED_TESTS_PATTERN ]]; then fi if [[ -n $RECORDING_FAILED_TESTS ]]; then - comment+="Tests failed during RECORDING mode:${NEWLINE} $RECORDING_FAILED_TESTS ${NEWLINE}${NEWLINE}" + comment+="$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$ ${NEWLINE} $RECORDING_FAILED_TESTS ${NEWLINE}${NEWLINE}" RECORDING_FAILED_TESTS_COUNT=$(echo "$RECORDING_FAILED_TESTS" | wc -l) if [[ $RECORDING_PASSED_TESTS_COUNT+$RECORDING_FAILED_TESTS_COUNT -lt $FAILED_TESTS_COUNT ]]; then - comment+="Several tests got terminated during RECORDING mode.${NEWLINE}" + comment+="$\textcolor{red}{\textsf{Several tests got terminated during RECORDING mode.}}$ ${NEWLINE}" fi - comment+="Please fix these to complete your PR${NEWLINE}" + comment+="$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ ${NEWLINE}" else if [[ $RECORDING_PASSED_TESTS_COUNT+$RECORDING_FAILED_TESTS_COUNT -lt $FAILED_TESTS_COUNT ]]; then - comment+="Several tests got terminated during RECORDING mode.${NEWLINE}" + comment+="$\textcolor{red}{\textsf{Several tests got terminated during RECORDING mode.}}$ ${NEWLINE}" elif [[ $test_exit_code -ne 0 ]]; then # check for any uncaught errors in RECORDING mode - comment+="Errors occurred during RECORDING mode. Please fix them to complete your PR${NEWLINE}" + comment+="$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$ ${NEWLINE}" + else + comment+="$\textcolor{green}{\textsf{All tests passed!}} ${NEWLINE}" fi fi @@ -285,9 +288,9 @@ if [[ -n $FAILED_TESTS_PATTERN ]]; then else if [[ $test_exit_code -ne 0 ]]; then # check for any uncaught errors errors in REPLAYING mode - comment+="Errors occurred during REPLAYING mode. Please fix them to complete your PR${NEWLINE}" + comment+="$\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR}}$ ${NEWLINE}" else - comment+="All tests passed in REPLAYING mode${NEWLINE}" + comment+="$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$ ${NEWLINE}" fi comment+="View the [build log](https://storage.cloud.google.com/ci-vcr-logs/beta/refs/heads/auto-pr-$pr_number/artifacts/$build_id/build-log/replaying_test$test_suffix.log)" add_comment "${comment}" diff --git a/.ci/containers/membership-checker/membership.go b/.ci/containers/membership-checker/membership.go index 4c3999e50d4b..8cd90ed4d407 100644 --- a/.ci/containers/membership-checker/membership.go +++ b/.ci/containers/membership-checker/membership.go @@ -29,7 +29,7 @@ var ( trustedContributors = []string{} // This is for reviewers who are "on vacation": will not receive new review assignments but will still receive re-requests for assigned PRs. - onVacationReviewers = []string{"melinath"} + onVacationReviewers = []string{} ) // Check if a user is team member to not request a random reviewer diff --git a/.ci/infra/terraform/README.md b/.ci/infra/terraform/README.md index 1c5a99adb525..9dfbb21a34d0 100644 --- a/.ci/infra/terraform/README.md +++ b/.ci/infra/terraform/README.md @@ -57,3 +57,4 @@ Quotas that will need to be adjusted to support all tests: - Cloud Workstation cluster quota in `us-central1` - VMWare Engine nodes per region in `southamerica-west1` - VMWare Engine nodes across regions +- Looker `EnterpriseSubscriptionInstancesPerProjectPerRegion`. This must be requested manually from their team, and can't be self-served in the Cloud Console. diff --git a/docs/content/contribute/review-pr.md b/docs/content/contribute/review-pr.md new file mode 100644 index 000000000000..01e3b67f40cd --- /dev/null +++ b/docs/content/contribute/review-pr.md @@ -0,0 +1,45 @@ +--- +title: "Review a PR" +weight: 11 +--- + +# Review a PR + +This page provides guidelines for reviewing Magic Modules pull requests + +1. Read the PR description to understand the context and ensure the PR either + * is linked to a GitHub issue or an internal bug + * if not, check the [issue tracker](https://github.com/hashicorp/terraform-provider-google/issues) to see whether the feature has already been requested and add the issues in the description, if any. + * establishes clear context itself via title or description. +2. If the PR adds any new resource, ensure that the resource does not already exists in the [GA provider](https://github.com/hashicorp/terraform-provider-google) or [beta provider](https://github.com/hashicorp/terraform-provider-google-beta) +1. Read through all the changes in the PR, generated code in the downstreams and the API documentation to ensure that: + 1. the resource schema added in the PR matches the API structure. + 1. the features are added in the correct version + * features only available in beta are not included in the GA google provider. + * features added to the GA provider are also included in the beta provider -- beta should be a strict superset of GA. + 1. no [breaking changes]({{< ref "/develop/breaking-changes" >}}) are introduced without a valid justification. + 1. verify the change actually resolves the linked issues, if any. +1. Check the tests added/modified to ensure that: + 1. all fields added/updated in the PR appear in at least one test. + * It is advisable to test updating from a non-zero value to a zero value if feasible. + 1. all mutable fields are tested in at least one update test. + 1. all related tests pass in GA for features promoted from beta to GA. + {{< hint info >}}Note: + Presubmit VCR tests do not run in GA. Manual testing is required for promoted GA features. + {{< /hint >}} + 1. newly added or modified diff suppress functions are tested in at least one unit test. + 1. the linked issue (if any) is covered by at least one test that reproduces the issue + * for example - a bugfix should test the bug (or explain why it's not feasible to do so in the description) and an enhancement should test the new behaviour(s). + 1. all related PR presubmit tests have been completed successfully, including: + * terraform-provider-breaking-change-test + * presubmit-rake-tests + * terraform-provider-google-build-and-unit-tests + * terraform-provider-google-beta-build-and-unit-tests + * VCR-test + {{< hint info >}}Note: + Some acceptance tests may be skipped in VCR and manual testing is required. + {{< /hint >}} +1. Check documentation to ensure + 1. resouce-level and field-level documentation are generated correctly for MMv1-based resource + 1. documentation is added manually for handwritten resources. +1. Check if release notes capture all changes in the PR, and are correctly formatted following the guidance in [write release notes]({{< ref "release-notes" >}}) before merge the PR. \ No newline at end of file diff --git a/docs/content/get-started/generate-providers.md b/docs/content/get-started/generate-providers.md index c1aea1bbf696..e9de8927466e 100644 --- a/docs/content/get-started/generate-providers.md +++ b/docs/content/get-started/generate-providers.md @@ -128,7 +128,7 @@ If you are familiar with Docker or Podman, you may want to use the experimental 1. Set up application default credentials for Terraform ```bash gcloud auth application-default login - export GOOGLE_USE_DEFAULT_CREDENTIALS=TRUE + export GOOGLE_USE_DEFAULT_CREDENTIALS=true ``` 1. Set required environment variables ```bash @@ -162,9 +162,9 @@ If you are familiar with Docker or Podman, you may want to use the experimental ```bash cd $GOPATH/src/github.com/hashicorp/terraform-provider-google - make testacc TEST=./google TESTARGS='-run=TestAccPubsubTopic' + make testacc TEST=./google TESTARGS='-run=TestAccPubsubTopic_' cd $GOPATH/src/github.com/hashicorp/terraform-provider-google-beta - make testacc TEST=./google-beta TESTARGS='-run=TestAccPubsubTopic' + make testacc TEST=./google-beta TESTARGS='-run=TestAccPubsubTopic_' ``` ## Troubleshoot diff --git a/docs/content/get-started/use-built-provider.md b/docs/content/get-started/use-built-provider.md index 2be83ec3b4ce..633e4790929b 100644 --- a/docs/content/get-started/use-built-provider.md +++ b/docs/content/get-started/use-built-provider.md @@ -143,14 +143,14 @@ make build To make Terraform use the configuration file you created, you need to set the `TF_CLI_CONFIG_FILE` environment variable to be a string containing the path to the configuration file ([see the documentation here](https://developer.hashicorp.com/terraform/cli/config/environment-variables#tf_cli_config_file)). The path can be either a relative or absolute path. -Assuming that a configuration file was created at `~/tf-dev-override.tfrc`, you can either export the environment variable or set it explicitly for each `terraform` command: +Assuming that a configuration file was created at `~/tf-dev-override.tfrc`, you can either export the environment variable or set it explicitly for each `terraform` command. Note that you need to use the full path: ```bash # either export the environment variable for your session -export TF_CLI_CONFIG_FILE="~/tf-dev-override.tfrc" +export TF_CLI_CONFIG_FILE="/Users/MyUserName/tf-dev-override.tfrc" # OR, set the environment variable value per command -TF_CLI_CONFIG_FILE="~/tf-dev-override.tfrc" terraform plan +TF_CLI_CONFIG_FILE="/Users/MyUserName/tf-dev-override.tfrc" terraform plan ``` To check that the developer override is working, run a `terraform plan` command and look for a warning near the start of the terminal output that looks like the example below. It is not necessary to run the terraform init command to use development overrides. diff --git a/mmv1/api/type.rb b/mmv1/api/type.rb index e5f330f5ae2c..2d0900b1fd7d 100644 --- a/mmv1/api/type.rb +++ b/mmv1/api/type.rb @@ -655,7 +655,6 @@ def validate # TODO: (camthornton) product reference may not exist yet return if @__resource.__product.nil? - check_resource_ref_exists check_resource_ref_property_exists end @@ -663,13 +662,11 @@ def property props = resource_ref.all_user_properties .select { |prop| prop.name == @imports } return props.first unless props.empty? - raise "#{@imports} does not exist on #{@resource}" if props.empty? end def resource_ref product = @__resource.__product resources = product.objects.select { |obj| obj.name == @resource } - raise "Unknown item type '#{@resource}'" if resources.empty? resources[0] end @@ -683,13 +680,9 @@ def property_class private - def check_resource_ref_exists - product = @__resource.__product - resources = product.objects.select { |obj| obj.name == @resource } - raise "Missing '#{@resource}'" if resources.empty? - end - def check_resource_ref_property_exists + return unless defined?(resource_ref.all_user_properties) + exported_props = resource_ref.all_user_properties exported_props << Api::Type::String.new('selfLink') \ if resource_ref.has_self_link diff --git a/mmv1/products/bigquery/Dataset.yaml b/mmv1/products/bigquery/Dataset.yaml index 9efd9208c917..7cd95a4eb7f1 100644 --- a/mmv1/products/bigquery/Dataset.yaml +++ b/mmv1/products/bigquery/Dataset.yaml @@ -356,3 +356,12 @@ properties: - 'und:ci': undetermined locale, case insensitive. - '': empty string. Default to case-sensitive behavior. default_from_api: true + - !ruby/object:Api::Type::String + name: 'storageBillingModel' + description: | + Specifies the storage billing model for the dataset. + Set this flag value to LOGICAL to use logical bytes for storage billing, + or to PHYSICAL to use physical bytes instead. + + LOGICAL is the default if this flag isn't specified. + default_from_api: true diff --git a/mmv1/products/certificatemanager/Certificate.yaml b/mmv1/products/certificatemanager/Certificate.yaml index 0dcdcd0bd2fc..2fa0442101a9 100644 --- a/mmv1/products/certificatemanager/Certificate.yaml +++ b/mmv1/products/certificatemanager/Certificate.yaml @@ -45,7 +45,7 @@ schema_version: 1 state_upgraders: true examples: - !ruby/object:Provider::Terraform::Examples - name: 'certificate_manager_google_managed_certificate' + name: 'certificate_manager_google_managed_certificate_dns' primary_resource_id: 'default' vars: dns_auth_name: 'dns-auth' @@ -53,6 +53,13 @@ examples: dns_auth_name2: 'dns-auth2' dns_auth_subdomain2: 'subdomain2' cert_name: 'dns-cert' + - !ruby/object:Provider::Terraform::Examples + name: 'certificate_manager_google_managed_certificate_issuance_config' + primary_resource_id: 'default' + vars: + cert_name: 'issuance-config-cert' + ca_name: 'my-ca' + pool_name: 'my-ca-pool' - !ruby/object:Provider::Terraform::Examples name: 'certificate_manager_self_managed_certificate' primary_resource_id: 'default' @@ -178,9 +185,21 @@ properties: name: dnsAuthorizations immutable: true description: | - Authorizations that will be used for performing domain authorization + Authorizations that will be used for performing domain authorization. Either issuanceConfig or dnsAuthorizations should be specificed, but not both. diff_suppress_func: 'tpgresource.ProjectNumberDiffSuppress' item_type: Api::Type::String + - !ruby/object:Api::Type::String + name: issuanceConfig + immutable: true + description: | + The resource name for a CertificateIssuanceConfig used to configure private PKI certificates in the format projects/*/locations/*/certificateIssuanceConfigs/*. + If this field is not set, the certificates will instead be publicly signed as documented at https://cloud.google.com/load-balancing/docs/ssl-certificates/google-managed-certs#caa. + Either issuanceConfig or dnsAuthorizations should be specificed, but not both. + + # when the certificate is created with issuanceConfig in the format "projects/{{project_id}}/locations/global/certificateIssuanceConfigs/{{CICName}}", the + # format changes in the response message to "projects/{{project_number}}/locations/global/certificateIssuanceConfigs/{{CICName}}". That causes the tests to fail + # that's why "tpgresource.CompareResourceNames" is needed. + diff_suppress_func: 'tpgresource.CompareResourceNames' - !ruby/object:Api::Type::String name: 'state' output: true diff --git a/mmv1/products/cloudbuild/Trigger.yaml b/mmv1/products/cloudbuild/Trigger.yaml index 5c4e533f7876..4ca2f4ed6b9c 100644 --- a/mmv1/products/cloudbuild/Trigger.yaml +++ b/mmv1/products/cloudbuild/Trigger.yaml @@ -64,7 +64,6 @@ examples: skip_test: true - !ruby/object:Provider::Terraform::Examples name: 'cloudbuild_trigger_repo' - min_version: beta primary_resource_id: 'repo-trigger' vars: installation_id: '123123' @@ -92,7 +91,6 @@ examples: primary_resource_id: 'allow-exit-codes-trigger' - !ruby/object:Provider::Terraform::Examples name: "cloudbuild_trigger_pubsub_with_repo" - min_version: beta primary_resource_id: "pubsub-with-repo-trigger" vars: installation_id: "123123" @@ -209,7 +207,6 @@ properties: invocation originated is assumed to be the repo from which to read the specified path. - !ruby/object:Api::Type::String name: 'repository' - min_version: beta description: | The fully qualified resource name of the Repo API repository. The fully qualified resource name of the Repo API repository. If unspecified, the repo from which the trigger invocation originated is assumed to be the repo from which to read the specified path. @@ -237,7 +234,6 @@ properties: Format: projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}. projects/{project}/githubEnterpriseConfigs/{id}. - !ruby/object:Api::Type::NestedObject name: 'repositoryEventConfig' - min_version: beta description: | The configuration of a trigger that creates a build whenever an event from Repo API is received. at_least_one_of: @@ -338,7 +334,6 @@ properties: The URI of the repo. - !ruby/object:Api::Type::String name: 'repository' - min_version: beta description: | The qualified resource name of the Repo API repository. Either uri or repository can be specified and is required. diff --git a/mmv1/products/cloudbuild/product.yaml b/mmv1/products/cloudbuild/product.yaml index 9a0d41e5a65b..b7d86da1f056 100644 --- a/mmv1/products/cloudbuild/product.yaml +++ b/mmv1/products/cloudbuild/product.yaml @@ -19,9 +19,6 @@ versions: - !ruby/object:Api::Product::Version name: ga base_url: https://cloudbuild.googleapis.com/v1/ - - !ruby/object:Api::Product::Version - name: beta - base_url: https://cloudbuild.googleapis.com/v1/ scopes: - https://www.googleapis.com/auth/cloud-platform apis_required: diff --git a/mmv1/products/cloudbuildv2/Connection.yaml b/mmv1/products/cloudbuildv2/Connection.yaml index c4937e86e07a..c7196a9ae98e 100644 --- a/mmv1/products/cloudbuildv2/Connection.yaml +++ b/mmv1/products/cloudbuildv2/Connection.yaml @@ -15,14 +15,12 @@ name: 'Connection' base_url: projects/{{project}}/locations/{{location}}/connections self_link: projects/{{project}}/locations/{{location}}/connections/{{name}} -min_version: beta exclude_resource: true description: | Only used to generate IAM resources. exclude_validator: true iam_policy: !ruby/object:Api::Resource::IamPolicy skip_import_test: true - min_version: beta method_name_separator: ':' fetch_iam_policy_verb: :GET allowed_iam_role: 'roles/cloudbuild.connectionViewer' @@ -36,7 +34,6 @@ import_format: examples: - !ruby/object:Provider::Terraform::Examples name: 'cloudbuildv2_connection' - min_version: beta primary_resource_id: 'my-connection' primary_resource_name: "fmt.Sprintf(\"tf-test-connection%s\", context[\"random_suffix\"\ diff --git a/mmv1/products/cloudbuildv2/product.yaml b/mmv1/products/cloudbuildv2/product.yaml index 918ca57de200..863190a0f4b7 100644 --- a/mmv1/products/cloudbuildv2/product.yaml +++ b/mmv1/products/cloudbuildv2/product.yaml @@ -16,7 +16,7 @@ name: Cloudbuildv2 display_name: Cloud Build v2 versions: - !ruby/object:Api::Product::Version - name: beta + name: ga base_url: https://cloudbuild.googleapis.com/v2/ scopes: - https://www.googleapis.com/auth/cloud-platform diff --git a/mmv1/products/compute/Address.yaml b/mmv1/products/compute/Address.yaml index 78f9e431c26f..0aeb95ac33df 100644 --- a/mmv1/products/compute/Address.yaml +++ b/mmv1/products/compute/Address.yaml @@ -106,6 +106,7 @@ parameters: required: false default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::String name: 'address' @@ -188,6 +189,7 @@ properties: This field can only be used with INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER purposes. default_from_api: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Array name: 'users' description: 'The URLs of the resources that are using this address.' @@ -216,6 +218,7 @@ properties: The URL of the network in which to reserve the address. This field can only be used with INTERNAL type with the VPC_PEERING and IPSEC_INTERCONNECT purposes. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Integer name: prefixLength description: | diff --git a/mmv1/products/compute/Autoscaler.yaml b/mmv1/products/compute/Autoscaler.yaml index 366dcc676ab6..e10212ef636b 100644 --- a/mmv1/products/compute/Autoscaler.yaml +++ b/mmv1/products/compute/Autoscaler.yaml @@ -85,6 +85,7 @@ parameters: required: false immutable: true default_from_api: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' diff --git a/mmv1/products/compute/BackendBucketSignedUrlKey.yaml b/mmv1/products/compute/BackendBucketSignedUrlKey.yaml index 300535746f31..ac2a7c34d235 100644 --- a/mmv1/products/compute/BackendBucketSignedUrlKey.yaml +++ b/mmv1/products/compute/BackendBucketSignedUrlKey.yaml @@ -75,6 +75,7 @@ parameters: required: true immutable: true ignore_read: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::String name: 'name' diff --git a/mmv1/products/compute/BackendService.yaml b/mmv1/products/compute/BackendService.yaml index cd1daf3e0f5c..ef24870db9bf 100644 --- a/mmv1/products/compute/BackendService.yaml +++ b/mmv1/products/compute/BackendService.yaml @@ -1247,6 +1247,7 @@ properties: connections to backends of a service. This resource itself does not affect configuration unless it is attached to a backend service resource. required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Array name: 'subjectAltNames' description: | diff --git a/mmv1/products/compute/BackendServiceSignedUrlKey.yaml b/mmv1/products/compute/BackendServiceSignedUrlKey.yaml index 96558f6f73b3..845def332ba5 100644 --- a/mmv1/products/compute/BackendServiceSignedUrlKey.yaml +++ b/mmv1/products/compute/BackendServiceSignedUrlKey.yaml @@ -75,6 +75,7 @@ parameters: required: true immutable: true ignore_read: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::String name: 'name' diff --git a/mmv1/products/compute/Disk.yaml b/mmv1/products/compute/Disk.yaml index 92d50a0df5bc..84467c0539f4 100644 --- a/mmv1/products/compute/Disk.yaml +++ b/mmv1/products/compute/Disk.yaml @@ -108,6 +108,7 @@ parameters: required: false default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'sourceImageEncryptionKey' description: | @@ -218,6 +219,7 @@ parameters: * `projects/project/global/snapshots/snapshot` * `global/snapshots/snapshot` * `snapshot` + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'sourceSnapshotEncryptionKey' description: | @@ -336,6 +338,7 @@ properties: resource: 'Instance' imports: 'selfLink' description: 'A reference to a user of this disk' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' output: true - !ruby/object:Api::Type::Integer name: 'physicalBlockSizeBytes' @@ -389,6 +392,7 @@ properties: create the disk. Provide this when creating the disk. custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' default_value: 'pd-standard' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'image' api_name: 'sourceImage' @@ -423,6 +427,7 @@ properties: description: 'A resource policy applied to this disk for automatic snapshot creations.' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Boolean name: 'multiWriter' description: | @@ -433,7 +438,7 @@ properties: description: | Indicates how many IOPS must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk - allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it required: false default_from_api: true update_verb: :PATCH @@ -443,7 +448,7 @@ properties: description: | Indicates how much Throughput must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk - allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it default_from_api: true update_verb: :PATCH update_url: 'projects/{{project}}/zones/{{zone}}/disks/{{name}}?paths=provisionedThroughput' @@ -492,3 +497,4 @@ properties: description: 'An applicable license URI' resource: 'License' imports: 'selfLink' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' diff --git a/mmv1/products/compute/DiskType.yaml b/mmv1/products/compute/DiskType.yaml index 8bdceb173a1c..ac1407bc5700 100644 --- a/mmv1/products/compute/DiskType.yaml +++ b/mmv1/products/compute/DiskType.yaml @@ -37,6 +37,7 @@ parameters: imports: 'name' description: 'A reference to the zone where the disk type resides.' required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' diff --git a/mmv1/products/compute/ExternalVpnGateway.yaml b/mmv1/products/compute/ExternalVpnGateway.yaml index 8a02e9d22fb3..7fd92d7952f3 100644 --- a/mmv1/products/compute/ExternalVpnGateway.yaml +++ b/mmv1/products/compute/ExternalVpnGateway.yaml @@ -66,6 +66,15 @@ properties: - !ruby/object:Api::Type::KeyValuePairs name: 'labels' description: 'Labels for the external VPN gateway resource.' + update_verb: :POST + update_url: 'projects/{{project}}/global/externalVpnGateways/{{name}}/setLabels' + - !ruby/object:Api::Type::Fingerprint + name: 'labelFingerprint' + description: | + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + update_url: 'projects/{{project}}/global/externalVpnGateways/{{name}}/setLabels' + update_verb: :POST - !ruby/object:Api::Type::String name: 'name' description: | diff --git a/mmv1/products/compute/Firewall.yaml b/mmv1/products/compute/Firewall.yaml index b09b9093b2be..3e7475ea9394 100644 --- a/mmv1/products/compute/Firewall.yaml +++ b/mmv1/products/compute/Firewall.yaml @@ -234,6 +234,7 @@ properties: required: true description: | The name or self_link of the network to attach this firewall to. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Integer name: 'priority' description: | diff --git a/mmv1/products/compute/ForwardingRule.yaml b/mmv1/products/compute/ForwardingRule.yaml index 3eb1f39f97ef..63d7ca4ec017 100644 --- a/mmv1/products/compute/ForwardingRule.yaml +++ b/mmv1/products/compute/ForwardingRule.yaml @@ -217,6 +217,7 @@ parameters: required: false default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' @@ -378,6 +379,7 @@ properties: # manifest input from a single value to a range of form NN-NN. The API # accepts a single value, e.g. '80', but the API stores and returns # '80-80'. This causes idempotency false positive. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'portRange' description: | @@ -450,6 +452,7 @@ properties: # TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, # TargetInstance) default_from_api: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'target' description: | @@ -609,8 +612,8 @@ properties: - !ruby/object:Api::Type::Boolean name: noAutomateDnsZone description: - This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. send_empty_value: true immutable: true - ignore_read: true \ No newline at end of file + ignore_read: true diff --git a/mmv1/products/compute/GlobalAddress.yaml b/mmv1/products/compute/GlobalAddress.yaml index e77a7bf95ca0..16a0497a6cdd 100644 --- a/mmv1/products/compute/GlobalAddress.yaml +++ b/mmv1/products/compute/GlobalAddress.yaml @@ -147,5 +147,6 @@ properties: any reserved IP ranges referring to it. This should only be set when using an Internal address. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' # status is not useful for state convergence # users[] is not useful for state convergence diff --git a/mmv1/products/compute/GlobalForwardingRule.yaml b/mmv1/products/compute/GlobalForwardingRule.yaml index 927a65795c7f..13567a3083b7 100644 --- a/mmv1/products/compute/GlobalForwardingRule.yaml +++ b/mmv1/products/compute/GlobalForwardingRule.yaml @@ -397,6 +397,7 @@ properties: # manifest input from a single value to a range of form NN-NN. The API # accepts a single value, e.g. '80', but the API stores and returns # '80-80'. This causes idempotency false positive. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'portRange' description: | @@ -458,8 +459,8 @@ properties: - !ruby/object:Api::Type::Boolean name: noAutomateDnsZone description: - This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. send_empty_value: true immutable: true - ignore_read: true \ No newline at end of file + ignore_read: true diff --git a/mmv1/products/compute/Image.yaml b/mmv1/products/compute/Image.yaml index 1e978aa73eff..2c428d454187 100644 --- a/mmv1/products/compute/Image.yaml +++ b/mmv1/products/compute/Image.yaml @@ -191,6 +191,7 @@ properties: description: 'An applicable license URI' resource: 'License' imports: 'selfLink' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'name' description: | @@ -239,6 +240,7 @@ properties: rawDisk.source property but not both to create an image. resource: 'Disk' imports: 'selfLink' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'sourceImage' description: | @@ -251,6 +253,7 @@ properties: * The sourceDisk URL resource: 'Image' imports: 'selfLink' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'sourceSnapshot' description: | @@ -265,4 +268,5 @@ properties: * The sourceDisk URL resource: 'Snapshot' imports: 'selfLink' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' # State is not applicable for state convergence. diff --git a/mmv1/products/compute/Instance.yaml b/mmv1/products/compute/Instance.yaml index 19fab48a9f34..fe606a8ef47a 100644 --- a/mmv1/products/compute/Instance.yaml +++ b/mmv1/products/compute/Instance.yaml @@ -59,6 +59,7 @@ parameters: imports: 'name' description: 'A reference to the zone where the machine resides.' required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Boolean name: 'canIpForward' @@ -171,6 +172,7 @@ properties: If not specified, the default is pd-standard. resource: 'DiskType' imports: 'selfLink' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'sourceImage' description: | @@ -239,6 +241,7 @@ properties: If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Enum name: 'type' description: | @@ -332,6 +335,7 @@ properties: update_url: projects/{{project}}/zones/{{zone}}/instances/{{name}}/setMachineType update_verb: :POST # TODO(alexstephen): Add metadata + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'minCpuPlatform' description: | @@ -387,6 +391,7 @@ properties: from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Enum name: 'type' description: | @@ -461,6 +466,7 @@ properties: the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'networkIP' description: | @@ -480,6 +486,7 @@ properties: the network is in custom subnet mode, then this field should be specified. # networkInterfaces.kind is not necessary for convergence. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'scheduling' description: Sets the scheduling options for this instance. diff --git a/mmv1/products/compute/InstanceGroup.yaml b/mmv1/products/compute/InstanceGroup.yaml index 86df5fbfbe96..454723ea05fe 100644 --- a/mmv1/products/compute/InstanceGroup.yaml +++ b/mmv1/products/compute/InstanceGroup.yaml @@ -49,6 +49,7 @@ parameters: imports: 'name' description: 'A reference to the zone where the instance group resides.' required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Array name: 'instances' description: | @@ -63,6 +64,7 @@ parameters: description: 'An instance being added to the InstanceGroup' resource: 'Instance' imports: 'selfLink' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' @@ -113,6 +115,7 @@ properties: imports: 'selfLink' description: | The network to which all instances in the instance group belong. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'region' resource: 'Region' @@ -120,9 +123,11 @@ properties: description: | The region where the instance group is located (for regional resources). + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'subnetwork' resource: 'Subnetwork' imports: 'selfLink' description: | The subnetwork to which all instances in the instance group belong. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' diff --git a/mmv1/products/compute/InstanceGroupManager.yaml b/mmv1/products/compute/InstanceGroupManager.yaml index bb8485d48568..d1992e1aa278 100644 --- a/mmv1/products/compute/InstanceGroupManager.yaml +++ b/mmv1/products/compute/InstanceGroupManager.yaml @@ -53,6 +53,7 @@ parameters: imports: 'name' description: 'The zone the managed instance group resides.' required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::String name: 'baseInstanceName' @@ -154,6 +155,7 @@ properties: imports: 'selfLink' description: 'The instance group being managed' output: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'instanceTemplate' resource: 'InstanceTemplate' @@ -164,6 +166,7 @@ properties: managed instance group. required: true # kind is internal transport detail + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'name' description: | @@ -195,6 +198,7 @@ properties: The region this managed instance group resides (for regional resources). output: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Array name: 'targetPools' description: | @@ -206,6 +210,7 @@ properties: description: 'The targetPool to receive managed instances.' resource: 'TargetPool' imports: 'selfLink' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Integer name: 'targetSize' description: | diff --git a/mmv1/products/compute/InterconnectAttachment.yaml b/mmv1/products/compute/InterconnectAttachment.yaml index 0c19837876ef..39b5082c0230 100644 --- a/mmv1/products/compute/InterconnectAttachment.yaml +++ b/mmv1/products/compute/InterconnectAttachment.yaml @@ -68,6 +68,7 @@ parameters: description: | Region where the regional interconnect attachment resides. default_from_api: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Boolean name: 'adminEnabled' @@ -208,6 +209,7 @@ properties: required: true immutable: true diff_suppress_func: 'tpgresource.CompareSelfLinkOrResourceName' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Time name: 'creationTimestamp' description: | @@ -275,6 +277,7 @@ properties: description: | URL of an address that has been reserved for the interconnect attachment. + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Enum name: 'encryption' description: | diff --git a/mmv1/products/compute/MachineImage.yaml b/mmv1/products/compute/MachineImage.yaml index e8f20d4901dd..c84a6923e879 100644 --- a/mmv1/products/compute/MachineImage.yaml +++ b/mmv1/products/compute/MachineImage.yaml @@ -89,6 +89,7 @@ properties: resource: 'Instance' imports: 'selfLink' required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Array name: 'storageLocations' description: | diff --git a/mmv1/products/compute/MachineType.yaml b/mmv1/products/compute/MachineType.yaml index 281aa834c803..9a61bb4474f5 100644 --- a/mmv1/products/compute/MachineType.yaml +++ b/mmv1/products/compute/MachineType.yaml @@ -119,4 +119,5 @@ properties: resource: 'Zone' imports: 'name' description: 'The zone the machine type is defined.' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' required: true diff --git a/mmv1/products/compute/NetworkEndpointGroup.yaml b/mmv1/products/compute/NetworkEndpointGroup.yaml index b580ee3582f9..9e849d2b3f76 100644 --- a/mmv1/products/compute/NetworkEndpointGroup.yaml +++ b/mmv1/products/compute/NetworkEndpointGroup.yaml @@ -78,6 +78,7 @@ parameters: Zone where the network endpoint group is located. required: false default_from_api: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::String name: 'name' @@ -126,6 +127,7 @@ properties: The network to which all network endpoints in the NEG belong. Uses "default" project network if unspecified. required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'subnetwork' resource: 'Subnetwork' @@ -133,6 +135,7 @@ properties: description: | Optional subnetwork to which all network endpoints in the NEG belong. diff_suppress_func: 'tpgresource.CompareOptionalSubnet' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Integer name: 'defaultPort' description: | diff --git a/mmv1/products/compute/NodeGroup.yaml b/mmv1/products/compute/NodeGroup.yaml index 562524d23ad0..63e3ab1a8f8d 100644 --- a/mmv1/products/compute/NodeGroup.yaml +++ b/mmv1/products/compute/NodeGroup.yaml @@ -84,6 +84,7 @@ parameters: Zone where this node group is located default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' @@ -107,6 +108,7 @@ properties: The URL of the node template to which this node group belongs. update_verb: :POST update_url: 'projects/{{project}}/zones/{{zone}}/nodeGroups/{{name}}/setNodeTemplate' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Integer name: 'size' description: | diff --git a/mmv1/products/compute/NodeTemplate.yaml b/mmv1/products/compute/NodeTemplate.yaml index e949c4688755..ea93a134f43e 100644 --- a/mmv1/products/compute/NodeTemplate.yaml +++ b/mmv1/products/compute/NodeTemplate.yaml @@ -66,6 +66,7 @@ parameters: If it is not provided, the provider region is used. default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' diff --git a/mmv1/products/compute/PacketMirroring.yaml b/mmv1/products/compute/PacketMirroring.yaml index 4241c6c54171..b1de67a949d5 100644 --- a/mmv1/products/compute/PacketMirroring.yaml +++ b/mmv1/products/compute/PacketMirroring.yaml @@ -89,6 +89,7 @@ properties: imports: 'selfLink' required: true immutable: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' required: true - !ruby/object:Api::Type::Integer name: priority @@ -113,6 +114,7 @@ properties: resource: 'ForwardingRule' imports: 'selfLink' description: The URL of the forwarding rule. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: filter description: | @@ -163,6 +165,7 @@ properties: description: The URL of the subnetwork where this rule should be active. required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Array name: instances description: | @@ -182,6 +185,7 @@ properties: description: The URL of the instances where this rule should be active. required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Array name: tags at_least_one_of: diff --git a/mmv1/products/compute/PerInstanceConfig.yaml b/mmv1/products/compute/PerInstanceConfig.yaml index 2a492c26516e..a899987c95a1 100644 --- a/mmv1/products/compute/PerInstanceConfig.yaml +++ b/mmv1/products/compute/PerInstanceConfig.yaml @@ -217,6 +217,7 @@ properties: imports: 'selfLink' description: | The URL of the reservation for this IP address. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Map name: 'externalIp' min_version: beta @@ -245,3 +246,4 @@ properties: imports: 'selfLink' description: | The URL of the reservation for this IP address. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' diff --git a/mmv1/products/compute/RegionAutoscaler.yaml b/mmv1/products/compute/RegionAutoscaler.yaml index 67569be7c01c..e68955cf3728 100644 --- a/mmv1/products/compute/RegionAutoscaler.yaml +++ b/mmv1/products/compute/RegionAutoscaler.yaml @@ -65,6 +65,7 @@ parameters: required: false immutable: true default_from_api: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' diff --git a/mmv1/products/compute/RegionBackendService.yaml b/mmv1/products/compute/RegionBackendService.yaml index 5486b87d0297..ccb72397ecd3 100644 --- a/mmv1/products/compute/RegionBackendService.yaml +++ b/mmv1/products/compute/RegionBackendService.yaml @@ -126,6 +126,7 @@ parameters: required: false default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Integer name: 'affinityCookieTtlSec' @@ -1238,6 +1239,7 @@ properties: description: | The URL of the network to which this backend service belongs. This field can only be specified when the load balancing scheme is set to INTERNAL. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'subsetting' min_version: beta diff --git a/mmv1/products/compute/RegionCommitment.yaml b/mmv1/products/compute/RegionCommitment.yaml index 167500210315..5d2a25a7c320 100644 --- a/mmv1/products/compute/RegionCommitment.yaml +++ b/mmv1/products/compute/RegionCommitment.yaml @@ -76,6 +76,7 @@ parameters: required: false default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Integer name: 'commitment_id' diff --git a/mmv1/products/compute/RegionDisk.yaml b/mmv1/products/compute/RegionDisk.yaml index 8d8509afad9f..bbb3ec2ee5cb 100644 --- a/mmv1/products/compute/RegionDisk.yaml +++ b/mmv1/products/compute/RegionDisk.yaml @@ -108,6 +108,7 @@ parameters: required: false default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'diskEncryptionKey' description: | @@ -156,6 +157,7 @@ parameters: * `projects/project/global/snapshots/snapshot` * `global/snapshots/snapshot` * `snapshot` + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'sourceSnapshotEncryptionKey' description: | @@ -259,6 +261,7 @@ properties: resource: 'Instance' imports: 'selfLink' description: 'A reference to a user of this disk' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' output: true - !ruby/object:Api::Type::Integer name: 'physicalBlockSizeBytes' @@ -281,6 +284,7 @@ properties: imports: 'selfLink' description: | A reference to a zone where the disk should be replicated to. + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'type' resource: 'RegionDiskType' @@ -290,6 +294,7 @@ properties: create the disk. Provide this when creating the disk. custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' default_value: 'pd-standard' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'interface' min_version: 'beta' @@ -369,3 +374,4 @@ properties: description: 'An applicable license URI' resource: 'License' imports: 'selfLink' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' diff --git a/mmv1/products/compute/RegionDiskType.yaml b/mmv1/products/compute/RegionDiskType.yaml index f6c03f663ce2..e0b24ffebd8e 100644 --- a/mmv1/products/compute/RegionDiskType.yaml +++ b/mmv1/products/compute/RegionDiskType.yaml @@ -30,6 +30,7 @@ parameters: imports: 'name' description: 'A reference to the region where the disk type resides.' required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' diff --git a/mmv1/products/compute/RegionGroupInstanceManager.yaml b/mmv1/products/compute/RegionGroupInstanceManager.yaml index ad72c71c24e9..3d42a649b53f 100644 --- a/mmv1/products/compute/RegionGroupInstanceManager.yaml +++ b/mmv1/products/compute/RegionGroupInstanceManager.yaml @@ -52,6 +52,7 @@ parameters: imports: 'name' description: 'The region the managed instance group resides.' required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::String name: 'baseInstanceName' @@ -153,6 +154,7 @@ properties: imports: 'selfLink' description: 'The instance group being managed' output: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'instanceTemplate' resource: 'InstanceTemplate' @@ -163,6 +165,7 @@ properties: managed instance group. required: true # kind is internal transport detail + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'name' description: | @@ -197,6 +200,7 @@ properties: description: 'The targetPool to receive managed instances.' resource: 'TargetPool' imports: 'selfLink' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Integer name: 'targetSize' description: | diff --git a/mmv1/products/compute/RegionHealthCheck.yaml b/mmv1/products/compute/RegionHealthCheck.yaml index db75a4c15010..7e0bf64d078d 100644 --- a/mmv1/products/compute/RegionHealthCheck.yaml +++ b/mmv1/products/compute/RegionHealthCheck.yaml @@ -135,6 +135,7 @@ parameters: default_from_api: true required: false custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Integer name: 'checkIntervalSec' diff --git a/mmv1/products/compute/RegionNetworkEndpointGroup.yaml b/mmv1/products/compute/RegionNetworkEndpointGroup.yaml index 20765726c720..f5b76577aeeb 100644 --- a/mmv1/products/compute/RegionNetworkEndpointGroup.yaml +++ b/mmv1/products/compute/RegionNetworkEndpointGroup.yaml @@ -92,6 +92,7 @@ parameters: description: | A reference to the region where the Serverless NEGs Reside. required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::String name: 'name' @@ -132,6 +133,7 @@ properties: This field is only used for PSC. The URL of the network to which all network endpoints in the NEG belong. Uses "default" project network if unspecified. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'subnetwork' resource: 'Subnetwork' @@ -139,6 +141,7 @@ properties: description: | This field is only used for PSC. Optional URL of the subnetwork to which all network endpoints in the NEG belong. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'cloudRun' conflicts: diff --git a/mmv1/products/compute/RegionPerInstanceConfig.yaml b/mmv1/products/compute/RegionPerInstanceConfig.yaml index 6471c44a3a65..8318ccdf205d 100644 --- a/mmv1/products/compute/RegionPerInstanceConfig.yaml +++ b/mmv1/products/compute/RegionPerInstanceConfig.yaml @@ -220,6 +220,7 @@ properties: imports: 'selfLink' description: | The URL of the reservation for this IP address. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Map name: 'externalIp' min_version: beta @@ -248,3 +249,4 @@ properties: imports: 'selfLink' description: | The URL of the reservation for this IP address. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' diff --git a/mmv1/products/compute/RegionSecurityPolicy.yaml b/mmv1/products/compute/RegionSecurityPolicy.yaml index de5aef7a09af..6fdecc4332b4 100644 --- a/mmv1/products/compute/RegionSecurityPolicy.yaml +++ b/mmv1/products/compute/RegionSecurityPolicy.yaml @@ -64,6 +64,7 @@ parameters: The Region in which the created Region Security Policy should reside. If it is not provided, the provider region is used. default_from_api: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::String name: 'policyId' diff --git a/mmv1/products/compute/RegionSslCertificate.yaml b/mmv1/products/compute/RegionSslCertificate.yaml index 9f1498418217..3e6cae1e9e04 100644 --- a/mmv1/products/compute/RegionSslCertificate.yaml +++ b/mmv1/products/compute/RegionSslCertificate.yaml @@ -91,6 +91,7 @@ parameters: If it is not provided, the provider region is used. default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::String name: 'certificate' diff --git a/mmv1/products/compute/RegionSslPolicy.yaml b/mmv1/products/compute/RegionSslPolicy.yaml index 863c4cafe1a3..8b86fd79e0ec 100644 --- a/mmv1/products/compute/RegionSslPolicy.yaml +++ b/mmv1/products/compute/RegionSslPolicy.yaml @@ -58,6 +58,7 @@ parameters: immutable: true description: | The region where the regional SSL policy resides. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' diff --git a/mmv1/products/compute/RegionTargetHttpProxy.yaml b/mmv1/products/compute/RegionTargetHttpProxy.yaml index bcebce49f8b8..7ecdf2a322e2 100644 --- a/mmv1/products/compute/RegionTargetHttpProxy.yaml +++ b/mmv1/products/compute/RegionTargetHttpProxy.yaml @@ -68,6 +68,7 @@ parameters: If it is not provided, the provider region is used. default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' @@ -101,4 +102,5 @@ properties: to the BackendService. required: true update_verb: :POST + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' update_url: 'projects/{{project}}/regions/{{region}}/targetHttpProxies/{{name}}/setUrlMap' diff --git a/mmv1/products/compute/RegionTargetHttpsProxy.yaml b/mmv1/products/compute/RegionTargetHttpsProxy.yaml index ead7d7e4d931..ec2a539f3ab8 100644 --- a/mmv1/products/compute/RegionTargetHttpsProxy.yaml +++ b/mmv1/products/compute/RegionTargetHttpsProxy.yaml @@ -63,6 +63,7 @@ parameters: If it is not provided, the provider region is used. default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' @@ -122,6 +123,7 @@ properties: resource: 'RegionSslCertificate' imports: 'selfLink' description: 'The SSL certificates used by this TargetHttpsProxy' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'sslPolicy' resource: 'RegionSslPolicy' @@ -136,6 +138,7 @@ properties: # update_verb: :POST # update_url: # 'projects/{{project}}/regions/{{region}}/targetHttpsProxies/{{name}}/setSslPolicy' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'urlMap' resource: 'RegionUrlMap' @@ -145,4 +148,5 @@ properties: to the RegionBackendService. required: true update_verb: :POST + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' update_url: 'projects/{{project}}/regions/{{region}}/targetHttpsProxies/{{name}}/setUrlMap' diff --git a/mmv1/products/compute/RegionTargetTcpProxy.yaml b/mmv1/products/compute/RegionTargetTcpProxy.yaml index 9b8aba56916d..6d118abb22fb 100644 --- a/mmv1/products/compute/RegionTargetTcpProxy.yaml +++ b/mmv1/products/compute/RegionTargetTcpProxy.yaml @@ -62,6 +62,7 @@ parameters: If it is not provided, the provider region is used. default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' @@ -105,6 +106,7 @@ properties: description: | A reference to the BackendService resource. required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Boolean name: 'proxyBind' description: | diff --git a/mmv1/products/compute/RegionUrlMap.yaml b/mmv1/products/compute/RegionUrlMap.yaml index 4403e5088e57..69d8e8fcb7ae 100644 --- a/mmv1/products/compute/RegionUrlMap.yaml +++ b/mmv1/products/compute/RegionUrlMap.yaml @@ -141,6 +141,7 @@ parameters: required: false default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' @@ -162,6 +163,7 @@ properties: weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'description' description: | @@ -238,6 +240,7 @@ properties: A reference to a RegionBackendService resource. This will be used if none of the pathRules defined by this PathMatcher is matched by the URL's path portion. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'description' description: 'An optional description of this resource.' @@ -288,6 +291,7 @@ properties: contain any weightedBackendService s. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'headerAction' description: | @@ -688,6 +692,7 @@ properties: imports: 'selfLink' description: | The RegionBackendService resource being mirrored to. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'retryPolicy' description: | @@ -801,6 +806,7 @@ properties: The default RegionBackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'headerAction' description: | @@ -970,6 +976,7 @@ properties: contain any weightedBackendService s. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Array name: 'paths' required: true @@ -1117,6 +1124,7 @@ properties: imports: 'selfLink' description: | The RegionBackendService resource being mirrored to. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'retryPolicy' description: | @@ -1229,6 +1237,7 @@ properties: The default RegionBackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'headerAction' description: | @@ -1475,6 +1484,7 @@ properties: description: A reference to expected RegionBackendService resource the given URL should be mapped to. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'defaultUrlRedirect' exactly_one_of: @@ -1583,6 +1593,7 @@ properties: imports: 'selfLink' description: | The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the load balancer applies any relevant headerActions specified as part of this backendServiceWeight. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Integer name: 'weight' description: | @@ -1808,6 +1819,7 @@ properties: The full or partial URL to the RegionBackendService resource being mirrored to. The backend service configured for a mirroring policy must reference backends that are of the same type as the original backend service matched in the URL map. Serverless NEG backends are not currently supported as a mirrored backend service. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'corsPolicy' description: | diff --git a/mmv1/products/compute/Reservation.yaml b/mmv1/products/compute/Reservation.yaml index 45e3d85c230f..55285cfcbe91 100644 --- a/mmv1/products/compute/Reservation.yaml +++ b/mmv1/products/compute/Reservation.yaml @@ -81,6 +81,7 @@ parameters: The zone where the reservation is made. required: true immutable: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' diff --git a/mmv1/products/compute/ResourcePolicy.yaml b/mmv1/products/compute/ResourcePolicy.yaml index 67dbada04bd3..325506ff420c 100644 --- a/mmv1/products/compute/ResourcePolicy.yaml +++ b/mmv1/products/compute/ResourcePolicy.yaml @@ -84,6 +84,7 @@ parameters: immutable: true required: false default_from_api: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::String name: 'name' diff --git a/mmv1/products/compute/Route.yaml b/mmv1/products/compute/Route.yaml index 36daa31baf53..9b6b70de1f4d 100644 --- a/mmv1/products/compute/Route.yaml +++ b/mmv1/products/compute/Route.yaml @@ -136,6 +136,7 @@ properties: immutable: true required: true diff_suppress_func: 'tpgresource.CompareSelfLinkOrResourceName' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Integer name: 'priority' description: | @@ -219,6 +220,7 @@ properties: - next_hop_ilb description: | URL to a VpnTunnel that should handle matching packets. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'nextHopNetwork' output: true diff --git a/mmv1/products/compute/Router.yaml b/mmv1/products/compute/Router.yaml index cc45b6c5c956..7f868b4ed1a0 100644 --- a/mmv1/products/compute/Router.yaml +++ b/mmv1/products/compute/Router.yaml @@ -74,6 +74,7 @@ parameters: required: false default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' @@ -112,6 +113,7 @@ properties: # these fields to the Terraform resource (and then within that, decide # whether to deprecate router_interface and router_peer or leave them # alone). + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: bgp description: | diff --git a/mmv1/products/compute/RouterBgpPeer.yaml b/mmv1/products/compute/RouterBgpPeer.yaml index cd292a7afddd..85fa7eca15a8 100644 --- a/mmv1/products/compute/RouterBgpPeer.yaml +++ b/mmv1/products/compute/RouterBgpPeer.yaml @@ -142,8 +142,8 @@ properties: name: 'peerIpAddress' description: | IP address of the BGP interface outside Google Cloud Platform. - Only IPv4 is supported. - required: true + Only IPv4 is supported. Required if `ip_address` is set. + default_from_api: true - !ruby/object:Api::Type::Integer name: 'peerAsn' description: | @@ -284,6 +284,7 @@ properties: such as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM instance must be located in zones contained in the same region as this Cloud Router. The VM instance is the peer side of the BGP session. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Boolean name: 'enableIpv6' description: | diff --git a/mmv1/products/compute/RouterNat.yaml b/mmv1/products/compute/RouterNat.yaml index 9b38181b0019..9585438f70b7 100644 --- a/mmv1/products/compute/RouterNat.yaml +++ b/mmv1/products/compute/RouterNat.yaml @@ -149,6 +149,7 @@ properties: resource: 'Address' imports: 'selfLink' description: 'A reference to an address associated with this NAT' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Array name: 'drainNatIps' description: | @@ -161,6 +162,7 @@ properties: resource: 'Address' imports: 'selfLink' description: 'A reference to an address associated with this NAT' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Enum name: 'sourceSubnetworkIpRangesToNat' required: true @@ -196,6 +198,7 @@ properties: imports: 'selfLink' description: 'Self-link of subnetwork to NAT' required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Array name: 'sourceIpRangesToNat' description: | @@ -347,6 +350,7 @@ properties: imports: 'selfLink' description: 'A reference to an address associated with this NAT' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Array name: 'sourceNatDrainIps' description: | @@ -363,6 +367,7 @@ properties: imports: 'selfLink' description: 'A reference to an address associated with this NAT' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Boolean name: enableEndpointIndependentMapping description: | diff --git a/mmv1/products/compute/ServiceAttachment.yaml b/mmv1/products/compute/ServiceAttachment.yaml index 350b748aecaa..d1f10b09ab02 100644 --- a/mmv1/products/compute/ServiceAttachment.yaml +++ b/mmv1/products/compute/ServiceAttachment.yaml @@ -80,6 +80,7 @@ parameters: required: false immutable: true default_from_api: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::String name: 'name' @@ -135,6 +136,7 @@ properties: description: | The URL of a forwarding rule that represents the service identified by this service attachment. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Array name: 'natSubnets' required: true @@ -147,6 +149,7 @@ properties: imports: 'selfLink' description: | A subnet that is provided for NAT in this service attachment. + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Boolean name: 'enableProxyProtocol' required: true diff --git a/mmv1/products/compute/Snapshot.yaml b/mmv1/products/compute/Snapshot.yaml index 89ba5c1a4ecd..2f04ab0fb2a1 100644 --- a/mmv1/products/compute/Snapshot.yaml +++ b/mmv1/products/compute/Snapshot.yaml @@ -93,6 +93,7 @@ parameters: required: true # ignore_read in providers - this is only used in Create diff_suppress_func: 'tpgresource.CompareSelfLinkOrResourceName' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'zone' resource: 'Zone' @@ -102,6 +103,7 @@ parameters: ignore_read: true default_from_api: true required: false + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'snapshotEncryptionKey' description: | @@ -233,6 +235,7 @@ properties: resource: 'License' imports: 'selfLink' description: 'A reference to a license associated with this snapshot' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::KeyValuePairs name: 'labels' description: Labels to apply to this Snapshot. diff --git a/mmv1/products/compute/Subnetwork.yaml b/mmv1/products/compute/Subnetwork.yaml index d1cc7bfc18b1..e1daa37918a4 100644 --- a/mmv1/products/compute/Subnetwork.yaml +++ b/mmv1/products/compute/Subnetwork.yaml @@ -160,13 +160,15 @@ properties: Only networks that are in the distributed mode can have subnetworks. immutable: true required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'purpose' immutable: true description: | - The purpose of the resource. This field can be either `PRIVATE_RFC_1918`, `INTERNAL_HTTPS_LOAD_BALANCER` or `REGIONAL_MANAGED_PROXY`. + The purpose of the resource. This field can be either `PRIVATE_RFC_1918`, `INTERNAL_HTTPS_LOAD_BALANCER`, `REGIONAL_MANAGED_PROXY`, or `PRIVATE_SERVICE_CONNECT`. A subnetwork with purpose set to `INTERNAL_HTTPS_LOAD_BALANCER` is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. A subnetwork in a given region with purpose set to `REGIONAL_MANAGED_PROXY` is a proxy-only subnet and is shared between all the regional Envoy-based load balancers. + A subnetwork with purpose set to `PRIVATE_SERVICE_CONNECT` reserves the subnet for hosting a Private Service Connect published service. If unspecified, the purpose defaults to `PRIVATE_RFC_1918`. The enableFlowLogs field isn't supported with the purpose field set to `INTERNAL_HTTPS_LOAD_BALANCER`. default_from_api: true @@ -255,6 +257,7 @@ properties: immutable: true default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::NestedObject name: 'logConfig' update_verb: :PATCH diff --git a/mmv1/products/compute/TargetHttpProxy.yaml b/mmv1/products/compute/TargetHttpProxy.yaml index 58006c0aea42..b430b9913d15 100644 --- a/mmv1/products/compute/TargetHttpProxy.yaml +++ b/mmv1/products/compute/TargetHttpProxy.yaml @@ -54,7 +54,6 @@ examples: http_health_check_name: 'http-health-check' - !ruby/object:Provider::Terraform::Examples name: 'target_http_proxy_http_keep_alive_timeout' - min_version: beta primary_resource_id: 'default' vars: target_http_proxy_name: 'test-http-keep-alive-timeout-proxy' @@ -101,6 +100,7 @@ properties: required: true update_verb: :POST update_url: 'projects/{{project}}/targetHttpProxies/{{name}}/setUrlMap' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Boolean name: 'proxyBind' description: | @@ -109,7 +109,6 @@ properties: default_from_api: true - !ruby/object:Api::Type::Integer name: 'httpKeepAliveTimeoutSec' - min_version: beta description: | Specifies how long to keep a connection open, after completing a response, while there is no matching traffic (in seconds). If an HTTP keepalive is diff --git a/mmv1/products/compute/TargetHttpsProxy.yaml b/mmv1/products/compute/TargetHttpsProxy.yaml index e105a36d53db..65202ce55a3b 100644 --- a/mmv1/products/compute/TargetHttpsProxy.yaml +++ b/mmv1/products/compute/TargetHttpsProxy.yaml @@ -55,7 +55,6 @@ examples: http_health_check_name: 'http-health-check' - !ruby/object:Provider::Terraform::Examples name: 'target_https_proxy_http_keep_alive_timeout' - min_version: beta primary_resource_id: 'default' vars: target_https_proxy_name: 'test-http-keep-alive-timeout-proxy' @@ -117,6 +116,7 @@ properties: resource: 'SslCertificate' imports: 'selfLink' description: 'The SSL certificates used by this TargetHttpsProxy' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'certificateMap' description: | @@ -135,6 +135,7 @@ properties: resource will not have any SSL policy configured. update_verb: :POST update_url: 'projects/{{project}}/global/targetHttpsProxies/{{name}}/setSslPolicy' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'urlMap' resource: 'UrlMap' @@ -145,6 +146,7 @@ properties: required: true update_verb: :POST update_url: 'projects/{{project}}/targetHttpsProxies/{{name}}/setUrlMap' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Boolean name: 'proxyBind' description: | @@ -153,7 +155,6 @@ properties: default_from_api: true - !ruby/object:Api::Type::Integer name: 'httpKeepAliveTimeoutSec' - min_version: beta description: | Specifies how long to keep a connection open, after completing a response, while there is no matching traffic (in seconds). If an HTTP keepalive is diff --git a/mmv1/products/compute/TargetInstance.yaml b/mmv1/products/compute/TargetInstance.yaml index 4146e355c310..3ff7681e4ea7 100644 --- a/mmv1/products/compute/TargetInstance.yaml +++ b/mmv1/products/compute/TargetInstance.yaml @@ -71,6 +71,7 @@ parameters: required: false immutable: true default_from_api: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::String name: 'name' diff --git a/mmv1/products/compute/TargetSslProxy.yaml b/mmv1/products/compute/TargetSslProxy.yaml index a8d221132251..cbd309ecfa02 100644 --- a/mmv1/products/compute/TargetSslProxy.yaml +++ b/mmv1/products/compute/TargetSslProxy.yaml @@ -100,6 +100,7 @@ properties: required: true update_verb: :POST update_url: 'projects/{{project}}/global/targetSslProxies/{{name}}/setBackendService' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Array name: 'sslCertificates' description: | @@ -116,6 +117,7 @@ properties: resource: 'SslCertificate' imports: 'selfLink' description: 'The SSL certificates used by this TargetSslProxy' + custom_expand: 'templates/terraform/custom_expand/array_resourceref_with_validation.go.erb' - !ruby/object:Api::Type::String name: 'certificateMap' description: | @@ -137,3 +139,4 @@ properties: resource will not have any SSL policy configured. update_verb: :POST update_url: 'projects/{{project}}/global/targetSslProxies/{{name}}/setSslPolicy' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' diff --git a/mmv1/products/compute/TargetTcpProxy.yaml b/mmv1/products/compute/TargetTcpProxy.yaml index 10dba50ba6fa..83f95b392044 100644 --- a/mmv1/products/compute/TargetTcpProxy.yaml +++ b/mmv1/products/compute/TargetTcpProxy.yaml @@ -99,6 +99,7 @@ properties: required: true update_verb: :POST update_url: 'projects/{{project}}/global/targetTcpProxies/{{name}}/setBackendService' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Boolean name: 'proxyBind' description: | diff --git a/mmv1/products/compute/TargetVpnGateway.yaml b/mmv1/products/compute/TargetVpnGateway.yaml index 6cb234d532d5..7087bb6be486 100644 --- a/mmv1/products/compute/TargetVpnGateway.yaml +++ b/mmv1/products/compute/TargetVpnGateway.yaml @@ -68,6 +68,7 @@ parameters: required: false default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::Time name: 'creationTimestamp' @@ -101,4 +102,5 @@ properties: description: | The network this VPN gateway is accepting traffic for. required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' immutable: true diff --git a/mmv1/products/compute/VpnGateway.yaml b/mmv1/products/compute/VpnGateway.yaml index acfed7fa62b6..a0435e33e39f 100644 --- a/mmv1/products/compute/VpnGateway.yaml +++ b/mmv1/products/compute/VpnGateway.yaml @@ -97,6 +97,7 @@ parameters: required: false default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::String name: 'description' @@ -124,6 +125,7 @@ properties: The network this VPN gateway is accepting traffic for. required: true immutable: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Enum name: 'stackType' description: | @@ -161,4 +163,5 @@ properties: specified interconnect attachment resource. Not currently available publicly. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' immutable: true diff --git a/mmv1/products/compute/VpnTunnel.yaml b/mmv1/products/compute/VpnTunnel.yaml index 4d881b42cfd9..3020328720d5 100644 --- a/mmv1/products/compute/VpnTunnel.yaml +++ b/mmv1/products/compute/VpnTunnel.yaml @@ -94,6 +94,7 @@ parameters: required: false default_from_api: true custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: - !ruby/object:Api::Type::String name: 'tunnel_id' @@ -130,6 +131,7 @@ properties: resource: 'VpnGateway' imports: 'selfLink' immutable: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'vpnGateway' description: | @@ -139,6 +141,7 @@ properties: resource: 'HaVpnGateway' imports: 'selfLink' immutable: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Integer name: 'vpnGatewayInterface' description: | @@ -154,6 +157,7 @@ properties: - peer_gcp_gateway description: | URL of the peer side external VPN gateway to which this VPN tunnel is connected. + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Integer name: 'peerExternalGatewayInterface' description: | @@ -170,6 +174,7 @@ properties: This field must reference a `google_compute_ha_vpn_gateway` resource. resource: 'HaVpnGateway' imports: 'selfLink' + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::ResourceRef name: 'router' description: | diff --git a/mmv1/products/compute/Zone.yaml b/mmv1/products/compute/Zone.yaml index ab61e803370c..08f0095c5288 100644 --- a/mmv1/products/compute/Zone.yaml +++ b/mmv1/products/compute/Zone.yaml @@ -93,6 +93,7 @@ properties: imports: 'selfLink' description: 'The region where the zone is located.' output: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' - !ruby/object:Api::Type::Enum name: 'status' description: 'The status of the zone.' diff --git a/mmv1/products/dns/ResponsePolicy.yaml b/mmv1/products/dns/ResponsePolicy.yaml index 25fe304c82b8..dc25972ec748 100644 --- a/mmv1/products/dns/ResponsePolicy.yaml +++ b/mmv1/products/dns/ResponsePolicy.yaml @@ -20,7 +20,6 @@ description: | base_url: 'projects/{{project}}/responsePolicies' self_link: 'projects/{{project}}/responsePolicies/{{response_policy_name}}' update_verb: :PATCH -min_version: beta identity: - responsePolicyName examples: diff --git a/mmv1/products/dns/ResponsePolicyRule.yaml b/mmv1/products/dns/ResponsePolicyRule.yaml index 57c2af897f1f..a795f5b0c897 100644 --- a/mmv1/products/dns/ResponsePolicyRule.yaml +++ b/mmv1/products/dns/ResponsePolicyRule.yaml @@ -22,7 +22,6 @@ description: | base_url: 'projects/{{project}}/responsePolicies/{{response_policy}}/rules' self_link: 'projects/{{project}}/responsePolicies/{{response_policy}}/rules/{{rule_name}}' update_verb: :PATCH -min_version: beta identity: - ruleName id_format: 'projects/{{project}}/responsePolicies/{{response_policy}}/rules/{{rule_name}}' diff --git a/mmv1/products/firebase/Project.yaml b/mmv1/products/firebase/Project.yaml index ef9666da0e77..2bb11382be4b 100644 --- a/mmv1/products/firebase/Project.yaml +++ b/mmv1/products/firebase/Project.yaml @@ -38,6 +38,7 @@ examples: primary_resource_id: 'default' vars: instance_name: 'memory-cache' + project_name: "my-project" test_env_vars: org_id: :ORG_ID custom_code: !ruby/object:Provider::Terraform::CustomCode diff --git a/mmv1/products/firebase/ProjectLocation.yaml b/mmv1/products/firebase/ProjectLocation.yaml index 9574a7ea90d6..0c7706419dd2 100644 --- a/mmv1/products/firebase/ProjectLocation.yaml +++ b/mmv1/products/firebase/ProjectLocation.yaml @@ -44,6 +44,8 @@ examples: primary_resource_id: 'basic' test_env_vars: org_id: :ORG_ID + vars: + project_name: "my-project" properties: - !ruby/object:Api::Type::String name: locationId diff --git a/mmv1/products/firebase/WebApp.yaml b/mmv1/products/firebase/WebApp.yaml index b593af788709..5e11372645ac 100644 --- a/mmv1/products/firebase/WebApp.yaml +++ b/mmv1/products/firebase/WebApp.yaml @@ -65,6 +65,7 @@ examples: vars: display_name: 'Display Name Basic' bucket_name: 'fb-webapp-' + project_name: "my-project" test_env_vars: org_id: :ORG_ID test_vars_overrides: diff --git a/mmv1/products/gkehub2/Feature.yaml b/mmv1/products/gkehub2/Feature.yaml index f8f5380c61f2..e2621d30a24c 100644 --- a/mmv1/products/gkehub2/Feature.yaml +++ b/mmv1/products/gkehub2/Feature.yaml @@ -143,7 +143,6 @@ properties: - !ruby/object:Api::Type::NestedObject name: fleetobservability description: Fleet Observability feature spec. - min_version: beta properties: - !ruby/object:Api::Type::NestedObject name: loggingConfig diff --git a/mmv1/products/gkeonprem/BareMetalAdminCluster.yaml b/mmv1/products/gkeonprem/BareMetalAdminCluster.yaml new file mode 100644 index 000000000000..288463c685db --- /dev/null +++ b/mmv1/products/gkeonprem/BareMetalAdminCluster.yaml @@ -0,0 +1,562 @@ +# Copyright 2023 Google Inc. +# Licensed under the Apache License, Version 2.0 (the License); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- !ruby/object:Api::Resource +name: "BareMetalAdminCluster" +min_version: beta +base_url: "projects/{{project}}/locations/{{location}}/bareMetalAdminClusters" +create_url: "projects/{{project}}/locations/{{location}}/bareMetalAdminClusters?bare_metal_admin_cluster_id={{name}}" +update_url: "projects/{{project}}/locations/{{location}}/bareMetalAdminClusters/{{name}}" +delete_url: "projects/{{project}}/locations/{{location}}/bareMetalAdminClusters/{{name}}:unenroll" +self_link: "projects/{{project}}/locations/{{location}}/bareMetalAdminClusters/{{name}}" +update_verb: :PATCH +update_mask: true +autogen_async: false +id_format: "projects/{{project}}/locations/{{location}}/bareMetalAdminClusters/{{name}}" +import_format: ["projects/{{project}}/locations/{{location}}/bareMetalAdminClusters/{{name}}"] +description: "A Google Bare Metal Admin Cluster." +examples: + - !ruby/object:Provider::Terraform::Examples + name: "gkeonprem_bare_metal_admin_cluster_basic" + min_version: beta + primary_resource_id: "admin-cluster-basic" + vars: + name: "basic" + test_env_vars: + project: "fake-backend-360322" + - !ruby/object:Provider::Terraform::Examples + name: "gkeonprem_bare_metal_admin_cluster_full" + min_version: beta + primary_resource_id: "admin-cluster-basic" + vars: + name: "basic" + test_env_vars: + project: "fake-backend-360322" +parameters: + - !ruby/object:Api::Type::String + name: "name" + description: The bare metal admin cluster name. + immutable: true + url_param_only: true + required: true + - !ruby/object:Api::Type::String + name: "location" + description: The location of the resource. + immutable: true + url_param_only: true + required: true +properties: + - !ruby/object:Api::Type::String + name: "description" + description: | + A human readable description of this Bare Metal Admin Cluster. + - !ruby/object:Api::Type::String + name: "bareMetalVersion" + description: | + A human readable description of this Bare Metal Admin Cluster. + - !ruby/object:Api::Type::String + name: "uid" + description: | + The unique identifier of the Bare Metal Admin Cluster. + output: true + - !ruby/object:Api::Type::Enum + name: "state" + description: The current state of this cluster. + output: true + values: + - STATE_UNSPECIFIED + - PROVISIONING + - RUNNING + - RECONCILING + - STOPPING + - ERROR + - DEGRADED + - !ruby/object:Api::Type::String + name: "endpoint" + description: | + The IP address name of Bare Metal Admin Cluster's API server. + output: true + - !ruby/object:Api::Type::Boolean + name: "reconciling" + description: | + If set, there are currently changes in flight to the Bare Metal Admin Cluster. + output: true + - !ruby/object:Api::Type::Time + name: "createTime" + description: | + The time the cluster was created, in RFC3339 text format. + output: true + - !ruby/object:Api::Type::Time + name: "updateTime" + description: | + The time the cluster was last updated, in RFC3339 text format. + output: true + - !ruby/object:Api::Type::Time + name: "deleteTime" + description: | + The time the cluster was deleted, in RFC3339 text format. + output: true + - !ruby/object:Api::Type::String + name: "localName" + description: | + The object name of the Bare Metal Admin Cluster custom resource on the + associated admin cluster. This field is used to support conflicting + names when enrolling existing clusters to the API. When used as a part of + cluster enrollment, this field will differ from the ID in the resource + name. For new clusters, this field will match the user provided cluster ID + and be visible in the last component of the resource name. It is not + modifiable. + All users should use this name to access their cluster using gkectl or + kubectl and should expect to see the local name when viewing admin + cluster controller logs. + output: true + - !ruby/object:Api::Type::String + name: "etag" + description: | + This checksum is computed by the server based on the value of other + fields, and may be sent on update and delete requests to ensure the + client has an up-to-date value before proceeding. + Allows clients to perform consistent read-modify-writes + through optimistic concurrency control. + output: true + - !ruby/object:Api::Type::KeyValuePairs + name: "annotations" + description: | + Annotations on the Bare Metal Admin Cluster. + This field has the same restrictions as Kubernetes annotations. + The total size of all keys and values combined is limited to 256k. + Key can have 2 segments: prefix (optional) and name (required), + separated by a slash (/). + Prefix must be a DNS subdomain. + Name must be 63 characters or less, begin and end with alphanumerics, + with dashes (-), underscores (_), dots (.), and alphanumerics between. + - !ruby/object:Api::Type::NestedObject + name: "networkConfig" + description: | + Network configuration. + properties: + - !ruby/object:Api::Type::NestedObject + name: "islandModeCidr" + exactly_one_of: + - network_config.0.island_mode_cidr + properties: + - !ruby/object:Api::Type::Array + name: "serviceAddressCidrBlocks" + item_type: Api::Type::String + required: true + description: | + All services in the cluster are assigned an RFC1918 IPv4 address from these ranges. This field cannot be changed after creation. + - !ruby/object:Api::Type::Array + name: "podAddressCidrBlocks" + item_type: Api::Type::String + required: true + description: | + All pods in the cluster are assigned an RFC1918 IPv4 address from these ranges. This field cannot be changed after creation. + - !ruby/object:Api::Type::NestedObject + name: "controlPlane" + description: | + Specifies the control plane configuration. + properties: + - !ruby/object:Api::Type::NestedObject + name: "controlPlaneNodePoolConfig" + required: true + description: | + Configures the node pool running the control plane. If specified the corresponding NodePool will be created for the cluster's control plane. The NodePool will have the same name and namespace as the cluster. + properties: + - !ruby/object:Api::Type::NestedObject + name: "nodePoolConfig" + required: true + description: | + The generic configuration for a node pool running the control plane. + properties: + - !ruby/object:Api::Type::Array + name: "nodeConfigs" + description: The list of machine addresses in the Bare Metal Node Pool. + item_type: !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: "nodeIp" + description: | + The default IPv4 address for SSH access and Kubernetes node. + Example: 192.168.0.1 + - !ruby/object:Api::Type::KeyValuePairs + name: "labels" + description: | + The map of Kubernetes labels (key/value pairs) to be applied to + each node. These will added in addition to any default label(s) + that Kubernetes may apply to the node. In case of conflict in + label keys, the applied set may differ depending on the Kubernetes + version -- it's best to assume the behavior is undefined and + conflicts should be avoided. For more information, including usage + and the valid values, see: + http://kubernetes.io/v1.1/docs/user-guide/labels.html + An object containing a list of "key": value pairs. + Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. + - !ruby/object:Api::Type::String + name: "operatingSystem" + description: | + Specifies the nodes operating system (default: LINUX). + - !ruby/object:Api::Type::Array + name: "taints" + description: | + The initial taints assigned to nodes of this node pool. + item_type: !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: "key" + description: | + Key associated with the effect. + - !ruby/object:Api::Type::String + name: "value" + description: | + Value associated with the effect. + - !ruby/object:Api::Type::Enum + name: "effect" + description: | + Specifies the nodes operating system (default: LINUX). + values: + - EFFECT_UNSPECIFIED + - PREFER_NO_SCHEDULE + - NO_EXECUTE + - !ruby/object:Api::Type::KeyValuePairs + name: "labels" + description: | + The map of Kubernetes labels (key/value pairs) to be applied to + each node. These will added in addition to any default label(s) + that Kubernetes may apply to the node. In case of conflict in + label keys, the applied set may differ depending on the Kubernetes + version -- it's best to assume the behavior is undefined and + conflicts should be avoided. For more information, including usage + and the valid values, see: + http://kubernetes.io/v1.1/docs/user-guide/labels.html + An object containing a list of "key": value pairs. + Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. + - !ruby/object:Api::Type::Array + name: "apiServerArgs" + description: | + Customizes the default API server args. Only a subset of + customized flags are supported. Please refer to the API server + documentation below to know the exact format: + https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/ + item_type: !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: "argument" + required: true + description: | + The argument name as it appears on the API Server command line please make sure to remove the leading dashes. + - !ruby/object:Api::Type::String + name: "value" + required: true + description: | + The value of the arg as it will be passed to the API Server command line. + - !ruby/object:Api::Type::NestedObject + name: "loadBalancer" + description: | + Specifies the load balancer configuration. + properties: + - !ruby/object:Api::Type::NestedObject + name: "vipConfig" + required: true + description: | + Specified the Bare Metal Load Balancer Config + properties: + - !ruby/object:Api::Type::String + name: "controlPlaneVip" + required: true + description: The VIP which you previously set aside for the Kubernetes API of this Bare Metal Admin Cluster. + - !ruby/object:Api::Type::NestedObject + name: "portConfig" + required: true + description: | + Specifies the load balancer ports. + properties: + - !ruby/object:Api::Type::Integer + name: "controlPlaneLoadBalancerPort" + required: true + description: | + The port that control plane hosted load balancers will listen on. + - !ruby/object:Api::Type::NestedObject + name: "manualLbConfig" + properties: + - !ruby/object:Api::Type::Boolean + name: "enabled" + required: true + description: | + Whether manual load balancing is enabled. + - !ruby/object:Api::Type::NestedObject + name: "storage" + description: | + Specifies the cluster storage configuration. + properties: + - !ruby/object:Api::Type::NestedObject + name: "lvpShareConfig" + required: true + description: | + Specifies the config for local PersistentVolumes backed by + subdirectories in a shared filesystem. These subdirectores are + automatically created during cluster creation. + properties: + - !ruby/object:Api::Type::NestedObject + name: "lvpConfig" + required: true + description: | + Defines the machine path and storage class for the LVP Share. + properties: + - !ruby/object:Api::Type::String + name: "path" + required: true + description: | + The host machine path. + - !ruby/object:Api::Type::String + name: "storageClass" + required: true + description: | + The StorageClass name that PVs will be created with. + - !ruby/object:Api::Type::Integer + name: "sharedPathPvCount" + description: | + The number of subdirectories to create under path. + - !ruby/object:Api::Type::NestedObject + name: "lvpNodeMountsConfig" + required: true + description: | + Specifies the config for local PersistentVolumes backed + by mounted node disks. These disks need to be formatted and mounted by the + user, which can be done before or after cluster creation. + properties: + - !ruby/object:Api::Type::String + name: "path" + required: true + description: | + The host machine path. + - !ruby/object:Api::Type::String + name: "storageClass" + required: true + description: | + The StorageClass name that PVs will be created with. + - !ruby/object:Api::Type::NestedObject + name: "proxy" + description: | + Specifies the cluster proxy configuration. + properties: + - !ruby/object:Api::Type::String + name: "uri" + required: true + description: | + Specifies the address of your proxy server. + Examples: http://domain + WARNING: Do not provide credentials in the format + http://(username:password@)domain these will be rejected by the server. + - !ruby/object:Api::Type::Array + name: "noProxy" + item_type: Api::Type::String + description: | + A list of IPs, hostnames, and domains that should skip the proxy. + Examples: ["127.0.0.1", "example.com", ".corp", "localhost"]. + - !ruby/object:Api::Type::NestedObject + name: "clusterOperations" + description: | + Specifies the Admin Cluster's observability infrastructure. + properties: + - !ruby/object:Api::Type::Boolean + name: "enableApplicationLogs" + description: | + Whether collection of application logs/metrics should be enabled (in addition to system logs/metrics). + - !ruby/object:Api::Type::NestedObject + name: "maintenanceConfig" + description: | + Specifies the workload node configurations. + properties: + - !ruby/object:Api::Type::Array + name: "maintenanceAddressCidrBlocks" + required: true + item_type: Api::Type::String + description: | + All IPv4 address from these ranges will be placed into maintenance mode. + Nodes in maintenance mode will be cordoned and drained. When both of these + are true, the "baremetal.cluster.gke.io/maintenance" annotation will be set + on the node resource. + - !ruby/object:Api::Type::NestedObject + name: "nodeConfig" + description: | + Specifies the workload node configurations. + properties: + - !ruby/object:Api::Type::Integer + name: "maxPodsPerNode" + description: | + The maximum number of pods a node can run. The size of the CIDR range + assigned to the node will be derived from this parameter. + - !ruby/object:Api::Type::NestedObject + name: "fleet" + output: true + description: | + Fleet related configuration. + Fleets are a Google Cloud concept for logically organizing clusters, + letting you use and manage multi-cluster capabilities and apply + consistent policies across your systems. + See [Anthos Fleets](https://cloud.google.com/anthos/multicluster-management/fleets) for + more details on Anthos multi-cluster capabilities using Fleets. + properties: + - !ruby/object:Api::Type::String + name: "membership" + description: | + The name of the managed Hub Membership resource associated to this cluster. + Membership names are formatted as + `projects//locations//memberships/`. + output: true + - !ruby/object:Api::Type::NestedObject + name: "status" + output: true + description: | + Specifies detailed cluster status. + properties: + - !ruby/object:Api::Type::String + name: "errorMessage" + description: | + Human-friendly representation of the error message from the admin cluster + controller. The error message can be temporary as the admin cluster + controller creates a cluster or node pool. If the error message persists + for a longer period of time, it can be used to surface error message to + indicate real problems requiring user intervention. + output: true + - !ruby/object:Api::Type::Array + name: "conditions" + description: | + ResourceConditions provide a standard mechanism for higher-level status reporting from admin cluster controller. + output: true + item_type: !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: "type" + description: | + Type of the condition. + (e.g., ClusterRunning, NodePoolRunning or ServerSidePreflightReady) + - !ruby/object:Api::Type::String + name: "reason" + description: | + Machine-readable message indicating details about last transition. + - !ruby/object:Api::Type::String + name: "message" + description: | + Human-readable message indicating details about last transition. + - !ruby/object:Api::Type::Time + name: "lastTransitionTime" + description: | + Last time the condition transit from one status to another. + output: true + - !ruby/object:Api::Type::Enum + name: "state" + description: The lifecycle state of the condition. + output: true + values: + - STATE_UNSPECIFIED + - STATE_TRUE + - STATE_FALSE + - STATE_UNKNOWN + - !ruby/object:Api::Type::NestedObject + name: "validationCheck" + output: true + description: | + Specifies the security related settings for the Bare Metal Admin Cluster. + properties: + - !ruby/object:Api::Type::Enum + name: "options" + description: Options used for the validation check. + output: true + values: + - OPTIONS_UNSPECIFIED + - SKIP_VALIDATION_CHECK_BLOCKING + - SKIP_VALIDATION_ALL + - !ruby/object:Api::Type::NestedObject + name: "status" + output: true + description: | + Specifies the detailed validation check status + properties: + - !ruby/object:Api::Type::Array + name: "result" + description: Individual checks which failed as part of the Preflight check execution. + output: true + item_type: !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::Enum + name: "options" + description: Options used for the validation check. + output: true + values: + - STATE_UNKNOWN + - STATE_FAILURE + - STATE_SKIPPED + - STATE_UNKNOWN + - STATE_FATAL + - STATE_WARNING + - !ruby/object:Api::Type::String + name: "description" + description: | + The description of the validation check. + output: true + - !ruby/object:Api::Type::String + name: "category" + description: | + The category of the validation. + output: true + - !ruby/object:Api::Type::String + name: "reason" + description: | + A human-readable message of the check failure. + output: true + - !ruby/object:Api::Type::String + name: "details" + description: | + Detailed failure information, which might be unformatted. + output: true + - !ruby/object:Api::Type::Enum + name: "scenario" + description: The scenario when the preflight checks were run.. + output: true + values: + - SCENARIO_UNSPECIFIED + - CREATE + - UPDATE + - !ruby/object:Api::Type::NestedObject + name: "nodeAccessConfig" + description: | + Specifies the node access related settings for the bare metal user cluster. + properties: + - !ruby/object:Api::Type::String + name: "loginUser" + required: false + description: | + LoginUser is the user name used to access node machines. + It defaults to "root" if not set. + - !ruby/object:Api::Type::NestedObject + name: "securityConfig" + description: | + Specifies the security related settings for the Bare Metal User Cluster. + properties: + - !ruby/object:Api::Type::NestedObject + name: "authorization" + description: | + Configures user access to the Bare Metal User cluster. + properties: + - !ruby/object:Api::Type::Array + name: "adminUsers" + required: true + description: Users that will be granted the cluster-admin role on the cluster, providing full access to the cluster. + item_type: !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: "username" + required: true + description: | + The name of the user, e.g. `my-gcp-id@gmail.com`. diff --git a/mmv1/products/iam2/DenyPolicy.yaml b/mmv1/products/iam2/DenyPolicy.yaml index eee80102cf8b..c73a17fb71b9 100644 --- a/mmv1/products/iam2/DenyPolicy.yaml +++ b/mmv1/products/iam2/DenyPolicy.yaml @@ -32,6 +32,7 @@ examples: vars: policy_name: 'my-deny-policy' account_id: 'svc-acc' + project_name: "my-project" test_env_vars: org_id: :ORG_ID billing_account: :BILLING_ACCT diff --git a/mmv1/products/monitoring/MonitoredProject.yaml b/mmv1/products/monitoring/MonitoredProject.yaml index 96a18785697e..b8dc6542cb06 100644 --- a/mmv1/products/monitoring/MonitoredProject.yaml +++ b/mmv1/products/monitoring/MonitoredProject.yaml @@ -27,6 +27,7 @@ references: !ruby/object:Api::Resource::ReferenceLinks nested_query: !ruby/object:Api::Resource::NestedQuery keys: - monitoredProjects +legacy_long_form_project: true description: "A [project being monitored](https://cloud.google.com/monitoring/settings/multiple-projects#create-multi) by a Metrics Scope." immutable: true custom_code: !ruby/object:Provider::Terraform::CustomCode diff --git a/mmv1/products/networksecurity/AddressGroup.yaml b/mmv1/products/networksecurity/AddressGroup.yaml index a883c74f853a..09177a4a472b 100644 --- a/mmv1/products/networksecurity/AddressGroup.yaml +++ b/mmv1/products/networksecurity/AddressGroup.yaml @@ -17,7 +17,6 @@ name: "AddressGroup" base_url: "{{parent}}/locations/{{location}}/addressGroups" create_url: "{{parent}}/locations/{{location}}/addressGroups?addressGroupId={{name}}" self_link: "{{parent}}/locations/{{location}}/addressGroups/{{name}}" -min_version: beta update_verb: :PATCH update_mask: true description: | @@ -32,7 +31,6 @@ autogen_async: false import_format: ["{{%parent}}/locations/{{location}}/addressGroups/{{name}}"] examples: - !ruby/object:Provider::Terraform::Examples - min_version: beta name: "network_security_address_groups_basic" primary_resource_id: "default" vars: @@ -40,7 +38,6 @@ examples: test_env_vars: project: :PROJECT_NAME - !ruby/object:Provider::Terraform::Examples - min_version: beta name: "network_security_address_groups_organization_basic" primary_resource_id: "default" vars: @@ -48,7 +45,6 @@ examples: test_env_vars: org_id: :ORG_ID - !ruby/object:Provider::Terraform::Examples - min_version: beta name: "network_security_address_groups_advanced" primary_resource_id: "default" vars: diff --git a/mmv1/products/networksecurity/GatewaySecurityPolicies.yaml b/mmv1/products/networksecurity/GatewaySecurityPolicies.yaml index e4a0eac2c96a..daab6b08b6ae 100644 --- a/mmv1/products/networksecurity/GatewaySecurityPolicies.yaml +++ b/mmv1/products/networksecurity/GatewaySecurityPolicies.yaml @@ -16,14 +16,13 @@ name: 'GatewaySecurityPolicy' base_url: 'projects/{{project}}/locations/{{location}}/gatewaySecurityPolicies' create_url: 'projects/{{project}}/locations/{{location}}/gatewaySecurityPolicies?gatewaySecurityPolicyId={{name}}' self_link: 'projects/{{project}}/locations/{{location}}/gatewaySecurityPolicies/{{name}}' -min_version: beta update_verb: :PATCH update_mask: true description: | The GatewaySecurityPolicy resource contains a collection of GatewaySecurityPolicyRules and associated metadata. references: !ruby/object:Api::Resource::ReferenceLinks - api: 'https://cloud.google.com/secure-web-proxy/docs/reference/network-security/rest/v1beta1/projects.locations.gatewaySecurityPolicies' + api: 'https://cloud.google.com/secure-web-proxy/docs/reference/network-security/rest/v1/projects.locations.gatewaySecurityPolicies' async: !ruby/object:Api::OpAsync operation: !ruby/object:Api::OpAsync::Operation path: 'name' @@ -51,7 +50,6 @@ import_format: ] examples: - !ruby/object:Provider::Terraform::Examples - min_version: beta name: 'network_security_gateway_security_policy_basic' primary_resource_id: 'default' vars: @@ -109,3 +107,4 @@ properties: ignore_read: true description: | Name of a TlsInspectionPolicy resource that defines how TLS inspection is performed for any rule that enables it. + min_version: beta diff --git a/mmv1/products/networksecurity/GatewaySecurityPoliciesRules.yaml b/mmv1/products/networksecurity/GatewaySecurityPoliciesRules.yaml index 65b2ba4cf434..5ab0a42fbae9 100644 --- a/mmv1/products/networksecurity/GatewaySecurityPoliciesRules.yaml +++ b/mmv1/products/networksecurity/GatewaySecurityPoliciesRules.yaml @@ -16,15 +16,14 @@ name: 'GatewaySecurityPolicyRule' base_url: 'projects/{{project}}/locations/{{location}}/gatewaySecurityPolicies/{{gateway_security_policy}}/rules' create_url: 'projects/{{project}}/locations/{{location}}/gatewaySecurityPolicies/{{gateway_security_policy}}/rules?gatewaySecurityPolicyRuleId={{name}}' self_link: 'projects/{{project}}/locations/{{location}}/gatewaySecurityPolicies/{{gateway_security_policy}}/rules/{{name}}' -min_version: beta update_verb: :PATCH update_mask: true description: | The GatewaySecurityPolicyRule resource is in a nested collection within a GatewaySecurityPolicy and represents a traffic matching condition and associated action to perform. references: - !ruby/object:Api::Resource::ReferenceLinks # TODO(felipegc): change the url to beta once it is available. - api: 'https://cloud.google.com/secure-web-proxy/docs/reference/network-security/rest/v1alpha1/projects.locations.gatewaySecurityPolicies.rules' + !ruby/object:Api::Resource::ReferenceLinks + api: 'https://cloud.google.com/secure-web-proxy/docs/reference/network-security/rest/v1/projects.locations.gatewaySecurityPolicies.rules' async: !ruby/object:Api::OpAsync operation: !ruby/object:Api::OpAsync::Operation path: 'name' @@ -52,14 +51,12 @@ import_format: ] examples: - !ruby/object:Provider::Terraform::Examples - min_version: beta name: 'network_security_gateway_security_policy_rules_basic' primary_resource_id: 'default' vars: gateway_security_policy_id: 'my-gateway-security-policy' resource_name: 'my-gateway-security-policy-rule' - !ruby/object:Provider::Terraform::Examples - min_version: beta name: 'network_security_gateway_security_policy_rules_advanced' primary_resource_id: 'default' vars: diff --git a/mmv1/products/networksecurity/UrlLists.yaml b/mmv1/products/networksecurity/UrlLists.yaml index 2dae75b6c30a..51a37c58e963 100644 --- a/mmv1/products/networksecurity/UrlLists.yaml +++ b/mmv1/products/networksecurity/UrlLists.yaml @@ -16,17 +16,16 @@ name: 'UrlLists' base_url: 'projects/{{project}}/locations/{{location}}/urlLists' create_url: 'projects/{{project}}/locations/{{location}}/urlLists?urlListId={{name}}' self_link: 'projects/{{project}}/locations/{{location}}/urlLists/{{name}}' -min_version: beta update_verb: :PATCH update_mask: true description: | UrlList proto helps users to set reusable, independently manageable lists of hosts, host patterns, URLs, URL patterns. references: - !ruby/object:Api::Resource::ReferenceLinks # TODO(diogoesteves): change the url to beta once it is available. + !ruby/object:Api::Resource::ReferenceLinks guides: 'Use UrlLists': ' https://cloud.google.com/secure-web-proxy/docs/use-url-list' - api: 'https://cloud.google.com/secure-web-proxy/docs/reference/network-security/rest/v1alpha1/projects.locations.urlLists' + api: 'https://cloud.google.com/secure-web-proxy/docs/reference/network-security/rest/v1/projects.locations.urlLists' async: !ruby/object:Api::OpAsync operation: !ruby/object:Api::OpAsync::Operation path: 'name' @@ -51,13 +50,11 @@ autogen_async: true import_format: ['projects/{{project}}/locations/{{location}}/urlLists/{{name}}'] examples: - !ruby/object:Provider::Terraform::Examples - min_version: beta name: 'network_security_url_lists_basic' primary_resource_id: 'default' vars: resource_name: 'my-url-lists' - !ruby/object:Provider::Terraform::Examples - min_version: beta name: 'network_security_url_lists_advanced' primary_resource_id: 'default' vars: diff --git a/mmv1/products/networksecurity/product.yaml b/mmv1/products/networksecurity/product.yaml index c668ed170ddd..85ae621d8459 100644 --- a/mmv1/products/networksecurity/product.yaml +++ b/mmv1/products/networksecurity/product.yaml @@ -17,6 +17,9 @@ versions: - !ruby/object:Api::Product::Version name: beta base_url: https://networksecurity.googleapis.com/v1beta1/ + - !ruby/object:Api::Product::Version + name: ga + base_url: https://networksecurity.googleapis.com/v1/ scopes: - https://www.googleapis.com/auth/cloud-platform apis_required: diff --git a/mmv1/products/networkservices/Gateway.yaml b/mmv1/products/networkservices/Gateway.yaml index a4c0d763cbdf..cb6e66f33d24 100644 --- a/mmv1/products/networkservices/Gateway.yaml +++ b/mmv1/products/networkservices/Gateway.yaml @@ -16,7 +16,6 @@ name: 'Gateway' base_url: 'projects/{{project}}/locations/{{location}}/gateways' create_url: 'projects/{{project}}/locations/{{location}}/gateways?gatewayId={{name}}' self_link: 'projects/{{project}}/locations/{{location}}/gateways/{{name}}' -min_version: beta update_verb: :PATCH update_mask: true description: | @@ -25,7 +24,7 @@ description: | along with any policy configurations. Routes have reference to to Gateways to dictate how requests should be routed by this Gateway. references: !ruby/object:Api::Resource::ReferenceLinks - api: 'https://cloud.google.com/traffic-director/docs/reference/network-services/rest/v1beta1/projects.locations.gateways' + api: 'https://cloud.google.com/traffic-director/docs/reference/network-services/rest/v1/projects.locations.gateways' async: !ruby/object:Api::OpAsync operation: !ruby/object:Api::OpAsync::Operation path: 'name' @@ -50,19 +49,16 @@ autogen_async: true import_format: ['projects/{{project}}/locations/{{location}}/gateways/{{name}}'] examples: - !ruby/object:Provider::Terraform::Examples - min_version: beta name: 'network_services_gateway_basic' primary_resource_id: 'default' vars: resource_name: 'my-gateway' - !ruby/object:Provider::Terraform::Examples - min_version: beta name: 'network_services_gateway_advanced' primary_resource_id: 'default' vars: resource_name: 'my-gateway' - !ruby/object:Provider::Terraform::Examples - min_version: beta name: 'network_services_gateway_secure_web_proxy' primary_resource_id: 'default' vars: @@ -77,7 +73,6 @@ examples: ignore_read_extra: - 'delete_swg_autogen_router_on_destroy' - !ruby/object:Provider::Terraform::Examples - min_version: beta name: 'network_services_gateway_multiple_swp_same_network' primary_resource_id: 'default' vars: diff --git a/mmv1/products/spanner/Database.yaml b/mmv1/products/spanner/Database.yaml index dbfe4060cd5a..4c203a389fd2 100644 --- a/mmv1/products/spanner/Database.yaml +++ b/mmv1/products/spanner/Database.yaml @@ -91,6 +91,7 @@ parameters: imports: 'name' description: 'The instance to create the database on.' required: true + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb' properties: # This resource returns only one attribute ("name") from which we parse # "instance", "name", and "project". You will need custom code handling diff --git a/mmv1/products/storage/BucketAccessControl.yaml b/mmv1/products/storage/BucketAccessControl.yaml index cea19fe24a40..eb1d63e8e705 100644 --- a/mmv1/products/storage/BucketAccessControl.yaml +++ b/mmv1/products/storage/BucketAccessControl.yaml @@ -59,7 +59,6 @@ properties: description: 'The name of the bucket.' required: true immutable: true - custom_expand: 'templates/terraform/custom_expand/resourceref_as_string.go.erb' - !ruby/object:Api::Type::String name: 'domain' description: 'The domain associated with the entity.' diff --git a/mmv1/products/storage/DefaultObjectACL.yaml b/mmv1/products/storage/DefaultObjectACL.yaml index e5056d70b5a3..1e276fa2dada 100644 --- a/mmv1/products/storage/DefaultObjectACL.yaml +++ b/mmv1/products/storage/DefaultObjectACL.yaml @@ -51,7 +51,6 @@ properties: imports: 'name' description: 'The name of the bucket.' required: true - custom_expand: 'templates/terraform/custom_expand/resourceref_as_string.go.erb' ignore_read: true - !ruby/object:Api::Type::String name: 'domain' diff --git a/mmv1/products/storage/ObjectAccessControl.yaml b/mmv1/products/storage/ObjectAccessControl.yaml index bf367f05d125..f967bd51a2b1 100644 --- a/mmv1/products/storage/ObjectAccessControl.yaml +++ b/mmv1/products/storage/ObjectAccessControl.yaml @@ -51,7 +51,6 @@ properties: imports: 'name' description: 'The name of the bucket.' required: true - custom_expand: 'templates/terraform/custom_expand/resourceref_as_string.go.erb' - !ruby/object:Api::Type::String name: 'domain' description: 'The domain associated with the entity.' diff --git a/mmv1/products/vertexai/Index.yaml b/mmv1/products/vertexai/Index.yaml index f288a3b3c458..938893755581 100644 --- a/mmv1/products/vertexai/Index.yaml +++ b/mmv1/products/vertexai/Index.yaml @@ -131,6 +131,16 @@ properties: performed. Exact reordering is a procedure where results returned by an approximate search algorithm are reordered via a more expensive distance computation. Required if tree-AH algorithm is used. + - !ruby/object:Api::Type::String + name: 'shardSize' + description: |- + Index data is split into equal parts to be processed. These are called "shards". + The shard size must be specified when creating an index. The value must be one of the followings: + * SHARD_SIZE_SMALL: Small (2GB) + * SHARD_SIZE_MEDIUM: Medium (20GB) + * SHARD_SIZE_LARGE: Large (50GB) + immutable: true + default_from_api: true - !ruby/object:Api::Type::String name: 'distanceMeasureType' description: |- @@ -147,6 +157,7 @@ properties: * UNIT_L2_NORM: Unit L2 normalization type * NONE: No normalization type is specified. default_value: 'NONE' + ignore_read: true - !ruby/object:Api::Type::NestedObject name: 'algorithmConfig' description: diff --git a/mmv1/provider/terraform/common~compile.yaml b/mmv1/provider/terraform/common~compile.yaml index 3649796c4b86..495a0ad7efe8 100644 --- a/mmv1/provider/terraform/common~compile.yaml +++ b/mmv1/provider/terraform/common~compile.yaml @@ -131,6 +131,30 @@ -%> '<%= fname.delete_suffix(".erb") -%>': '<%= file_path -%>' <% end -%> +# the generated folder inside .teamcity/components is where any files that need to be generated for team city +# will live, ie the list of services +<% + Dir["third_party/terraform/.teamcity/components/generated/*.erb"].each do |file_path| + fname = file_path.delete_prefix("third_party/terraform/") +-%> +'<%= fname.delete_suffix(".erb") -%>.kt': '<%= file_path -%>' +<% end -%> +# the generated folder inside .teamcity/tests is where any files that need to be generated for team city tests +# will live, ie files that include calling Google[Version] +<% + Dir["third_party/terraform/.teamcity/tests/generated/*.erb"].each do |file_path| + fname = file_path.delete_prefix("third_party/terraform/") +-%> +'<%= fname.delete_suffix(".erb") -%>.kt': '<%= file_path -%>' +<% end -%> +# there exists one file at the top level of .teamcity that needs to be generated for team city +# we'll handle that here +<% + Dir["third_party/terraform/.teamcity/generated/*.erb"].each do |file_path| + fname = file_path.delete_prefix("third_party/terraform/") +-%> +'<%= fname.delete_suffix(".erb").gsub("generated/", "") -%>': '<%= file_path -%>' +<% end -%> 'main.go': 'third_party/terraform/main.go.erb' 'go.mod': 'third_party/terraform/go.mod.erb' '.goreleaser.yml': 'third_party/terraform/.goreleaser.yml.erb' diff --git a/mmv1/provider/terraform/common~copy.yaml b/mmv1/provider/terraform/common~copy.yaml index e157b19dbc35..b4c1223e913a 100644 --- a/mmv1/provider/terraform/common~copy.yaml +++ b/mmv1/provider/terraform/common~copy.yaml @@ -161,5 +161,13 @@ 'website/<%= fname -%>': 'third_party/terraform/website/<%= fname -%>' <% end -%> <% end -%> +<% + Dir["third_party/terraform/.teamcity/*/*.kt"].each do |file_path| + fname = file_path.delete_prefix("third_party/terraform/") +-%> +'<%= fname -%>': '<%= file_path -%>' +<% end -%> +'.teamcity/.gitignore': 'third_party/terraform/.teamcity/.gitignore' +'.teamcity/Makefile': 'third_party/terraform/.teamcity/Makefile' 'version/version.go': 'third_party/terraform/version/version.go' 'go.sum': 'third_party/terraform/go.sum' diff --git a/mmv1/spec/data/resourceref-missingresource.yaml b/mmv1/spec/data/resourceref-missingresource.yaml deleted file mode 100644 index 9a384c8732f1..000000000000 --- a/mmv1/spec/data/resourceref-missingresource.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2017 Google Inc. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - ---- !ruby/object:Api::Product -name: MyProduct -versions: - - !ruby/object:Api::Product::Version - name: ga - base_url: http://myproduct.google.com/api -scopes: - - http://scope-to-my-api/ -objects: - - !ruby/object:Api::Resource - name: 'AnotherResource' - kind: 'myproduct#anotherresource' - base_url: 'anotherResource' - description: 'blah blah' - parameters: - - !ruby/object:Api::Type::ResourceRef - resource: 'resource' - name: 'property5' - imports: 'name' - description: 'an explanation whats this about' - properties: - - !ruby/object:Api::Type::String - name: 'property1' - description: | - Some multiline - description for the property. diff --git a/mmv1/spec/type_spec.rb b/mmv1/spec/type_spec.rb index 7edb9d4e4ce0..8df507988846 100644 --- a/mmv1/spec/type_spec.rb +++ b/mmv1/spec/type_spec.rb @@ -203,25 +203,6 @@ class MyType < Api::Type end describe Api::Type::ResourceRef do - context 'requires valid resource' do - let(:spec_location) do - File.join(File.dirname(__FILE__), 'data', - 'resourceref-missingresource.yaml') - end - let(:spec) do - File.open(spec_location, 'r') - end - - after(:each) { spec.close } - subject do - lambda do - Google::YamlValidator.parse(spec.read).validate - end - end - - it { is_expected.to raise_error(StandardError, /Missing 'resource'/) } - end - context 'requires valid imports' do let(:spec_location) do File.join(File.dirname(__FILE__), 'data', diff --git a/mmv1/templates/terraform/custom_expand/array_resourceref_with_validation.go.erb b/mmv1/templates/terraform/custom_expand/array_resourceref_with_validation.go.erb new file mode 100644 index 000000000000..ad2b0e6a729d --- /dev/null +++ b/mmv1/templates/terraform/custom_expand/array_resourceref_with_validation.go.erb @@ -0,0 +1,31 @@ +<%# Copyright 2023 Google Inc. +# Licensed under the Apache License, Version 2.0 (the 'License'); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an 'AS IS' BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +-%> +func expand<%= prefix -%><%= titlelize_property(property) -%>(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { +<% if property.is_set -%> + v = v.(*schema.Set).List() +<% end -%> + l := v.([]interface{}) + req := make([]interface{}, 0, len(l)) + for _, raw := range l { + if raw == nil { + return nil, fmt.Errorf("Invalid value for <%= property.name.underscore -%>: nil") + } + f, err := <%= build_expand_resource_ref('raw.(string)', property.item_type, pwd) %> + if err != nil { + return nil, fmt.Errorf("Invalid value for <%= property.name.underscore -%>: %s", err) + } + req = append(req, f.RelativeLink()) + } + return req, nil +} diff --git a/mmv1/templates/terraform/custom_expand/resourceref_as_string.go.erb b/mmv1/templates/terraform/custom_expand/resourceref_as_string.go.erb deleted file mode 100644 index 2ced30c53298..000000000000 --- a/mmv1/templates/terraform/custom_expand/resourceref_as_string.go.erb +++ /dev/null @@ -1,17 +0,0 @@ -<%# The license inside this block applies to this file. - # Copyright 2018 Google Inc. - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. --%> -func expand<%= prefix -%><%= titlelize_property(property) -%>(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { - return v, nil -} diff --git a/mmv1/templates/terraform/custom_expand/resourceref_with_validation.go.erb b/mmv1/templates/terraform/custom_expand/resourceref_with_validation.go.erb new file mode 100644 index 000000000000..ceefe0c58dbe --- /dev/null +++ b/mmv1/templates/terraform/custom_expand/resourceref_with_validation.go.erb @@ -0,0 +1,20 @@ +<%# Copyright 2023 Google Inc. +# Licensed under the Apache License, Version 2.0 (the 'License'); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an 'AS IS' BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +-%> +func expand<%= prefix -%><%= titlelize_property(property) -%>(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { + f, err := <%= build_expand_resource_ref('v.(string)', property, pwd) %> + if err != nil { + return nil, fmt.Errorf("Invalid value for <%= property.name.underscore -%>: %s", err) + } + return f.RelativeLink(), nil +} diff --git a/mmv1/templates/terraform/decoders/monitoring_monitored_project.go.erb b/mmv1/templates/terraform/decoders/monitoring_monitored_project.go.erb index 96e735c31d18..a05297c4df1a 100644 --- a/mmv1/templates/terraform/decoders/monitoring_monitored_project.go.erb +++ b/mmv1/templates/terraform/decoders/monitoring_monitored_project.go.erb @@ -20,6 +20,6 @@ if name != "" { if err != nil { return nil, err } - res["name"] = project.Name + res["name"] = project.ProjectId } return res, nil diff --git a/mmv1/templates/terraform/examples/certificate_manager_google_managed_certificate.tf.erb b/mmv1/templates/terraform/examples/certificate_manager_google_managed_certificate_dns.tf.erb similarity index 100% rename from mmv1/templates/terraform/examples/certificate_manager_google_managed_certificate.tf.erb rename to mmv1/templates/terraform/examples/certificate_manager_google_managed_certificate_dns.tf.erb diff --git a/mmv1/templates/terraform/examples/certificate_manager_google_managed_certificate_issuance_config.tf.erb b/mmv1/templates/terraform/examples/certificate_manager_google_managed_certificate_issuance_config.tf.erb new file mode 100644 index 000000000000..e94aebd04367 --- /dev/null +++ b/mmv1/templates/terraform/examples/certificate_manager_google_managed_certificate_issuance_config.tf.erb @@ -0,0 +1,74 @@ +resource "google_certificate_manager_certificate" "<%= ctx[:primary_resource_id] %>" { + name = "<%= ctx[:vars]['cert_name'] %>" + description = "The default cert" + scope = "EDGE_CACHE" + managed { + domains = [ + "terraform.subdomain1.com" + ] + issuance_config = google_certificate_manager_certificate_issuance_config.issuanceconfig.id + } +} + + + +# creating certificate_issuance_config to use it in the managed certificate +resource "google_certificate_manager_certificate_issuance_config" "issuanceconfig" { + name = "issuanceconfigtestterraform" + description = "sample description for the certificate issuanceConfigs" + certificate_authority_config { + certificate_authority_service_config { + ca_pool = google_privateca_ca_pool.pool.id + } + } + lifetime = "1814400s" + rotation_window_percentage = 34 + key_algorithm = "ECDSA_P256" + depends_on=[google_privateca_certificate_authority.ca_authority] +} + +resource "google_privateca_ca_pool" "pool" { + name = "<%= ctx[:vars]["pool_name"] %>" + location = "us-central1" + tier = "ENTERPRISE" +} + +resource "google_privateca_certificate_authority" "ca_authority" { + location = "us-central1" + pool = google_privateca_ca_pool.pool.name + certificate_authority_id = "<%= ctx[:vars]["ca_name"] %>" + config { + subject_config { + subject { + organization = "HashiCorp" + common_name = "my-certificate-authority" + } + subject_alt_name { + dns_names = ["hashicorp.com"] + } + } + x509_config { + ca_options { + is_ca = true + } + key_usage { + base_key_usage { + cert_sign = true + crl_sign = true + } + extended_key_usage { + server_auth = true + } + } + } + } + key_spec { + algorithm = "RSA_PKCS1_4096_SHA256" + } + + // Disable CA deletion related safe checks for easier cleanup. + deletion_protection = false + skip_grace_period = true + ignore_active_certificates_on_deletion = true +} + diff --git a/mmv1/templates/terraform/examples/cloudbuild_trigger_pubsub_with_repo.tf.erb b/mmv1/templates/terraform/examples/cloudbuild_trigger_pubsub_with_repo.tf.erb index b97450090aff..23bc2500e22f 100644 --- a/mmv1/templates/terraform/examples/cloudbuild_trigger_pubsub_with_repo.tf.erb +++ b/mmv1/templates/terraform/examples/cloudbuild_trigger_pubsub_with_repo.tf.erb @@ -1,5 +1,4 @@ resource "google_cloudbuildv2_connection" "my-connection" { - provider = google-beta location = "us-central1" name = "my-connection" @@ -12,19 +11,16 @@ resource "google_cloudbuildv2_connection" "my-connection" { } resource "google_cloudbuildv2_repository" "my-repository" { - provider = google-beta name = "my-repo" parent_connection = google_cloudbuildv2_connection.my-connection.id remote_uri = "<%= ctx[:vars]['repo_uri'] %>" } resource "google_pubsub_topic" "mytopic" { - provider = google-beta name = "mytopic" } resource "google_cloudbuild_trigger" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "pubsub-with-repo-trigger" location = "us-central1" diff --git a/mmv1/templates/terraform/examples/cloudbuild_trigger_repo.tf.erb b/mmv1/templates/terraform/examples/cloudbuild_trigger_repo.tf.erb index e2a2a1396a42..bea577a37ccc 100644 --- a/mmv1/templates/terraform/examples/cloudbuild_trigger_repo.tf.erb +++ b/mmv1/templates/terraform/examples/cloudbuild_trigger_repo.tf.erb @@ -1,5 +1,4 @@ resource "google_cloudbuildv2_connection" "my-connection" { - provider = google-beta location = "us-central1" name = "my-connection" @@ -12,14 +11,12 @@ resource "google_cloudbuildv2_connection" "my-connection" { } resource "google_cloudbuildv2_repository" "my-repository" { - provider = google-beta name = "my-repo" parent_connection = google_cloudbuildv2_connection.my-connection.id remote_uri = "<%= ctx[:vars]['repo_uri'] %>" } resource "google_cloudbuild_trigger" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta location = "us-central1" repository_event_config { diff --git a/mmv1/templates/terraform/examples/cloudbuildv2_connection.tf.erb b/mmv1/templates/terraform/examples/cloudbuildv2_connection.tf.erb index 601fdaa3d70b..041bbf4587e2 100644 --- a/mmv1/templates/terraform/examples/cloudbuildv2_connection.tf.erb +++ b/mmv1/templates/terraform/examples/cloudbuildv2_connection.tf.erb @@ -1,5 +1,4 @@ resource "google_cloudbuildv2_connection" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta location = "us-central1" name = "<%= ctx[:vars]['connection_name'] %>" diff --git a/mmv1/templates/terraform/examples/cloudfunctions2_basic.tf.erb b/mmv1/templates/terraform/examples/cloudfunctions2_basic.tf.erb index 66635b47ea73..4e1df2c222ac 100644 --- a/mmv1/templates/terraform/examples/cloudfunctions2_basic.tf.erb +++ b/mmv1/templates/terraform/examples/cloudfunctions2_basic.tf.erb @@ -1,4 +1,3 @@ -# [START functions_v2_basic] locals { project = "<%= ctx[:test_env_vars]['project'] %>" # Google Cloud Platform Project ID } @@ -41,4 +40,3 @@ resource "google_cloudfunctions2_function" "<%= ctx[:primary_resource_id] %>" { output "function_uri" { value = google_cloudfunctions2_function.function.service_config[0].uri } -# [END functions_v2_basic] \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/cloudfunctions2_basic_auditlogs.tf.erb b/mmv1/templates/terraform/examples/cloudfunctions2_basic_auditlogs.tf.erb index b0c0498091fe..c932b60e7de6 100644 --- a/mmv1/templates/terraform/examples/cloudfunctions2_basic_auditlogs.tf.erb +++ b/mmv1/templates/terraform/examples/cloudfunctions2_basic_auditlogs.tf.erb @@ -1,4 +1,3 @@ -# [START functions_v2_basic_auditlogs] # This example follows the examples shown in this Google Cloud Community blog post # https://medium.com/google-cloud/applying-a-path-pattern-when-filtering-in-eventarc-f06b937b4c34 # and the docs: @@ -106,5 +105,4 @@ resource "google_cloudfunctions2_function" "<%= ctx[:primary_resource_id] %>" { operator = "match-path-pattern" # This allows path patterns to be used in the value field } } -} -# [END functions_v2_basic_auditlogs] \ No newline at end of file +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/cloudfunctions2_basic_gcs.tf.erb b/mmv1/templates/terraform/examples/cloudfunctions2_basic_gcs.tf.erb index b221721eaddd..8dd602fc4c5f 100644 --- a/mmv1/templates/terraform/examples/cloudfunctions2_basic_gcs.tf.erb +++ b/mmv1/templates/terraform/examples/cloudfunctions2_basic_gcs.tf.erb @@ -1,5 +1,3 @@ -# [START functions_v2_basic_gcs] - resource "google_storage_bucket" "source-bucket" { name = "<%= ctx[:vars]['bucket_name_source'] %>" location = "US" @@ -103,4 +101,3 @@ resource "google_cloudfunctions2_function" "<%= ctx[:primary_resource_id] %>" { } } } -# [END functions_v2_basic_gcs] \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/cloudfunctions2_full.tf.erb b/mmv1/templates/terraform/examples/cloudfunctions2_full.tf.erb index ad6192714402..ab92bac7cb20 100644 --- a/mmv1/templates/terraform/examples/cloudfunctions2_full.tf.erb +++ b/mmv1/templates/terraform/examples/cloudfunctions2_full.tf.erb @@ -1,4 +1,3 @@ -# [START functions_v2_full] locals { project = "<%= ctx[:test_env_vars]['project'] %>" # Google Cloud Platform Project ID } @@ -65,4 +64,3 @@ resource "google_cloudfunctions2_function" "<%= ctx[:primary_resource_id] %>" { retry_policy = "RETRY_POLICY_RETRY" } } -# [END functions_v2_full] diff --git a/mmv1/templates/terraform/examples/cloudfunctions2_scheduler_auth.tf.erb b/mmv1/templates/terraform/examples/cloudfunctions2_scheduler_auth.tf.erb index 2d1d281625a7..a42ab22965b7 100644 --- a/mmv1/templates/terraform/examples/cloudfunctions2_scheduler_auth.tf.erb +++ b/mmv1/templates/terraform/examples/cloudfunctions2_scheduler_auth.tf.erb @@ -1,4 +1,3 @@ -# [START function_v2_scheduler_auth] locals { project = "<%= ctx[:test_env_vars]['project'] %>" # Google Cloud Platform Project ID } @@ -77,4 +76,3 @@ resource "google_cloud_scheduler_job" "invoke_cloud_function" { } } -# [END function_v2_scheduler_auth] diff --git a/mmv1/templates/terraform/examples/dns_response_policy_basic.tf.erb b/mmv1/templates/terraform/examples/dns_response_policy_basic.tf.erb index 62b6bb326c08..6bfde1fe8964 100644 --- a/mmv1/templates/terraform/examples/dns_response_policy_basic.tf.erb +++ b/mmv1/templates/terraform/examples/dns_response_policy_basic.tf.erb @@ -1,21 +1,15 @@ # [START dns_response_policy_basic] resource "google_compute_network" "network-1" { - provider = google-beta - name = "<%= ctx[:vars]['network_1_name'] %>" auto_create_subnetworks = false } resource "google_compute_network" "network-2" { - provider = google-beta - name = "<%= ctx[:vars]['network_2_name'] %>" auto_create_subnetworks = false } resource "google_compute_subnetwork" "subnetwork-1" { - provider = google-beta - name = google_compute_network.network-1.name network = google_compute_network.network-1.name ip_cidr_range = "10.0.36.0/24" @@ -34,8 +28,6 @@ resource "google_compute_subnetwork" "subnetwork-1" { } resource "google_container_cluster" "cluster-1" { - provider = google-beta - name = "<%= ctx[:vars]['cluster_1_name'] %>" location = "us-central1-c" initial_node_count = 1 @@ -64,10 +56,8 @@ resource "google_container_cluster" "cluster-1" { } resource "google_dns_response_policy" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta - response_policy_name = "<%= ctx[:vars]['response_policy_name'] %>" - + networks { network_url = google_compute_network.network-1.id } @@ -78,4 +68,4 @@ resource "google_dns_response_policy" "<%= ctx[:primary_resource_id] %>" { gke_cluster_name = google_container_cluster.cluster-1.id } } -# [END dns_response_policy_basic] \ No newline at end of file +# [END dns_response_policy_basic] diff --git a/mmv1/templates/terraform/examples/dns_response_policy_rule_basic.tf.erb b/mmv1/templates/terraform/examples/dns_response_policy_rule_basic.tf.erb index be24888bd74e..1500979ee66e 100644 --- a/mmv1/templates/terraform/examples/dns_response_policy_rule_basic.tf.erb +++ b/mmv1/templates/terraform/examples/dns_response_policy_rule_basic.tf.erb @@ -1,23 +1,17 @@ # [START dns_response_policy_rule_basic] resource "google_compute_network" "network-1" { - provider = google-beta - name = "<%= ctx[:vars]['network_1_name'] %>" auto_create_subnetworks = false } resource "google_compute_network" "network-2" { - provider = google-beta - name = "<%= ctx[:vars]['network_2_name'] %>" auto_create_subnetworks = false } resource "google_dns_response_policy" "response-policy" { - provider = google-beta - response_policy_name = "<%= ctx[:vars]['response_policy_name'] %>" - + networks { network_url = google_compute_network.network-1.id } @@ -27,8 +21,6 @@ resource "google_dns_response_policy" "response-policy" { } resource "google_dns_response_policy_rule" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta - response_policy = google_dns_response_policy.response-policy.response_policy_name rule_name = "<%= ctx[:vars]['response_policy_rule_name'] %>" dns_name = "dns.example.com." @@ -40,7 +32,7 @@ resource "google_dns_response_policy_rule" "<%= ctx[:primary_resource_id] %>" { ttl = 300 rrdatas = ["192.0.2.91"] } - } + } } -# [END dns_response_policy_rule_basic] \ No newline at end of file +# [END dns_response_policy_rule_basic] diff --git a/mmv1/templates/terraform/examples/enable_fleet_observability_for_both_default_and_scope_logs.tf.erb b/mmv1/templates/terraform/examples/enable_fleet_observability_for_both_default_and_scope_logs.tf.erb index 4492b62b6f21..003e7cf4c574 100644 --- a/mmv1/templates/terraform/examples/enable_fleet_observability_for_both_default_and_scope_logs.tf.erb +++ b/mmv1/templates/terraform/examples/enable_fleet_observability_for_both_default_and_scope_logs.tf.erb @@ -13,5 +13,4 @@ resource "google_gke_hub_feature" "feature" { } } } - provider = google-beta } diff --git a/mmv1/templates/terraform/examples/enable_fleet_observability_for_default_logs_with_COPY.tf.erb b/mmv1/templates/terraform/examples/enable_fleet_observability_for_default_logs_with_COPY.tf.erb index a1edd040c20f..ce3b2c7ef054 100644 --- a/mmv1/templates/terraform/examples/enable_fleet_observability_for_default_logs_with_COPY.tf.erb +++ b/mmv1/templates/terraform/examples/enable_fleet_observability_for_default_logs_with_COPY.tf.erb @@ -10,5 +10,4 @@ resource "google_gke_hub_feature" "feature" { } } } - provider = google-beta } diff --git a/mmv1/templates/terraform/examples/enable_fleet_observability_for_scope_logs_with_MOVE.tf.erb b/mmv1/templates/terraform/examples/enable_fleet_observability_for_scope_logs_with_MOVE.tf.erb index d65179b16313..1a713fe42fb3 100644 --- a/mmv1/templates/terraform/examples/enable_fleet_observability_for_scope_logs_with_MOVE.tf.erb +++ b/mmv1/templates/terraform/examples/enable_fleet_observability_for_scope_logs_with_MOVE.tf.erb @@ -10,5 +10,4 @@ resource "google_gke_hub_feature" "feature" { } } } - provider = google-beta } diff --git a/mmv1/templates/terraform/examples/eventarc_basic_tf.tf.erb b/mmv1/templates/terraform/examples/eventarc_basic_tf.tf.erb index 272cd21bc6bd..8fa8122d06c7 100644 --- a/mmv1/templates/terraform/examples/eventarc_basic_tf.tf.erb +++ b/mmv1/templates/terraform/examples/eventarc_basic_tf.tf.erb @@ -1,4 +1,3 @@ -# [START eventarc_terraform_enableapis] # Used to retrieve project_number later data "google_project" "project" { provider = google-beta @@ -18,10 +17,6 @@ resource "google_project_service" "eventarc" { disable_on_destroy = false } -# [END eventarc_terraform_enableapis] - -# [START cloudrun_terraform_deploy_eventarc] - # Deploy Cloud Run service resource "google_cloud_run_service" "<%= ctx[:primary_resource_id] %>" { provider = google-beta @@ -52,11 +47,6 @@ resource "google_cloud_run_service_iam_member" "allUsers" { role = "roles/run.invoker" member = "allUsers" } - - -# [END cloudrun_terraform_deploy_eventarc] - -# [START eventarc_terraform_pubsub] # Create a Pub/Sub trigger resource "google_eventarc_trigger" "<%= ctx[:vars]['trigger_pubsub_tf'] %>" { @@ -77,9 +67,6 @@ resource "google_eventarc_trigger" "<%= ctx[:vars]['trigger_pubsub_tf'] %>" { depends_on = [google_project_service.eventarc] } -# [END eventarc_terraform_pubsub] -# [START eventarc_terraform_auditlog_storage] - # Give default Compute service account eventarc.eventReceiver role resource "google_project_iam_binding" "project" { provider = google-beta @@ -119,6 +106,3 @@ resource "google_eventarc_trigger" "<%= ctx[:vars]['trigger_auditlog_tf'] %>" { depends_on = [google_project_service.eventarc] } - -# [END eventarc_terraform_auditlog_storage] - diff --git a/mmv1/templates/terraform/examples/eventarc_workflows.tf.erb b/mmv1/templates/terraform/examples/eventarc_workflows.tf.erb index e980d57247bb..de50f4cb9c8f 100644 --- a/mmv1/templates/terraform/examples/eventarc_workflows.tf.erb +++ b/mmv1/templates/terraform/examples/eventarc_workflows.tf.erb @@ -1,4 +1,3 @@ -# [START eventarc_terraform_enableapis] # Used to retrieve project_number later data "google_project" "project" { provider = google-beta @@ -25,9 +24,7 @@ resource "google_project_service" "workflows" { disable_on_destroy = false } -# [END eventarc_terraform_enableapis] -# [START eventarc_workflows_create_serviceaccount] # Create a service account for Eventarc trigger and Workflows resource "google_service_account" "eventarc_workflows_service_account" { @@ -58,9 +55,7 @@ members = ["serviceAccount:${google_service_account.eventarc_workflows_service_a depends_on = [google_service_account.eventarc_workflows_service_account] } -# [END eventarc_workflows_create_serviceaccount] -# [START eventarc_workflows_deploy] # Define and deploy a workflow resource "google_workflows_workflow" "workflows_example" { name = "<%= ctx[:vars]['pubsub_workflow_tf'] %>" @@ -75,9 +70,7 @@ resource "google_workflows_workflow" "workflows_example" { google_service_account.eventarc_workflows_service_account] } -# [END eventarc_workflows_deploy] -# [START eventarc_create_pubsub_trigger] # Create an Eventarc trigger routing Pub/Sub events to Workflows resource "google_eventarc_trigger" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['trigger_pubsub_workflow_tf'] %>" @@ -98,4 +91,3 @@ resource "google_eventarc_trigger" "<%= ctx[:primary_resource_id] %>" { google_service_account.eventarc_workflows_service_account] } -# [END eventarc_create_pubsub_trigger] diff --git a/mmv1/templates/terraform/examples/firebase_project_basic.tf.erb b/mmv1/templates/terraform/examples/firebase_project_basic.tf.erb index efe50d73cded..3334201307eb 100644 --- a/mmv1/templates/terraform/examples/firebase_project_basic.tf.erb +++ b/mmv1/templates/terraform/examples/firebase_project_basic.tf.erb @@ -1,8 +1,8 @@ resource "google_project" "default" { provider = google-beta - project_id = "tf-test%{random_suffix}" - name = "tf-test%{random_suffix}" + project_id = "<%= ctx[:vars]['project_name'] %>" + name = "<%= ctx[:vars]['project_name'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" labels = { diff --git a/mmv1/templates/terraform/examples/firebase_project_location_basic.tf.erb b/mmv1/templates/terraform/examples/firebase_project_location_basic.tf.erb index e38e90aa9f2b..4cdebbe83a21 100644 --- a/mmv1/templates/terraform/examples/firebase_project_location_basic.tf.erb +++ b/mmv1/templates/terraform/examples/firebase_project_location_basic.tf.erb @@ -1,8 +1,8 @@ resource "google_project" "default" { provider = google-beta - project_id = "tf-test%{random_suffix}" - name = "tf-test%{random_suffix}" + project_id = "<%= ctx[:vars]['project_name'] %>" + name = "<%= ctx[:vars]['project_name'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" labels = { diff --git a/mmv1/templates/terraform/examples/firebase_web_app_basic.tf.erb b/mmv1/templates/terraform/examples/firebase_web_app_basic.tf.erb index 87301333ee5b..c75c49c821d6 100644 --- a/mmv1/templates/terraform/examples/firebase_web_app_basic.tf.erb +++ b/mmv1/templates/terraform/examples/firebase_web_app_basic.tf.erb @@ -1,8 +1,8 @@ resource "google_project" "default" { provider = google-beta - project_id = "tf-test%{random_suffix}" - name = "tf-test%{random_suffix}" + project_id = "<%= ctx[:vars]['project_name'] %>" + name = "<%= ctx[:vars]['project_name'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" labels = { diff --git a/mmv1/templates/terraform/examples/gkeonprem_bare_metal_admin_cluster_basic.tf.erb b/mmv1/templates/terraform/examples/gkeonprem_bare_metal_admin_cluster_basic.tf.erb new file mode 100644 index 000000000000..af70a9f45935 --- /dev/null +++ b/mmv1/templates/terraform/examples/gkeonprem_bare_metal_admin_cluster_basic.tf.erb @@ -0,0 +1,59 @@ +resource "google_gkeonprem_bare_metal_admin_cluster" "<%= ctx[:primary_resource_id] %>" { + provider = google-beta + name = "<%= ctx[:vars]['name'] %>" + location = "us-west1" + bare_metal_version = "1.13.4" + network_config { + island_mode_cidr { + service_address_cidr_blocks = ["172.26.0.0/16"] + pod_address_cidr_blocks = ["10.240.0.0/13"] + } + } + node_config { + max_pods_per_node = 250 + } + control_plane { + control_plane_node_pool_config { + node_pool_config { + labels = {} + operating_system = "LINUX" + node_configs { + labels = {} + node_ip = "10.200.0.2" + } + node_configs { + labels = {} + node_ip = "10.200.0.3" + } + node_configs { + labels = {} + node_ip = "10.200.0.4" + } + } + } + } + load_balancer { + port_config { + control_plane_load_balancer_port = 443 + } + vip_config { + control_plane_vip = "10.200.0.5" + } + } + storage { + lvp_share_config { + lvp_config { + path = "/mnt/localpv-share" + storage_class = "local-shared" + } + shared_path_pv_count = 5 + } + lvp_node_mounts_config { + path = "/mnt/localpv-disk" + storage_class = "local-disks" + } + } + node_access_config { + login_user = "root" + } +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/gkeonprem_bare_metal_admin_cluster_full.tf.erb b/mmv1/templates/terraform/examples/gkeonprem_bare_metal_admin_cluster_full.tf.erb new file mode 100644 index 000000000000..58046c4f55cc --- /dev/null +++ b/mmv1/templates/terraform/examples/gkeonprem_bare_metal_admin_cluster_full.tf.erb @@ -0,0 +1,90 @@ +resource "google_gkeonprem_bare_metal_admin_cluster" "<%= ctx[:primary_resource_id] %>" { + provider = google-beta + name = "<%= ctx[:vars]['name'] %>" + location = "us-west1" + description = "test description" + bare_metal_version = "1.13.4" + annotations = {} + network_config { + island_mode_cidr { + service_address_cidr_blocks = ["172.26.0.0/16"] + pod_address_cidr_blocks = ["10.240.0.0/13"] + } + } + node_config { + max_pods_per_node = 250 + } + control_plane { + control_plane_node_pool_config { + node_pool_config { + labels = {} + operating_system = "LINUX" + node_configs { + labels = {} + node_ip = "10.200.0.2" + } + node_configs { + labels = {} + node_ip = "10.200.0.3" + } + node_configs { + labels = {} + node_ip = "10.200.0.4" + } + taints { + key = "test-key" + value = "test-value" + effect = "NO_EXECUTE" + } + } + } + api_server_args { + argument = "test argument" + value = "test value" + } + } + load_balancer { + port_config { + control_plane_load_balancer_port = 443 + } + vip_config { + control_plane_vip = "10.200.0.5" + } + manual_lb_config { + enabled = true + } + } + storage { + lvp_share_config { + lvp_config { + path = "/mnt/localpv-share" + storage_class = "local-shared" + } + shared_path_pv_count = 5 + } + lvp_node_mounts_config { + path = "/mnt/localpv-disk" + storage_class = "local-disks" + } + } + node_access_config { + login_user = "root" + } + security_config { + authorization { + admin_users { + username = "admin@hashicorptest.com" + } + } + } + maintenance_config { + maintenance_address_cidr_blocks = ["10.0.0.1/32", "10.0.0.2/32"] + } + cluster_operations { + enable_application_logs = true + } + proxy { + uri = "test proxy uri" + no_proxy = ["127.0.0.1"] + } +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/iam_deny_policy_basic.tf.erb b/mmv1/templates/terraform/examples/iam_deny_policy_basic.tf.erb index e98cc4ade771..f9aef33b1be2 100644 --- a/mmv1/templates/terraform/examples/iam_deny_policy_basic.tf.erb +++ b/mmv1/templates/terraform/examples/iam_deny_policy_basic.tf.erb @@ -1,7 +1,7 @@ resource "google_project" "project" { provider = google-beta - project_id = "tf-test%{random_suffix}" - name = "tf-test%{random_suffix}" + project_id = "<%= ctx[:vars]["project_name"] %>" + name = "<%= ctx[:vars]["project_name"] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" } diff --git a/mmv1/templates/terraform/examples/network_security_address_groups_advanced.tf.erb b/mmv1/templates/terraform/examples/network_security_address_groups_advanced.tf.erb index f0361109bb51..4c69e316cea4 100644 --- a/mmv1/templates/terraform/examples/network_security_address_groups_advanced.tf.erb +++ b/mmv1/templates/terraform/examples/network_security_address_groups_advanced.tf.erb @@ -1,5 +1,4 @@ resource "google_network_security_address_group" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['resource_name'] %>" parent = "projects/<%= ctx[:test_env_vars]['project'] %>" location = "us-central1" diff --git a/mmv1/templates/terraform/examples/network_security_address_groups_basic.tf.erb b/mmv1/templates/terraform/examples/network_security_address_groups_basic.tf.erb index 90bbf52ef9ec..00b78c6c92a0 100644 --- a/mmv1/templates/terraform/examples/network_security_address_groups_basic.tf.erb +++ b/mmv1/templates/terraform/examples/network_security_address_groups_basic.tf.erb @@ -1,5 +1,4 @@ resource "google_network_security_address_group" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['resource_name'] %>" parent = "projects/<%= ctx[:test_env_vars]['project'] %>" location = "us-central1" diff --git a/mmv1/templates/terraform/examples/network_security_address_groups_organization_basic.tf.erb b/mmv1/templates/terraform/examples/network_security_address_groups_organization_basic.tf.erb index 1ea9532296b9..fa85ab60d26c 100644 --- a/mmv1/templates/terraform/examples/network_security_address_groups_organization_basic.tf.erb +++ b/mmv1/templates/terraform/examples/network_security_address_groups_organization_basic.tf.erb @@ -1,5 +1,4 @@ resource "google_network_security_address_group" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['resource_name'] %>" parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>" location = "us-central1" diff --git a/mmv1/templates/terraform/examples/network_security_gateway_security_policy_basic.tf.erb b/mmv1/templates/terraform/examples/network_security_gateway_security_policy_basic.tf.erb index 467cedf51177..74b218af71a0 100644 --- a/mmv1/templates/terraform/examples/network_security_gateway_security_policy_basic.tf.erb +++ b/mmv1/templates/terraform/examples/network_security_gateway_security_policy_basic.tf.erb @@ -1,5 +1,4 @@ resource "google_network_security_gateway_security_policy" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['resource_name'] %>" location = "us-central1" description = "my description" diff --git a/mmv1/templates/terraform/examples/network_security_gateway_security_policy_rules_advanced.tf.erb b/mmv1/templates/terraform/examples/network_security_gateway_security_policy_rules_advanced.tf.erb index 2dc4f297604a..0515e303da52 100644 --- a/mmv1/templates/terraform/examples/network_security_gateway_security_policy_rules_advanced.tf.erb +++ b/mmv1/templates/terraform/examples/network_security_gateway_security_policy_rules_advanced.tf.erb @@ -1,12 +1,10 @@ resource "google_network_security_gateway_security_policy" "default" { - provider = google-beta name = "<%= ctx[:vars]['gateway_security_policy_id'] %>" location = "us-central1" description = "gateway security policy created to be used as reference by the rule." } resource "google_network_security_gateway_security_policy_rule" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['resource_name'] %>" location = "us-central1" gateway_security_policy = google_network_security_gateway_security_policy.default.name diff --git a/mmv1/templates/terraform/examples/network_security_gateway_security_policy_rules_basic.tf.erb b/mmv1/templates/terraform/examples/network_security_gateway_security_policy_rules_basic.tf.erb index d0dbb664cc2c..b3a989df1d46 100644 --- a/mmv1/templates/terraform/examples/network_security_gateway_security_policy_rules_basic.tf.erb +++ b/mmv1/templates/terraform/examples/network_security_gateway_security_policy_rules_basic.tf.erb @@ -1,12 +1,10 @@ resource "google_network_security_gateway_security_policy" "default" { - provider = google-beta name = "<%= ctx[:vars]['gateway_security_policy_id'] %>" location = "us-central1" description = "gateway security policy created to be used as reference by the rule." } resource "google_network_security_gateway_security_policy_rule" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['resource_name'] %>" location = "us-central1" gateway_security_policy = google_network_security_gateway_security_policy.default.name diff --git a/mmv1/templates/terraform/examples/network_security_url_lists_advanced.tf.erb b/mmv1/templates/terraform/examples/network_security_url_lists_advanced.tf.erb index dbd19f9aa9f4..395f1596fd5f 100644 --- a/mmv1/templates/terraform/examples/network_security_url_lists_advanced.tf.erb +++ b/mmv1/templates/terraform/examples/network_security_url_lists_advanced.tf.erb @@ -1,5 +1,4 @@ resource "google_network_security_url_lists" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['resource_name'] %>" location = "us-central1" description = "my description" diff --git a/mmv1/templates/terraform/examples/network_security_url_lists_basic.tf.erb b/mmv1/templates/terraform/examples/network_security_url_lists_basic.tf.erb index 97eba9702ced..363c6404930d 100644 --- a/mmv1/templates/terraform/examples/network_security_url_lists_basic.tf.erb +++ b/mmv1/templates/terraform/examples/network_security_url_lists_basic.tf.erb @@ -1,5 +1,4 @@ resource "google_network_security_url_lists" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['resource_name'] %>" location = "us-central1" values = ["www.example.com"] diff --git a/mmv1/templates/terraform/examples/network_services_gateway_advanced.tf.erb b/mmv1/templates/terraform/examples/network_services_gateway_advanced.tf.erb index 9515c48c1ff7..9904d7685b8f 100644 --- a/mmv1/templates/terraform/examples/network_services_gateway_advanced.tf.erb +++ b/mmv1/templates/terraform/examples/network_services_gateway_advanced.tf.erb @@ -1,5 +1,4 @@ resource "google_network_services_gateway" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['resource_name'] %>" labels = { foo = "bar" diff --git a/mmv1/templates/terraform/examples/network_services_gateway_basic.tf.erb b/mmv1/templates/terraform/examples/network_services_gateway_basic.tf.erb index 64070c7a2a3f..9d46fcc890d5 100644 --- a/mmv1/templates/terraform/examples/network_services_gateway_basic.tf.erb +++ b/mmv1/templates/terraform/examples/network_services_gateway_basic.tf.erb @@ -1,5 +1,4 @@ resource "google_network_services_gateway" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['resource_name'] %>" scope = "default-scope-basic" type = "OPEN_MESH" diff --git a/mmv1/templates/terraform/examples/network_services_gateway_multiple_swp_same_network.tf.erb b/mmv1/templates/terraform/examples/network_services_gateway_multiple_swp_same_network.tf.erb index 8c86c2246a80..b144b75cee06 100644 --- a/mmv1/templates/terraform/examples/network_services_gateway_multiple_swp_same_network.tf.erb +++ b/mmv1/templates/terraform/examples/network_services_gateway_multiple_swp_same_network.tf.erb @@ -1,5 +1,4 @@ resource "google_certificate_manager_certificate" "default" { - provider = google-beta name = "<%= ctx[:vars]['certificate_name'] %>" location = "us-south1" self_managed { @@ -9,14 +8,12 @@ resource "google_certificate_manager_certificate" "default" { } resource "google_compute_network" "default" { - provider = google-beta name = "<%= ctx[:vars]['network_name'] %>" routing_mode = "REGIONAL" auto_create_subnetworks = false } resource "google_compute_subnetwork" "default" { - provider = google-beta name = "<%= ctx[:vars]['subnetwork_name'] %>" purpose = "PRIVATE" ip_cidr_range = "10.128.0.0/20" @@ -26,7 +23,6 @@ resource "google_compute_subnetwork" "default" { } resource "google_compute_subnetwork" "proxyonlysubnet" { - provider = google-beta name = "<%= ctx[:vars]['proxy_only_subnetwork_name'] %>" purpose = "REGIONAL_MANAGED_PROXY" ip_cidr_range = "192.168.0.0/23" @@ -36,13 +32,11 @@ resource "google_compute_subnetwork" "proxyonlysubnet" { } resource "google_network_security_gateway_security_policy" "default" { - provider = google-beta name = "<%= ctx[:vars]['policy_name'] %>" location = "us-south1" } resource "google_network_security_gateway_security_policy_rule" "default" { - provider = google-beta name = "<%= ctx[:vars]['policy_rule_name'] %>" location = "us-south1" gateway_security_policy = google_network_security_gateway_security_policy.default.name @@ -53,7 +47,6 @@ resource "google_network_security_gateway_security_policy_rule" "default" { } resource "google_network_services_gateway" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['gateway_name_1'] %>" location = "us-south1" addresses = ["10.128.0.99"] @@ -69,7 +62,6 @@ resource "google_network_services_gateway" "<%= ctx[:primary_resource_id] %>" { } resource "google_network_services_gateway" "gateway2" { - provider = google-beta name = "<%= ctx[:vars]['gateway_name_2'] %>" location = "us-south1" addresses = ["10.128.0.98"] diff --git a/mmv1/templates/terraform/examples/network_services_gateway_secure_web_proxy.tf.erb b/mmv1/templates/terraform/examples/network_services_gateway_secure_web_proxy.tf.erb index 9dfdd66e2486..ff952e77f3e9 100644 --- a/mmv1/templates/terraform/examples/network_services_gateway_secure_web_proxy.tf.erb +++ b/mmv1/templates/terraform/examples/network_services_gateway_secure_web_proxy.tf.erb @@ -1,5 +1,4 @@ resource "google_certificate_manager_certificate" "default" { - provider = google-beta name = "<%= ctx[:vars]['certificate_name'] %>" location = "us-central1" self_managed { @@ -9,14 +8,12 @@ resource "google_certificate_manager_certificate" "default" { } resource "google_compute_network" "default" { - provider = google-beta name = "<%= ctx[:vars]['network_name'] %>" routing_mode = "REGIONAL" auto_create_subnetworks = false } resource "google_compute_subnetwork" "default" { - provider = google-beta name = "<%= ctx[:vars]['subnetwork_name'] %>" purpose = "PRIVATE" ip_cidr_range = "10.128.0.0/20" @@ -26,7 +23,6 @@ resource "google_compute_subnetwork" "default" { } resource "google_compute_subnetwork" "proxyonlysubnet" { - provider = google-beta name = "<%= ctx[:vars]['proxy_only_subnetwork_name'] %>" purpose = "REGIONAL_MANAGED_PROXY" ip_cidr_range = "192.168.0.0/23" @@ -36,13 +32,11 @@ resource "google_compute_subnetwork" "proxyonlysubnet" { } resource "google_network_security_gateway_security_policy" "default" { - provider = google-beta name = "<%= ctx[:vars]['policy_name'] %>" location = "us-central1" } resource "google_network_security_gateway_security_policy_rule" "default" { - provider = google-beta name = "<%= ctx[:vars]['policy_rule_name'] %>" location = "us-central1" gateway_security_policy = google_network_security_gateway_security_policy.default.name @@ -53,7 +47,6 @@ resource "google_network_security_gateway_security_policy_rule" "default" { } resource "google_network_services_gateway" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['gateway_name_1'] %>" location = "us-central1" addresses = ["10.128.0.99"] diff --git a/mmv1/templates/terraform/examples/router_peer_basic.tf.erb b/mmv1/templates/terraform/examples/router_peer_basic.tf.erb index b17f3331acbf..b63b6d195d60 100644 --- a/mmv1/templates/terraform/examples/router_peer_basic.tf.erb +++ b/mmv1/templates/terraform/examples/router_peer_basic.tf.erb @@ -2,7 +2,6 @@ resource "google_compute_router_peer" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['peer_name'] %>" router = "<%= ctx[:vars]['router_name'] %>" region = "us-central1" - peer_ip_address = "169.254.1.2" peer_asn = 65513 advertised_route_priority = 100 interface = "interface-1" diff --git a/mmv1/templates/terraform/examples/target_http_proxy_http_keep_alive_timeout.tf.erb b/mmv1/templates/terraform/examples/target_http_proxy_http_keep_alive_timeout.tf.erb index b590a318cdb8..de469704cf0d 100644 --- a/mmv1/templates/terraform/examples/target_http_proxy_http_keep_alive_timeout.tf.erb +++ b/mmv1/templates/terraform/examples/target_http_proxy_http_keep_alive_timeout.tf.erb @@ -1,13 +1,11 @@ # [START cloudloadbalancing_target_http_proxy_http_keep_alive_timeout] resource "google_compute_target_http_proxy" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['target_http_proxy_name'] %>" - http_keep_alive_timeout_sec = 120 + http_keep_alive_timeout_sec = 610 url_map = google_compute_url_map.default.id } resource "google_compute_url_map" "default" { - provider = google-beta name = "<%= ctx[:vars]['url_map_name'] %>" default_service = google_compute_backend_service.default.id @@ -28,7 +26,6 @@ resource "google_compute_url_map" "default" { } resource "google_compute_backend_service" "default" { - provider = google-beta name = "<%= ctx[:vars]['backend_service_name'] %>" port_name = "http" protocol = "HTTP" @@ -39,7 +36,6 @@ resource "google_compute_backend_service" "default" { } resource "google_compute_http_health_check" "default" { - provider = google-beta name = "<%= ctx[:vars]['http_health_check_name'] %>" request_path = "/" check_interval_sec = 1 diff --git a/mmv1/templates/terraform/examples/target_https_proxy_http_keep_alive_timeout.tf.erb b/mmv1/templates/terraform/examples/target_https_proxy_http_keep_alive_timeout.tf.erb index f1aed6d90cbc..12a281e6e3af 100644 --- a/mmv1/templates/terraform/examples/target_https_proxy_http_keep_alive_timeout.tf.erb +++ b/mmv1/templates/terraform/examples/target_https_proxy_http_keep_alive_timeout.tf.erb @@ -1,21 +1,18 @@ # [START cloudloadbalancing_target_https_proxy_http_keep_alive_timeout] resource "google_compute_target_https_proxy" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['target_https_proxy_name'] %>" - http_keep_alive_timeout_sec = 120 + http_keep_alive_timeout_sec = 610 url_map = google_compute_url_map.default.id ssl_certificates = [google_compute_ssl_certificate.default.id] } resource "google_compute_ssl_certificate" "default" { - provider = google-beta name = "<%= ctx[:vars]['ssl_certificate_name'] %>" private_key = file("path/to/private.key") certificate = file("path/to/certificate.crt") } resource "google_compute_url_map" "default" { - provider = google-beta name = "<%= ctx[:vars]['url_map_name'] %>" description = "a description" @@ -38,7 +35,6 @@ resource "google_compute_url_map" "default" { } resource "google_compute_backend_service" "default" { - provider = google-beta name = "<%= ctx[:vars]['backend_service_name'] %>" port_name = "http" protocol = "HTTP" @@ -49,7 +45,6 @@ resource "google_compute_backend_service" "default" { } resource "google_compute_http_health_check" "default" { - provider = google-beta name = "<%= ctx[:vars]['http_health_check_name'] %>" request_path = "/" check_interval_sec = 1 diff --git a/mmv1/templates/terraform/examples/vertex_ai_index.tf.erb b/mmv1/templates/terraform/examples/vertex_ai_index.tf.erb index ccdfdad0126f..1a1e90b2c329 100644 --- a/mmv1/templates/terraform/examples/vertex_ai_index.tf.erb +++ b/mmv1/templates/terraform/examples/vertex_ai_index.tf.erb @@ -27,6 +27,7 @@ resource "google_vertex_ai_index" "index" { config { dimensions = 2 approximate_neighbors_count = 150 + shard_size = "SHARD_SIZE_SMALL" distance_measure_type = "DOT_PRODUCT_DISTANCE" algorithm_config { tree_ah_config { diff --git a/mmv1/templates/terraform/examples/vertex_ai_index_streaming.tf.erb b/mmv1/templates/terraform/examples/vertex_ai_index_streaming.tf.erb index 181f3f14691a..acaf268b8254 100644 --- a/mmv1/templates/terraform/examples/vertex_ai_index_streaming.tf.erb +++ b/mmv1/templates/terraform/examples/vertex_ai_index_streaming.tf.erb @@ -26,6 +26,7 @@ resource "google_vertex_ai_index" "index" { contents_delta_uri = "gs://${google_storage_bucket.bucket.name}/contents" config { dimensions = 2 + shard_size = "SHARD_SIZE_LARGE" distance_measure_type = "COSINE_DISTANCE" feature_norm_type = "UNIT_L2_NORM" algorithm_config { diff --git a/mmv1/templates/terraform/expand_property_method.erb b/mmv1/templates/terraform/expand_property_method.erb index c4b7824d843a..d3a034e84ca2 100644 --- a/mmv1/templates/terraform/expand_property_method.erb +++ b/mmv1/templates/terraform/expand_property_method.erb @@ -160,26 +160,13 @@ func expand<%= prefix -%><%= titlelize_property(property) -%>(v interface{}, d t if raw == nil { return nil, fmt.Errorf("Invalid value for <%= property.name.underscore -%>: nil") } - f, err := <%= build_expand_resource_ref('raw.(string)', property.item_type, pwd) %> - if err != nil { - return nil, fmt.Errorf("Invalid value for <%= property.name.underscore -%>: %s", err) - } - req = append(req, f.RelativeLink()) + req = append(req, raw.(string)) } return req, nil } <% else -%> -<% if property.is_a?(Api::Type::ResourceRef) -%> - f, err := <%= build_expand_resource_ref('v.(string)', property, pwd) %> - if err != nil { - return nil, fmt.Errorf("Invalid value for <%= property.name.underscore -%>: %s", err) - } - return f.RelativeLink(), nil -} -<% else -%> return v, nil } -<% end -%> <% end # nested_properties, array of resourcerefs, else -%> <% else -%> // TODO: Property '<%= property.name -%>' of type <%= property.class -%> is not supported diff --git a/mmv1/third_party/terraform/.teamcity/.gitignore b/mmv1/third_party/terraform/.teamcity/.gitignore new file mode 100644 index 000000000000..ffac74e1ed27 --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/.gitignore @@ -0,0 +1,2 @@ +target/ +*.iml diff --git a/mmv1/third_party/terraform/.teamcity/Makefile b/mmv1/third_party/terraform/.teamcity/Makefile new file mode 100644 index 000000000000..25a2799b484a --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/Makefile @@ -0,0 +1,10 @@ +default: tools + +tools: + mvn -U dependency:sources + +test: validate + mvn test -DtestPackage=tests + +validate: + mvn teamcity-configs:generate diff --git a/mmv1/third_party/terraform/.teamcity/components/build_config_package.kt b/mmv1/third_party/terraform/.teamcity/components/build_config_package.kt new file mode 100644 index 000000000000..5214736b21be --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/components/build_config_package.kt @@ -0,0 +1,60 @@ +// this file is copied from mmv1, any changes made here will be overwritten + +import jetbrains.buildServer.configs.kotlin.* + +class packageDetails(name: String, displayName: String, environment: String) { + val packageName = name + val displayName = displayName + val environment = environment + + fun buildConfiguration(providerName : String, path : String, nightlyTestsEnabled: Boolean, startHour: Int, parallelism: Int, daysOfWeek: String, daysOfMonth: String) : BuildType { + return BuildType { + // TC needs a consistent ID for dynamically generated packages + id(uniqueID(providerName)) + + name = "%s - Acceptance Tests".format(displayName) + + vcs { + root(providerRepository) + cleanCheckout = true + } + + steps { + ConfigureGoEnv() + DownloadTerraformBinary() + // Adds steps: + // - Determine Working Directory for this Package + // - Pre-Sweeper + // - Compile Test Binary + // - Run via jen20/teamcity-go-test + // - Post-Sweeper + RunAcceptanceTests(path, packageName) + } + + failureConditions { + errorMessage = true + } + + features { + Golang() + } + + params { + TerraformAcceptanceTestParameters(parallelism, "TestAcc", "12", "us-central1", "") + TerraformAcceptanceTestsFlag() + TerraformCoreBinaryTesting() + TerraformShouldPanicForSchemaErrors() + ReadOnlySettings() + WorkingDirectory(path, packageName) + } + + triggers { + RunNightly(nightlyTestsEnabled, startHour, daysOfWeek, daysOfMonth) + } + } + } + + fun uniqueID(provider : String) : String { + return "%s_SERVICE_%s_%s".format(provider.replace("-", "").toUpperCase(), environment.toUpperCase(), packageName.toUpperCase()) + } +} diff --git a/mmv1/third_party/terraform/.teamcity/components/build_google.kt b/mmv1/third_party/terraform/.teamcity/components/build_google.kt new file mode 100644 index 000000000000..4baaddfc5225 --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/components/build_google.kt @@ -0,0 +1,38 @@ +// this file is copied from mmv1, any changes made here will be overwritten + +import jetbrains.buildServer.configs.kotlin.ParametrizedWithType + +class ClientConfiguration(var custId: String, + var org: String, + val org2 : String, + val billingAccount : String, + val billingAccount2: String, + val masterBillingAccount: String, + val credentials : String, + val project : String, + val orgDomain : String, + val projectNumber : String, + val region : String, + val serviceAccount : String, + val zone : String, + val firestoreProject : String, + val identityUser : String ) { +} + +fun ParametrizedWithType.ConfigureGoogleSpecificTestParameters(config: ClientConfiguration) { + hiddenPasswordVariable("env.GOOGLE_CUST_ID", config.custId, "The ID of the Google Identity Customer") + hiddenPasswordVariable("env.GOOGLE_ORG", config.org, "The Google Organization Id") + hiddenPasswordVariable("env.GOOGLE_ORG_2", config.org2, "The second Google Organization Id") + hiddenPasswordVariable("env.GOOGLE_BILLING_ACCOUNT", config.billingAccount, "The billing account associated with the first google organization") + hiddenPasswordVariable("env.GOOGLE_BILLING_ACCOUNT_2", config.billingAccount2, "The billing account associated with the second google organization") + hiddenPasswordVariable("env.GOOGLE_MASTER_BILLING_ACCOUNT", config.masterBillingAccount, "The master billing account") + hiddenVariable("env.GOOGLE_PROJECT", config.project, "The google project for this build") + hiddenVariable("env.GOOGLE_ORG_DOMAIN", config.orgDomain, "The org domain") + hiddenVariable("env.GOOGLE_PROJECT_NUMBER", config.projectNumber, "The project number associated with the project") + hiddenVariable("env.GOOGLE_REGION", config.region, "The google region to use") + hiddenVariable("env.GOOGLE_SERVICE_ACCOUNT", config.serviceAccount, "The service account") + hiddenVariable("env.GOOGLE_ZONE", config.zone, "The google zone to use") + hiddenVariable("env.GOOGLE_FIRESTORE_PROJECT", config.firestoreProject, "The project to use for firestore") + hiddenVariable("env.GOOGLE_IDENTITY_USER", config.identityUser, "The user for the identity platform") + hiddenPasswordVariable("env.GOOGLE_CREDENTIALS", config.credentials, "The Google credentials for this test runner") +} \ No newline at end of file diff --git a/mmv1/third_party/terraform/.teamcity/components/generated/build_components.erb b/mmv1/third_party/terraform/.teamcity/components/generated/build_components.erb new file mode 100644 index 000000000000..2539ba3970e3 --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/components/generated/build_components.erb @@ -0,0 +1,137 @@ +<% autogen_exception -%> +// this file is auto-generated with mmv1, any changes made here will be overwritten + +import jetbrains.buildServer.configs.kotlin.* +import jetbrains.buildServer.configs.kotlin.buildFeatures.GolangFeature +import jetbrains.buildServer.configs.kotlin.buildSteps.ScriptBuildStep +import jetbrains.buildServer.configs.kotlin.triggers.schedule + +// NOTE: in time this could be pulled out into a separate Kotlin package + +// The native Go test runner (which TeamCity shells out to) will fail +// the entire test suite when a single test panics, which isn't ideal. +// +// Until that changes, we'll continue to use `teamcity-go-test` to run +// each test individually +const val useTeamCityGoTest = false + +fun BuildFeatures.Golang() { + if (useTeamCityGoTest) { + feature(GolangFeature { + testFormat = "json" + }) + } +} + +fun BuildSteps.ConfigureGoEnv() { + step(ScriptBuildStep { + name = "Configure Go Version" + scriptContent = "goenv install -s \$(goenv local) && goenv rehash" + }) +} + +fun BuildSteps.DownloadTerraformBinary() { + // https://releases.hashicorp.com/terraform/0.12.28/terraform_0.12.28_linux_amd64.zip + var terraformUrl = "https://releases.hashicorp.com/terraform/%env.TERRAFORM_CORE_VERSION%/terraform_%env.TERRAFORM_CORE_VERSION%_linux_amd64.zip" + step(ScriptBuildStep { + name = "Download Terraform Core v%env.TERRAFORM_CORE_VERSION%.." + scriptContent = "mkdir -p tools && wget -O tf.zip %s && unzip tf.zip && mv terraform tools/".format(terraformUrl) + }) +} + +fun servicePath(path : String, packageName: String) : String { + return "./%s/%s".format(path, packageName) +} + +fun BuildSteps.RunAcceptanceTests(path : String, packageName: String) { + var packagePath = servicePath(path, packageName) + var withTestsDirectoryPath = "##teamcity[setParameter name='PACKAGE_PATH' value='%s/tests']".format(packagePath) + + // some packages use a ./tests folder, others don't - conditionally append that if needed + step(ScriptBuildStep { + name = "Determine Working Directory for this Package" + scriptContent = "if [ -d \"%s/tests\" ]; then echo \"%s\"; fi".format(packagePath, withTestsDirectoryPath) + }) + + step(ScriptBuildStep{ + name = "Pre-Sweeper" + scriptContent = "go test -v \"%PACKAGE_PATH%\" -sweep=\"%SWEEPER_REGIONS%\" -sweep-allow-failures -sweep-run=\"%SWEEP_RUN%\" -timeout 30m" + }) + + if (useTeamCityGoTest) { + step(ScriptBuildStep { + name = "Run Tests" + scriptContent = "go test -v \"%PACKAGE_PATH%\" -timeout=\"%TIMEOUT%h\" -test.parallel=\"%PARALLELISM%\" -run=\"%TEST_PREFIX%\" -json" + }) + } else { + step(ScriptBuildStep { + name = "Compile Test Binary" + scriptContent = "go test -c -o test-binary" + workingDir = "%PACKAGE_PATH%" + }) + + step(ScriptBuildStep { + // ./test-binary -test.list=TestAccComputeRegionDisk_ | teamcity-go-test -test ./test-binary -timeout 1s + name = "Run via jen20/teamcity-go-test" + scriptContent = "./test-binary -test.list=\"%TEST_PREFIX%\" | teamcity-go-test -test ./test-binary -parallelism \"%PARALLELISM%\" -timeout \"%TIMEOUT%h\"" + workingDir = "%PACKAGE_PATH%" + }) + } + + step(ScriptBuildStep{ + name = "Post-Sweeper" + scriptContent = "go test -v \"%PACKAGE_PATH%\" -sweep=\"%SWEEPER_REGIONS%\" -sweep-allow-failures -sweep-run=\"%SWEEP_RUN%\" -timeout 30m" + }) +} + +fun ParametrizedWithType.TerraformAcceptanceTestParameters(parallelism : Int, prefix : String, timeout: String, sweeperRegions: String, sweepRun: String) { + text("PARALLELISM", "%d".format(parallelism)) + text("TEST_PREFIX", prefix) + text("TIMEOUT", timeout) + text("SWEEPER_REGIONS", sweeperRegions) + text("SWEEP_RUN", sweepRun) +} + +fun ParametrizedWithType.ReadOnlySettings() { + hiddenVariable("teamcity.ui.settings.readOnly", "true", "Requires build configurations be edited via Kotlin") +} + +fun ParametrizedWithType.TerraformAcceptanceTestsFlag() { + hiddenVariable("env.TF_ACC", "1", "Set to a value to run the Acceptance Tests") +} + +fun ParametrizedWithType.TerraformCoreBinaryTesting() { + text("env.TERRAFORM_CORE_VERSION", defaultTerraformCoreVersion, "The version of Terraform Core which should be used for testing") + hiddenVariable("env.TF_ACC_TERRAFORM_PATH", "%system.teamcity.build.checkoutDir%/tools/terraform", "The path where the Terraform Binary is located") +} + +fun ParametrizedWithType.TerraformShouldPanicForSchemaErrors() { + hiddenVariable("env.TF_SCHEMA_PANIC_ON_ERROR", "1", "Panic if unknown/unmatched fields are set into the state") +} + +fun ParametrizedWithType.WorkingDirectory(path : String, packageName: String) { + text("PACKAGE_PATH", servicePath(path, packageName), "", "The path at which to run - automatically updated", ParameterDisplay.HIDDEN) +} + +fun ParametrizedWithType.hiddenVariable(name: String, value: String, description: String) { + text(name, value, "", description, ParameterDisplay.HIDDEN) +} + +fun ParametrizedWithType.hiddenPasswordVariable(name: String, value: String, description: String) { + password(name, value, "", description, ParameterDisplay.HIDDEN) +} + +fun Triggers.RunNightly(nightlyTestsEnabled: Boolean, startHour: Int, daysOfWeek: String, daysOfMonth: String) { + schedule{ + enabled = nightlyTestsEnabled + branchFilter = "+:refs/heads/main" + + schedulingPolicy = cron { + hours = startHour.toString() + timezone = "SERVER" + + dayOfWeek = daysOfWeek + dayOfMonth = daysOfMonth + } + } +} diff --git a/mmv1/third_party/terraform/.teamcity/components/generated/project.erb b/mmv1/third_party/terraform/.teamcity/components/generated/project.erb new file mode 100644 index 000000000000..a1eb8701e37e --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/components/generated/project.erb @@ -0,0 +1,47 @@ +<% autogen_exception -%> +// this file is auto-generated with mmv1, any changes made here will be overwritten + +import jetbrains.buildServer.configs.kotlin.BuildType +import jetbrains.buildServer.configs.kotlin.Project + +const val providerName = "google<%= "-" + version unless version == 'ga' -%>" + +fun Google<%= version.capitalize unless version == 'ga' -%>(environment: String, configuration : ClientConfiguration) : Project { + return Project{ + vcsRoot(providerRepository) + + var buildConfigs = buildConfigurationsForPackages(packages, providerName, "google<%= "-" + version unless version == 'ga' -%>", environment, configuration) + buildConfigs.forEach { buildConfiguration -> + buildType(buildConfiguration) + } + } +} + +fun buildConfigurationsForPackages(packages: Map, providerName : String, path : String, environment: String, config : ClientConfiguration): List { + var list = ArrayList() + + packages.forEach { (packageName, displayName) -> + if (packageName == "services") { + var serviceList = buildConfigurationsForPackages(services, providerName, path+"/"+packageName, environment, config) + list.addAll(serviceList) + } else { + var defaultTestConfig = testConfiguration() + + var pkg = packageDetails(packageName, displayName, environment) + var buildConfig = pkg.buildConfiguration(providerName, path, true, defaultTestConfig.startHour, defaultTestConfig.parallelism, defaultTestConfig.daysOfWeek, defaultTestConfig.daysOfMonth) + + buildConfig.params.ConfigureGoogleSpecificTestParameters(config) + + list.add(buildConfig) + } + } + + return list +} + +class testConfiguration(parallelism: Int = defaultParallelism, startHour: Int = defaultStartHour, daysOfWeek: String = defaultDaysOfWeek, daysOfMonth: String = defaultDaysOfMonth) { + var parallelism = parallelism + var startHour = startHour + var daysOfWeek = daysOfWeek + var daysOfMonth = daysOfMonth +} \ No newline at end of file diff --git a/mmv1/third_party/terraform/.teamcity/components/generated/services.erb b/mmv1/third_party/terraform/.teamcity/components/generated/services.erb new file mode 100644 index 000000000000..f98a9fef637f --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/components/generated/services.erb @@ -0,0 +1,15 @@ +<% autogen_exception -%> +// this file is auto-generated with mmv1, any changes made here will be overwritten +<% + service_names = [] + version_string = "-" + version unless version == 'ga' + Dir["google#{version_string}/services/**"].each do |service| + service_names.push service.split('/')[-1] + end +-%> + +var services = mapOf( +<% service_names.each_with_index do |service, i| -%> + "<%= service -%>" to "<%= service.space_separated -%>"<%= ',' if i < (service_names.size - 1) %> +<% end -%> +) \ No newline at end of file diff --git a/mmv1/third_party/terraform/.teamcity/components/generated/vcs_root.erb b/mmv1/third_party/terraform/.teamcity/components/generated/vcs_root.erb new file mode 100644 index 000000000000..ff485939eb59 --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/components/generated/vcs_root.erb @@ -0,0 +1,14 @@ +<% autogen_exception -%> +// this file is auto-generated with mmv1, any changes made here will be overwritten + +import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot + +object providerRepository : GitVcsRoot({ + name = "terraform-provider-google<%= "-" + version unless version == 'ga' -%>" + url = "https://github.com/hashicorp/terraform-provider-google<%= "-" + version unless version == 'ga' -%>.git" + agentCleanPolicy = AgentCleanPolicy.ON_BRANCH_CHANGE + agentCleanFilesPolicy = AgentCleanFilesPolicy.ALL_UNTRACKED + branchSpec = "+:*" + branch = "refs/heads/main" + authMethod = anonymous() +}) diff --git a/mmv1/third_party/terraform/.teamcity/components/packages.kt b/mmv1/third_party/terraform/.teamcity/components/packages.kt new file mode 100644 index 000000000000..c1355e359852 --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/components/packages.kt @@ -0,0 +1,11 @@ +// this file is copied from mmv1, any changes made here will be overwritten + +var packages = mapOf( + "acctest" to "AccTest", + "services" to "Services", + "tpgdclresource" to "TPG DCL Resource", + "tpgiamresource" to "TPG IAM Resource", + "tpgresource" to "TPG Resource", + "transport" to "Transport", + "verify" to "Verify" +) \ No newline at end of file diff --git a/mmv1/third_party/terraform/.teamcity/components/settings.kt b/mmv1/third_party/terraform/.teamcity/components/settings.kt new file mode 100644 index 000000000000..44f98ded7b4d --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/components/settings.kt @@ -0,0 +1,16 @@ +// this file is copied from mmv1, any changes made here will be overwritten + +// specifies the default hour (UTC) at which tests should be triggered, if enabled +var defaultStartHour = 4 + +// specifies the default level of parallelism per-service-package +var defaultParallelism = 12 + +// specifies the default version of Terraform Core which should be used for testing +var defaultTerraformCoreVersion = "1.2.5" + +// This represents a cron view of days of the week, Monday - Friday. +const val defaultDaysOfWeek = "*" + +// Cron value for any day of month +const val defaultDaysOfMonth = "*" diff --git a/mmv1/third_party/terraform/.teamcity/generated/pom.xml.erb b/mmv1/third_party/terraform/.teamcity/generated/pom.xml.erb new file mode 100644 index 000000000000..640a4a7f7530 --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/generated/pom.xml.erb @@ -0,0 +1,138 @@ +<% autogen_exception -%> + + + + + 4.0.0 + Terraform-Provider-Google<%= version.capitalize unless version == 'ga' -%> Config DSL Script + TerraformProviderGoogle<%= version.capitalize unless version == 'ga' -%> + TerraformProviderGoogle<%= version.capitalize unless version == 'ga' -%> + 1.0-SNAPSHOT + + + org.jetbrains.teamcity + configs-dsl-kotlin-parent + 1.0-SNAPSHOT + + + + + jetbrains-all + https://download.jetbrains.com/teamcity-repository + + true + + + + teamcity-server + https://teamcity.jetbrains.com/app/dsl-plugins-repository + + true + + + + + + + JetBrains + https://download.jetbrains.com/teamcity-repository + + + + + tests + components + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + tests/*.class + + + + + compile + process-sources + + test + + + + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + + + compile + process-sources + + compile + + + + test-compile + process-test-sources + + test-compile + + + + + + org.jetbrains.teamcity + teamcity-configs-maven-plugin + ${teamcity.dsl.version} + + kotlin + target/generated-configs + + public + + + + + + + + + org.jetbrains.teamcity + configs-dsl-kotlin-latest + ${teamcity.dsl.version} + compile + + + org.jetbrains.teamcity + configs-dsl-kotlin-plugins-latest + 1.0-SNAPSHOT + pom + compile + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + compile + + + junit + junit + 4.13.2 + + + org.jetbrains.kotlin + kotlin-script-runtime + ${kotlin.version} + compile + + + \ No newline at end of file diff --git a/mmv1/third_party/terraform/.teamcity/generated/settings.kts.erb b/mmv1/third_party/terraform/.teamcity/generated/settings.kts.erb new file mode 100644 index 000000000000..113c8a9b3a28 --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/generated/settings.kts.erb @@ -0,0 +1,30 @@ +<% autogen_exception -%> +// this file is auto-generated with mmv1, any changes made here will be overwritten + +import Google<%= version.capitalize unless version == 'ga' -%> + +import ClientConfiguration +import jetbrains.buildServer.configs.kotlin.* + +version = "2023.05" + +var custId = DslContext.getParameter("custId", "") +var org = DslContext.getParameter("org", "") +var org2 = DslContext.getParameter("org2", "") +var billingAccount = DslContext.getParameter("billingAccount", "") +var billingAccount2 = DslContext.getParameter("billingAccount2", "") +var masterBillingAccount = DslContext.getParameter("masterBillingAccount", "") +var project = DslContext.getParameter("project", "") +var orgDomain = DslContext.getParameter("orgDomain", "") +var projectNumber = DslContext.getParameter("projectNumber", "") +var region = DslContext.getParameter("region", "") +var serviceAccount = DslContext.getParameter("serviceAccount", "") +var zone = DslContext.getParameter("zone", "") +var credentials = DslContext.getParameter("credentials", "") +var environment = DslContext.getParameter("environment", "public") +var firestoreProject = DslContext.getParameter("firestoreProject", "") +var identityUser = DslContext.getParameter("identityUser", "") + +var clientConfig = ClientConfiguration(custId, org, org2, billingAccount, billingAccount2, masterBillingAccount, credentials, project, orgDomain, projectNumber, region, serviceAccount, zone, firestoreProject, identityUser) + +project(Google<%= version.capitalize unless version == 'ga' -%>(environment, clientConfig)) diff --git a/mmv1/third_party/terraform/.teamcity/tests/generated/configuration.erb b/mmv1/third_party/terraform/.teamcity/tests/generated/configuration.erb new file mode 100644 index 000000000000..75385974852e --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/tests/generated/configuration.erb @@ -0,0 +1,51 @@ +<% autogen_exception -%> +// this file is auto-generated with mmv1, any changes made here will be overwritten + +package tests + +import Google<%= version.capitalize unless version == 'ga' -%> + +import org.junit.Assert.assertTrue +import org.junit.Test +import useTeamCityGoTest + +class ConfigurationTests { + @Test + fun buildShouldFailOnError() { + val project = Google<%= version.capitalize unless version == 'ga' -%>("public", TestConfiguration()) + project.buildTypes.forEach { bt -> + assertTrue("Build '${bt.id}' should fail on errors!", bt.failureConditions.errorMessage) + } + } + + @Test + fun buildShouldHaveGoTestFeature() { + val project = Google<%= version.capitalize unless version == 'ga' -%>("public", TestConfiguration()) + project.buildTypes.forEach{ bt -> + var exists = false + bt.features.items.forEach { f -> + if (f.type == "golang") { + exists = true + } + } + + if (useTeamCityGoTest) { + assertTrue("Build %s doesn't have Go Test Json enabled".format(bt.name), exists) + } + } + } + + @Test + fun buildShouldHaveTrigger() { + val project = Google<%= version.capitalize unless version == 'ga' -%>("public", TestConfiguration()) + var exists = false + project.buildTypes.forEach{ bt -> + bt.triggers.items.forEach { t -> + if (t.type == "schedulingTrigger") { + exists = true + } + } + } + assertTrue("The Build Configuration should have a Trigger", exists) + } +} diff --git a/mmv1/third_party/terraform/.teamcity/tests/generated/vcs_roots.erb b/mmv1/third_party/terraform/.teamcity/tests/generated/vcs_roots.erb new file mode 100644 index 000000000000..ac315f6209ba --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/tests/generated/vcs_roots.erb @@ -0,0 +1,19 @@ +<% autogen_exception -%> +// this file is auto-generated with mmv1, any changes made here will be overwritten + +package tests + +import Google<%= version.capitalize unless version == 'ga' -%> + +import org.junit.Assert.assertTrue +import org.junit.Test + +class VcsTests { + @Test + fun buildsHaveCleanCheckOut() { + val project = Google<%= version.capitalize unless version == 'ga' -%>("public", TestConfiguration()) + project.buildTypes.forEach { bt -> + assertTrue("Build '${bt.id}' doesn't use clean checkout", bt.vcs.cleanCheckout) + } + } +} diff --git a/mmv1/third_party/terraform/.teamcity/tests/helpers.kt b/mmv1/third_party/terraform/.teamcity/tests/helpers.kt new file mode 100644 index 000000000000..390493a68d06 --- /dev/null +++ b/mmv1/third_party/terraform/.teamcity/tests/helpers.kt @@ -0,0 +1,9 @@ +// this file is copied from mmv1, any changes made here will be overwritten + +package tests + +import ClientConfiguration + +fun TestConfiguration() : ClientConfiguration { + return ClientConfiguration("custId", "org", "org2", "billingAccount", "billingAccount2", "masterBillingAccount", "credentials", "project", "orgDomain", "projectNumber", "region", "serviceAccount", "zone", "firestoreProject", "identityUser") +} \ No newline at end of file diff --git a/mmv1/third_party/terraform/go.mod.erb b/mmv1/third_party/terraform/go.mod.erb index 592b44785bf7..e68b08a54e99 100644 --- a/mmv1/third_party/terraform/go.mod.erb +++ b/mmv1/third_party/terraform/go.mod.erb @@ -4,7 +4,7 @@ module github.com/hashicorp/terraform-provider-google<%= "-" + version unless ve go 1.19 require ( - cloud.google.com/go/bigtable v1.17.0 + cloud.google.com/go/bigtable v1.19.0 github.com/GoogleCloudPlatform/declarative-resource-client-library v1.44.0 github.com/apparentlymart/go-cidr v1.1.0 github.com/davecgh/go-spew v1.1.1 @@ -25,30 +25,30 @@ require ( github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/hashstructure v1.1.0 github.com/sirupsen/logrus v1.8.1 - golang.org/x/net v0.10.0 - golang.org/x/oauth2 v0.8.0 - google.golang.org/api v0.128.0 - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc - google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 + golang.org/x/net v0.12.0 + golang.org/x/oauth2 v0.9.0 + google.golang.org/api v0.130.0 + google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529 + google.golang.org/grpc v1.56.1 + google.golang.org/protobuf v1.31.0 ) require ( bitbucket.org/creachadair/stringset v0.0.8 // indirect - cloud.google.com/go v0.110.0 // indirect + cloud.google.com/go v0.110.2 // indirect cloud.google.com/go/compute v1.19.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v0.13.0 // indirect - cloud.google.com/go/longrunning v0.4.1 // indirect + cloud.google.com/go/iam v1.1.0 // indirect + cloud.google.com/go/longrunning v0.5.0 // indirect github.com/agext/levenshtein v1.2.2 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe // indirect - github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195 // indirect - github.com/envoyproxy/go-control-plane v0.11.0 // indirect - github.com/envoyproxy/protoc-gen-validate v0.10.0 // indirect + github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 // indirect + github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f // indirect + github.com/envoyproxy/protoc-gen-validate v0.10.1 // indirect github.com/fatih/color v1.13.0 // indirect github.com/gammazero/deque v0.0.0-20180920172122-f6adf94963e4 // indirect github.com/golang/glog v1.1.0 // indirect @@ -58,8 +58,8 @@ require ( github.com/google/go-cpy v0.0.0-20211218193943-a9c933c06932 // indirect github.com/google/s2a-go v0.1.4 // indirect github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect - github.com/googleapis/gax-go/v2 v2.10.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect + github.com/googleapis/gax-go/v2 v2.11.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-hclog v1.2.1 // indirect github.com/hashicorp/go-plugin v1.4.8 // indirect @@ -86,9 +86,9 @@ require ( github.com/vmihailenco/tagparser v0.1.2 // indirect github.com/zclconf/go-cty v1.11.0 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/crypto v0.11.0 // indirect + golang.org/x/sys v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect diff --git a/mmv1/third_party/terraform/go.sum b/mmv1/third_party/terraform/go.sum index 5a92ab6038cc..354f87c17e2e 100644 --- a/mmv1/third_party/terraform/go.sum +++ b/mmv1/third_party/terraform/go.sum @@ -4,16 +4,22 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= -cloud.google.com/go/bigtable v1.17.0 h1:8t48YTxxFsYKy+AWuHdoePgAr4J2gEtntbdWclbEbco= -cloud.google.com/go/bigtable v1.17.0/go.mod h1:wtf7lFV1Wa5ay6aKa/gv/T2Ci7J6qXpBX8Ofij2z5mo= +cloud.google.com/go v0.110.2 h1:sdFPBr6xG9/wkBbfhmUz/JmZC7X6LavQgcrVINrKiVA= +cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= +cloud.google.com/go/bigtable v1.19.0 h1:wiq9LT0kukfInzvy1joMDijCw/OD1UChpSbORXYn0LI= +cloud.google.com/go/bigtable v1.19.0/go.mod h1:xl5kPa8PTkJjdBxg6qdGH88464nNqmbISHSRU+D2yFE= cloud.google.com/go/compute v1.19.3 h1:DcTwsFgGev/wV5+q8o2fzgcHOaac+DKGC91ZlvpsQds= cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iam v1.1.0 h1:67gSqaPukx7O8WLLHMa0PNs3EBGd2eE4d+psbO/CO94= +cloud.google.com/go/iam v1.1.0/go.mod h1:nxdHjaKfCr7fNYx/HJMM8LgiMugmveWlkatear5gVyk= cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= +cloud.google.com/go/longrunning v0.5.0 h1:DK8BH0+hS+DIvc9a2TPnteUievsTCH4ORMAASSb7JcQ= +cloud.google.com/go/longrunning v0.5.0/go.mod h1:0JNuqRShmscVAhIACGtskSAWtqtOoPkwP0YF1oVEchc= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/GoogleCloudPlatform/declarative-resource-client-library v1.44.0 h1:hASUAck0/5j84kejIHGJjipjUzFHiN5edNMobKwj2HA= github.com/GoogleCloudPlatform/declarative-resource-client-library v1.44.0/go.mod h1:pL2Qt5HT+x6xrTd806oMiM3awW6kNIXB/iiuClz6m6k= @@ -53,8 +59,8 @@ github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XP github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195 h1:58f1tJ1ra+zFINPlwLWvQsR9CzAKt2e+EWV2yX9oXQ4= -github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creachadair/staticfile v0.1.2/go.mod h1:a3qySzCIXEprDGxk6tSxSI+dBBdLzqeBOMhZ+o2d3pM= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -69,11 +75,11 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.11.0 h1:jtLewhRR2vMRNnq2ZZUoCjUlgut+Y0+sDDWPOfwOi1o= -github.com/envoyproxy/go-control-plane v0.11.0/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI= +github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f h1:7T++XKzy4xg7PKy+bM+Sa9/oe1OC88yz2hXQUISoXfA= +github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.10.0 h1:oIfnZFdC0YhpNNEX+SuIqko4cqqVZeN9IGTrhZje83Y= -github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= +github.com/envoyproxy/protoc-gen-validate v0.10.1 h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8= +github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= @@ -140,12 +146,12 @@ github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkj github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/enterprise-certificate-proxy v0.2.4 h1:uGy6JWR/uMIILU8wbf+OkstIrNiMjGpEIyhx8f6W7s4= -github.com/googleapis/enterprise-certificate-proxy v0.2.4/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/gax-go/v2 v2.10.0 h1:ebSgKfMxynOdxw8QQuFOKMgomqeLGPqNLQox2bo42zg= -github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw= +github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM= +github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w= +github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= +github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= +github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= +github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -200,6 +206,7 @@ github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKL github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= @@ -260,6 +267,7 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -272,8 +280,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= @@ -308,12 +316,13 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -337,13 +346,13 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs= +golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -351,7 +360,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -376,11 +385,11 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -388,8 +397,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -405,10 +414,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/api v0.125.0 h1:7xGvEY4fyWbhWMHf3R2/4w7L4fXyfpRGE9g6lp8+DCk= -google.golang.org/api v0.125.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= -google.golang.org/api v0.128.0 h1:RjPESny5CnQRn9V6siglged+DZCgfu9l6mO9dkX9VOg= -google.golang.org/api v0.128.0/go.mod h1:Y611qgqaE92On/7g65MQgxYul3c0rEB894kniWLY750= +google.golang.org/api v0.130.0 h1:A50ujooa1h9iizvfzA4rrJr2B7uRmWexwbekQ2+5FPQ= +google.golang.org/api v0.130.0/go.mod h1:J/LCJMYSDFvAVREGCbrESb53n4++NMBDetSHGL5I5RY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -423,8 +430,8 @@ google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdL google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:kVKPf/IiYSBWEWtkIn6wZXwWGCnLKcC8oWfZvXjsGnM= google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529 h1:DEH99RbiLZhMxrpEJCZ0A+wdTe0EOgou/poSLx9vWf4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -434,8 +441,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= +google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -447,8 +454,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -469,3 +476,4 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go b/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go index a91dc70c2ad1..e8cac881fc55 100644 --- a/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go +++ b/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go @@ -442,7 +442,7 @@ func ResourceBigQueryTable() *schema.Resource { // SourceFormat [Required] The data format. "source_format": { Type: schema.TypeString, - Required: true, + Optional: true, Description: ` Please see sourceFormat under ExternalDataConfiguration in Bigquery's public API documentation (https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#externaldataconfiguration) for supported formats. To use "GOOGLE_SHEETS" the scopes must include "googleapis.com/auth/drive.readonly".`, ValidateFunc: validation.StringInSlice([]string{ "CSV", "GOOGLE_SHEETS", "NEWLINE_DELIMITED_JSON", "AVRO", "ICEBERG", "DATASTORE_BACKUP", "PARQUET", "ORC", "BIGTABLE", @@ -658,6 +658,18 @@ func ResourceBigQueryTable() *schema.Resource { Optional: true, Description: `When creating an external table, the user can provide a reference file with the table schema. This is enabled for the following formats: AVRO, PARQUET, ORC.`, }, + "metadata_cache_mode": { + Type: schema.TypeString, + Optional: true, + Description: `Metadata Cache Mode for the table. Set this to enable caching of metadata from external data source.`, + ValidateFunc: validation.StringInSlice([]string{"AUTOMATIC", "MANUAL"}, false), + }, + "object_metadata": { + Type: schema.TypeString, + Optional: true, + Description: `Object Metadata is used to create Object Tables. Object Tables contain a listing of objects (with their metadata) found at the sourceUris. If ObjectMetadata is set, sourceFormat should be omitted.`, + ConflictsWith: []string{"external_data_configuration.0.source_format"}, + }, }, }, }, @@ -1392,6 +1404,12 @@ func expandExternalDataConfiguration(cfg interface{}) (*bigquery.ExternalDataCon if v, ok := raw["reference_file_schema_uri"]; ok { edc.ReferenceFileSchemaUri = v.(string) } + if v, ok := raw["metadata_cache_mode"]; ok { + edc.MetadataCacheMode = v.(string) + } + if v, ok := raw["object_metadata"]; ok { + edc.ObjectMetadata = v.(string) + } return edc, nil @@ -1441,6 +1459,13 @@ func flattenExternalDataConfiguration(edc *bigquery.ExternalDataConfiguration) ( if edc.ReferenceFileSchemaUri != "" { result["reference_file_schema_uri"] = edc.ReferenceFileSchemaUri } + if edc.MetadataCacheMode != "" { + result["metadata_cache_mode"] = edc.MetadataCacheMode + } + + if edc.ObjectMetadata != "" { + result["object_metadata"] = edc.ObjectMetadata + } return []map[string]interface{}{result}, nil } diff --git a/mmv1/third_party/terraform/services/bigtable/resource_bigtable_table.go b/mmv1/third_party/terraform/services/bigtable/resource_bigtable_table.go index bb4cd7e85324..64df024e5b49 100644 --- a/mmv1/third_party/terraform/services/bigtable/resource_bigtable_table.go +++ b/mmv1/third_party/terraform/services/bigtable/resource_bigtable_table.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-provider-google/google/tpgresource" transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" + "github.com/hashicorp/terraform-provider-google/google/verify" ) func ResourceBigtableTable() *schema.Resource { @@ -90,6 +91,14 @@ func ResourceBigtableTable() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, Description: `A field to make the table protected against data loss i.e. when set to PROTECTED, deleting the table, the column families in the table, and the instance containing the table would be prohibited. If not provided, currently deletion protection will be set to UNPROTECTED as it is the API default value.`, }, + + "change_stream_retention": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: verify.ValidateDuration(), + Description: `Duration to retain change stream data for the table. Set to 0 to disable.`, + }, }, UseJSONNumber: true, } @@ -132,6 +141,13 @@ func resourceBigtableTableCreate(d *schema.ResourceData, meta interface{}) error tblConf.DeletionProtection = bigtable.Unprotected } + if changeStreamRetention, ok := d.GetOk("change_stream_retention"); ok { + tblConf.ChangeStreamRetention, err = time.ParseDuration(changeStreamRetention.(string)) + if err != nil { + return fmt.Errorf("Error parsing change stream retention: %s", err) + } + } + // Set the split keys if given. if v, ok := d.GetOk("split_keys"); ok { tblConf.SplitKeys = tpgresource.ConvertStringArr(v.([]interface{})) @@ -223,6 +239,14 @@ func resourceBigtableTableRead(d *schema.ResourceData, meta interface{}) error { } else { return fmt.Errorf("Error setting deletion_protection, it should be either PROTECTED or UNPROTECTED") } + + changeStreamRetention := table.ChangeStreamRetention + if changeStreamRetention != nil { + if err := d.Set("change_stream_retention", changeStreamRetention.(time.Duration).String()); err != nil { + return fmt.Errorf("Error setting change_stream_retention: %s", err) + } + } + return nil } @@ -290,6 +314,23 @@ func resourceBigtableTableUpdate(d *schema.ResourceData, meta interface{}) error } } + if d.HasChange("change_stream_retention") { + changeStreamRetention := d.Get("change_stream_retention") + changeStream, err := time.ParseDuration(changeStreamRetention.(string)) + if err != nil { + return fmt.Errorf("Error parsing change stream retention: %s", err) + } + if changeStream == 0 { + if err := c.UpdateTableDisableChangeStream(ctxWithTimeout, name); err != nil { + return fmt.Errorf("Error disabling change stream retention in table %v: %s", name, err) + } + } else { + if err := c.UpdateTableWithChangeStream(ctxWithTimeout, name, changeStream); err != nil { + return fmt.Errorf("Error updating change stream retention in table %v: %s", name, err) + } + } + } + return resourceBigtableTableRead(d, meta) } diff --git a/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb b/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb index f46444945d0b..366d559ae162 100644 --- a/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb +++ b/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb @@ -1127,12 +1127,11 @@ func ResourceContainerCluster() *schema.Resource { Schema: map[string]*schema.Schema{ "enable_components": { Type: schema.TypeList, + Optional: true, + Computed: true, <% if version == "ga" -%> - Required: true, Description: `GKE components exposing metrics. Valid values include SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, and SCHEDULER.`, <% else -%> - Optional: true, - Computed: true, Description: `GKE components exposing metrics. Valid values include SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS.`, <% end -%> Elem: &schema.Schema{ diff --git a/mmv1/third_party/terraform/services/container/resource_container_node_pool.go.erb b/mmv1/third_party/terraform/services/container/resource_container_node_pool.go.erb index 4f473ee28778..92d26e90ce66 100644 --- a/mmv1/third_party/terraform/services/container/resource_container_node_pool.go.erb +++ b/mmv1/third_party/terraform/services/container/resource_container_node_pool.go.erb @@ -191,6 +191,13 @@ var schemaNodePool = map[string]*schema.Schema{ Required: true, Description: `Type defines the type of placement policy`, }, +<% unless version == 'ga' -%> + "tpu_topology": { + Type: schema.TypeString, + Optional: true, + Description: `TPU placement topology for pod slice node pool. https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies`, + }, +<% end -%> }, }, }, @@ -877,6 +884,9 @@ func expandNodePool(d *schema.ResourceData, prefix string) (*container.NodePool, placement_policy := v.([]interface{})[0].(map[string]interface{}) np.PlacementPolicy = &container.PlacementPolicy{ Type: placement_policy["type"].(string), +<% unless version == 'ga' -%> + TpuTopology: placement_policy["tpu_topology"].(string), +<% end -%> } } } @@ -1068,6 +1078,9 @@ func flattenNodePool(d *schema.ResourceData, config *transport_tpg.Config, np *c nodePool["placement_policy"] = []map[string]interface{}{ { "type": np.PlacementPolicy.Type, +<% unless version == 'ga' -%> + "tpu_topology": np.PlacementPolicy.TpuTopology, +<% end -%> }, } } diff --git a/mmv1/third_party/terraform/services/networksecurity/network_security_address_group_operation.go.erb b/mmv1/third_party/terraform/services/networksecurity/network_security_address_group_operation.go.erb index 3c9a27568db8..2f98e9be1803 100644 --- a/mmv1/third_party/terraform/services/networksecurity/network_security_address_group_operation.go.erb +++ b/mmv1/third_party/terraform/services/networksecurity/network_security_address_group_operation.go.erb @@ -1,6 +1,5 @@ <% autogen_exception -%> package networksecurity -<% unless version == 'ga' -%> import ( "time" @@ -13,4 +12,3 @@ func NetworkSecurityAddressGroupOperationWaitTime(config *transport_tpg.Config, // project is not necessary for this operation. return NetworkSecurityOperationWaitTime(config, op, "", activity, userAgent, timeout) } -<% end -%> diff --git a/mmv1/third_party/terraform/services/osconfig/resource_os_config_os_policy_assignment.go b/mmv1/third_party/terraform/services/osconfig/resource_os_config_os_policy_assignment.go index ea21d3cf6b31..c3e8e143c89d 100644 --- a/mmv1/third_party/terraform/services/osconfig/resource_os_config_os_policy_assignment.go +++ b/mmv1/third_party/terraform/services/osconfig/resource_os_config_os_policy_assignment.go @@ -379,8 +379,8 @@ Remote: A checksum must be specified. Cloud Storage: An object generation number "state": { Type: schema.TypeString, Required: true, - ValidateFunc: verify.ValidateEnum([]string{"OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED", "COMPLIANT", "NON_COMPLIANT", "UNKNOWN", "NO_OS_POLICIES_APPLICABLE"}), - Description: `Desired state of the file. Possible values: ["OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED", "COMPLIANT", "NON_COMPLIANT", "UNKNOWN", "NO_OS_POLICIES_APPLICABLE"]`, + ValidateFunc: verify.ValidateEnum([]string{"DESIRED_STATE_UNSPECIFIED", "PRESENT", "ABSENT", "CONTENTS_MATCH"}), + Description: `Desired state of the file. Possible values: ["DESIRED_STATE_UNSPECIFIED", "PRESENT", "ABSENT", "CONTENTS_MATCH"]`, }, "content": { Type: schema.TypeString, diff --git a/mmv1/third_party/terraform/services/sql/resource_sql_database_instance.go.erb b/mmv1/third_party/terraform/services/sql/resource_sql_database_instance.go.erb index c2dd85ca7405..24b5485e9b7d 100644 --- a/mmv1/third_party/terraform/services/sql/resource_sql_database_instance.go.erb +++ b/mmv1/third_party/terraform/services/sql/resource_sql_database_instance.go.erb @@ -157,6 +157,12 @@ func ResourceSqlDatabaseInstance() *schema.Resource { Required: true, Description: `The machine type to use. See tiers for more details and supported versions. Postgres supports only shared-core machine types, and custom machine types such as db-custom-2-13312. See the Custom Machine Type Documentation to learn about specifying custom machine types.`, }, + "edition": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringInSlice([]string{"ENTERPRISE", "ENTERPRISE_PLUS"}, false), + Description: `The edition of the instance, can be ENTERPRISE or ENTERPRISE_PLUS.`, + }, "advanced_machine_features": { Type: schema.TypeList, Optional: true, @@ -171,6 +177,22 @@ func ResourceSqlDatabaseInstance() *schema.Resource { }, }, }, + "data_cache_config": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: `Data cache configurations.`, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "data_cache_enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: `Whether data cache is enabled for the instance.`, + }, + }, + }, + }, "activation_policy": { Type: schema.TypeString, Optional: true, @@ -1186,7 +1208,9 @@ func expandSqlDatabaseInstanceSettings(configured []interface{}, databaseVersion settings := &sqladmin.Settings{ // Version is unset in Create but is set during update SettingsVersion: int64(_settings["version"].(int)), + DataCacheConfig: expandDataCacheConfig(_settings["data_cache_config"].([]interface{})), Tier: _settings["tier"].(string), + Edition: _settings["edition"].(string), AdvancedMachineFeatures: expandSqlServerAdvancedMachineFeatures(_settings["advanced_machine_features"].([]interface{})), ForceSendFields: []string{"StorageAutoResize"}, ActivationPolicy: _settings["activation_policy"].(string), @@ -1345,6 +1369,17 @@ func expandDatabaseFlags(configured []interface{}) []*sqladmin.DatabaseFlags { return databaseFlags } +func expandDataCacheConfig(configured interface{}) *sqladmin.DataCacheConfig { + l := configured.([]interface{}) + if len(l) == 0 { + return nil + } + config := l[0].(map[string]interface{}) + return &sqladmin.DataCacheConfig{ + DataCacheEnabled: config["data_cache_enabled"].(bool), + } +} + func expandBackupConfiguration(configured []interface{}) *sqladmin.BackupConfiguration { if len(configured) == 0 || configured[0] == nil { return nil @@ -1907,6 +1942,7 @@ func flattenSettings(settings *sqladmin.Settings) []map[string]interface{} { data := map[string]interface{}{ "version": settings.SettingsVersion, "tier": settings.Tier, + "edition": settings.Edition, "activation_policy": settings.ActivationPolicy, "availability_type": settings.AvailabilityType, "collation": settings.Collation, @@ -1967,6 +2003,10 @@ func flattenSettings(settings *sqladmin.Settings) []map[string]interface{} { data["password_validation_policy"] = flattenPasswordValidationPolicy(settings.PasswordValidationPolicy) } + if settings.DataCacheConfig != nil { + data["data_cache_config"] = flattenDataCacheConfig(settings.DataCacheConfig) + } + if settings.AdvancedMachineFeatures != nil { data["advanced_machine_features"] = flattenSqlServerAdvancedMachineFeatures(settings.AdvancedMachineFeatures) } @@ -1974,6 +2014,17 @@ func flattenSettings(settings *sqladmin.Settings) []map[string]interface{} { return []map[string]interface{}{data} } +func flattenDataCacheConfig(d *sqladmin.DataCacheConfig) []map[string]interface{} { + if d == nil { + return nil + } + return []map[string]interface{}{ + { + "data_cache_enabled": d.DataCacheEnabled, + }, + } +} + func flattenBackupConfiguration(backupConfiguration *sqladmin.BackupConfiguration) []map[string]interface{} { data := map[string]interface{}{ "binary_log_enabled": backupConfiguration.BinaryLogEnabled, diff --git a/mmv1/third_party/terraform/tests/resource_big_query_dataset_test.go b/mmv1/third_party/terraform/tests/resource_big_query_dataset_test.go index 466e5e6de6c4..0c3ed02f1af1 100644 --- a/mmv1/third_party/terraform/tests/resource_big_query_dataset_test.go +++ b/mmv1/third_party/terraform/tests/resource_big_query_dataset_test.go @@ -167,6 +167,28 @@ func TestAccBigQueryDataset_cmek(t *testing.T) { }) } +func TestAccBigQueryDataset_storageBillModel(t *testing.T) { + t.Parallel() + + datasetID := fmt.Sprintf("tf_test_%s", RandString(t, 10)) + + VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: ProtoV5ProviderFactories(t), + CheckDestroy: testAccCheckBigQueryDatasetDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testAccBigQueryDatasetStorageBillingModel(datasetID), + }, + { + ResourceName: "google_bigquery_dataset.test", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testAccAddTable(t *testing.T, datasetID string, tableID string) resource.TestCheckFunc { // Not actually a check, but adds a table independently of terraform return func(s *terraform.State) error { @@ -389,3 +411,22 @@ resource "google_bigquery_dataset" "test" { } `, pid, datasetID, kmsKey) } + +func testAccBigQueryDatasetStorageBillingModel(datasetID string) string { + return fmt.Sprintf(` +resource "google_bigquery_dataset" "test" { + dataset_id = "%s" + friendly_name = "foo" + description = "This is a foo description" + location = "EU" + default_partition_expiration_ms = 3600000 + default_table_expiration_ms = 3600000 + storage_billing_model = "PHYSICAL" + + labels = { + env = "foo" + default_table_expiration_ms = 3600000 + } +} +`, datasetID) +} diff --git a/mmv1/third_party/terraform/tests/resource_bigquery_table_test.go b/mmv1/third_party/terraform/tests/resource_bigquery_table_test.go index 798e8cc253c6..64dce7c324fb 100644 --- a/mmv1/third_party/terraform/tests/resource_bigquery_table_test.go +++ b/mmv1/third_party/terraform/tests/resource_bigquery_table_test.go @@ -480,6 +480,34 @@ func TestAccBigQueryExternalDataTable_parquet(t *testing.T) { }) } +func TestAccBigQueryExternalDataTable_objectTable(t *testing.T) { + t.Parallel() + + bucketName := testBucketName(t) + objectName := fmt.Sprintf("tf_test_%s.csv", RandString(t, 10)) + + datasetID := fmt.Sprintf("tf_test_%s", RandString(t, 10)) + tableID := fmt.Sprintf("tf_test_%s", RandString(t, 10)) + connectionID := fmt.Sprintf("tf_test_%s", RandString(t, 10)) + + VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: ProtoV5ProviderFactories(t), + CheckDestroy: testAccCheckBigQueryTableDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testAccBigQueryTableFromGCSObjectTable(connectionID, datasetID, tableID, bucketName, objectName), + }, + { + Config: testAccBigQueryTableFromGCSObjectTableMetadata(connectionID, datasetID, tableID, bucketName, objectName), + }, + { + Config: testAccBigQueryTableFromGCSObjectTable(connectionID, datasetID, tableID, bucketName, objectName), + }, + }, + }) +} + func TestAccBigQueryExternalDataTable_CSV(t *testing.T) { t.Parallel() @@ -1553,6 +1581,115 @@ resource "google_bigquery_table" "test" { `, datasetID, bucketName, objectName, tableID) } +func testAccBigQueryTableFromGCSObjectTable(connectionID, datasetID, tableID, bucketName, objectName string) string { + return fmt.Sprintf(` +resource "google_bigquery_connection" "test" { + connection_id = "%s" + location = "US" + cloud_resource {} +} + +locals { + connection_id_split = split("/", google_bigquery_connection.test.name) + connection_id_reformatted = "${local.connection_id_split[1]}.${local.connection_id_split[3]}.${local.connection_id_split[5]}" +} + +data "google_project" "project" {} + +resource "google_project_iam_member" "test" { + role = "roles/storage.objectViewer" + project = data.google_project.project.id + member = "serviceAccount:${google_bigquery_connection.test.cloud_resource[0].service_account_id}" +} + +resource "google_bigquery_dataset" "test" { + dataset_id = "%s" +} + +resource "google_storage_bucket" "test" { + name = "%s" + location = "US" + force_destroy = true +} + +resource "google_storage_bucket_object" "test" { + name = "%s" + source = "./test-fixtures/bigquerytable/test.parquet.gzip" + bucket = google_storage_bucket.test.name +} + +resource "google_bigquery_table" "test" { + deletion_protection = false + table_id = "%s" + dataset_id = google_bigquery_dataset.test.dataset_id + external_data_configuration { + connection_id = local.connection_id_reformatted + autodetect = false + object_metadata = "SIMPLE" + + source_uris = [ + "gs://${google_storage_bucket.test.name}/*", + ] + } +} +`, connectionID, datasetID, bucketName, objectName, tableID) +} + +func testAccBigQueryTableFromGCSObjectTableMetadata(connectionID, datasetID, tableID, bucketName, objectName string) string { + return fmt.Sprintf(` +resource "google_bigquery_connection" "test" { + connection_id = "%s" + location = "US" + cloud_resource {} +} + +locals { + connection_id_split = split("/", google_bigquery_connection.test.name) + connection_id_reformatted = "${local.connection_id_split[1]}.${local.connection_id_split[3]}.${local.connection_id_split[5]}" +} + +data "google_project" "project" {} + +resource "google_project_iam_member" "test" { + role = "roles/storage.objectViewer" + project = data.google_project.project.id + member = "serviceAccount:${google_bigquery_connection.test.cloud_resource[0].service_account_id}" +} + +resource "google_bigquery_dataset" "test" { + dataset_id = "%s" +} + +resource "google_storage_bucket" "test" { + name = "%s" + location = "US" + force_destroy = true +} + +resource "google_storage_bucket_object" "test" { + name = "%s" + source = "./test-fixtures/bigquerytable/test.parquet.gzip" + bucket = google_storage_bucket.test.name +} + +resource "google_bigquery_table" "test" { + deletion_protection = false + table_id = "%s" + dataset_id = google_bigquery_dataset.test.dataset_id + external_data_configuration { + connection_id = local.connection_id_reformatted + autodetect = false + object_metadata = "SIMPLE" + metadata_cache_mode = "MANUAL" + + source_uris = [ + "gs://${google_storage_bucket.test.name}/*", + ] + } +} +`, connectionID, datasetID, bucketName, objectName, tableID) +} + func testAccBigQueryTableFromGCSWithSchemaWithConnectionId(datasetID, tableID, connectionID, projectID, bucketName, objectName, content, schema string) string { return fmt.Sprintf(` resource "google_bigquery_dataset" "test" { diff --git a/mmv1/third_party/terraform/tests/resource_bigtable_table_test.go b/mmv1/third_party/terraform/tests/resource_bigtable_table_test.go index 869479efd9e2..5a10364c73c5 100644 --- a/mmv1/third_party/terraform/tests/resource_bigtable_table_test.go +++ b/mmv1/third_party/terraform/tests/resource_bigtable_table_test.go @@ -209,6 +209,69 @@ func TestAccBigtableTable_deletion_protection_unprotected(t *testing.T) { }) } +func TestAccBigtableTable_change_stream_enable(t *testing.T) { + // bigtable instance does not use the shared HTTP client, this test creates an instance + acctest.SkipIfVcr(t) + t.Parallel() + + instanceName := fmt.Sprintf("tf-test-%s", acctest.RandString(t, 10)) + tableName := fmt.Sprintf("tf-test-%s", acctest.RandString(t, 10)) + family := fmt.Sprintf("tf-test-%s", acctest.RandString(t, 10)) + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + CheckDestroy: testAccCheckBigtableTableDestroyProducer(t), + Steps: []resource.TestStep{ + // creating a table with a column family and change stream of 1 day + { + Config: testAccBigtableTable_change_stream_retention(instanceName, tableName, "24h0m0s", family), + }, + { + ResourceName: "google_bigtable_table.table", + ImportState: true, + ImportStateVerify: true, + }, + // it is not possible to delete the table because of change stream is enabled + { + Config: testAccBigtableTable_destroyTable(instanceName), + ExpectError: regexp.MustCompile(".*the change stream is enabled.*"), + }, + // changing change stream retention value + { + Config: testAccBigtableTable_change_stream_retention(instanceName, tableName, "120h0m0s", family), + }, + { + ResourceName: "google_bigtable_table.table", + ImportState: true, + ImportStateVerify: true, + }, + // it is not possible to delete the table because of change stream is enabled + { + Config: testAccBigtableTable_destroyTable(instanceName), + ExpectError: regexp.MustCompile(".*the change stream is enabled.*"), + }, + // disable changing change stream retention + { + Config: testAccBigtableTable_change_stream_retention(instanceName, tableName, "0", family), + Check: resource.ComposeTestCheckFunc( + testAccBigtableChangeStreamDisabled(t), + ), + }, + // destroying the table is possible when change stream is disabled + { + Config: testAccBigtableTable_destroyTable(instanceName), + }, + { + ResourceName: "google_bigtable_instance.instance", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"deletion_protection", "instance_type"}, + }, + }, + }) +} + func TestAccBigtableTable_familyMany(t *testing.T) { // bigtable instance does not use the shared HTTP client, this test creates an instance acctest.SkipIfVcr(t) @@ -326,6 +389,35 @@ func testAccBigtableColumnFamilyExists(t *testing.T, table_name_space, family st } } +func testAccBigtableChangeStreamDisabled(t *testing.T) resource.TestCheckFunc { + var ctx = context.Background() + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources["google_bigtable_table.table"] + if !ok { + return fmt.Errorf("Table not found: %s", "google_bigtable_table.table") + } + + config := acctest.GoogleProviderConfig(t) + c, err := config.BigTableClientFactory(config.UserAgent).NewAdminClient(config.Project, rs.Primary.Attributes["instance_name"]) + if err != nil { + return fmt.Errorf("Error starting admin client. %s", err) + } + + defer c.Close() + + table, err := c.TableInfo(ctx, rs.Primary.Attributes["name"]) + if err != nil { + return fmt.Errorf("Error retrieving table. Could not find %s in %s.", rs.Primary.Attributes["name"], rs.Primary.Attributes["instance_name"]) + } + + if table.ChangeStreamRetention != nil { + return fmt.Errorf("Change Stream is expected to be disabled but it's not: %v", table) + } + + return nil + } +} + func testAccBigtableTable(instanceName, tableName string) string { return fmt.Sprintf(` resource "google_bigtable_instance" "instance" { @@ -418,6 +510,32 @@ resource "google_bigtable_table" "table" { `, instanceName, instanceName, tableName, deletionProtection, family) } +func testAccBigtableTable_change_stream_retention(instanceName, tableName, changeStreamRetention, family string) string { + return fmt.Sprintf(` +resource "google_bigtable_instance" "instance" { + name = "%s" + + cluster { + cluster_id = "%s" + zone = "us-central1-b" + } + + instance_type = "DEVELOPMENT" + deletion_protection = false +} + +resource "google_bigtable_table" "table" { + name = "%s" + instance_name = google_bigtable_instance.instance.name + change_stream_retention = "%s" + + column_family { + family = "%s" + } +} +`, instanceName, instanceName, tableName, changeStreamRetention, family) +} + func testAccBigtableTable_familyMany(instanceName, tableName, family string) string { return fmt.Sprintf(` resource "google_bigtable_instance" "instance" { diff --git a/mmv1/third_party/terraform/tests/resource_cloudfunction2_function_test.go b/mmv1/third_party/terraform/tests/resource_cloudfunction2_function_test.go index 6805c94c38f6..d4485dfad696 100644 --- a/mmv1/third_party/terraform/tests/resource_cloudfunction2_function_test.go +++ b/mmv1/third_party/terraform/tests/resource_cloudfunction2_function_test.go @@ -205,7 +205,6 @@ func TestAccCloudFunctions2Function_fullUpdate(t *testing.T) { func testAccCloudfunctions2function_cloudfunctions2BasicAuditlogsExample_update(context map[string]interface{}) string { return acctest.Nprintf(` -# [START functions_v2_basic_auditlogs] # This example follows the examples shown in this Google Cloud Community blog post # https://medium.com/google-cloud/applying-a-path-pattern-when-filtering-in-eventarc-f06b937b4c34 # and the docs: @@ -312,6 +311,5 @@ resource "google_cloudfunctions2_function" "function" { value = google_storage_bucket.audit-log-bucket.name # Update: stops using path pattern operator } } -} -# [END functions_v2_basic_auditlogs]`, context) +}`, context) } diff --git a/mmv1/third_party/terraform/tests/resource_compute_external_vpn_gateway_test.go b/mmv1/third_party/terraform/tests/resource_compute_external_vpn_gateway_test.go new file mode 100644 index 000000000000..675e568fc6a7 --- /dev/null +++ b/mmv1/third_party/terraform/tests/resource_compute_external_vpn_gateway_test.go @@ -0,0 +1,65 @@ +package google + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-provider-google/google/acctest" +) + +func TestAccComputeExternalVPNGateway_updateLabels(t *testing.T) { + t.Parallel() + + rnd := acctest.RandString(t, 10) + resourceName := "google_compute_external_vpn_gateway.external_gateway" + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + Steps: []resource.TestStep{ + { + Config: testAccComputeExternalVPNGateway_updateLabels(rnd, "test", "test"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "labels.%", "1"), + resource.TestCheckResourceAttr(resourceName, "labels.test", "test"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccComputeExternalVPNGateway_updateLabels(rnd, "test-updated", "test-updated"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "labels.%", "1"), + resource.TestCheckResourceAttr(resourceName, "labels.test-updated", "test-updated"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccComputeExternalVPNGateway_updateLabels(suffix, key, value string) string { + return fmt.Sprintf(` +resource "google_compute_external_vpn_gateway" "external_gateway" { + name = "tf-test-external-gateway-%s" + redundancy_type = "SINGLE_IP_INTERNALLY_REDUNDANT" + description = "An externally managed VPN gateway" + interface { + id = 0 + ip_address = "8.8.8.8" + } + + labels = { + %s = "%s" + } +} +`, suffix, key, value) +} diff --git a/mmv1/third_party/terraform/tests/resource_compute_firewall_policy_rule_test.go.erb b/mmv1/third_party/terraform/tests/resource_compute_firewall_policy_rule_test.go.erb index 8c2daa357d25..0682692a9a6d 100644 --- a/mmv1/third_party/terraform/tests/resource_compute_firewall_policy_rule_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_compute_firewall_policy_rule_test.go.erb @@ -97,7 +97,6 @@ resource "google_compute_firewall_policy" "default" { description = "Resource created for Terraform acceptance testing" } -<% if version != "ga" -%> resource "google_network_security_address_group" "basic_global_networksecurity_address_group" { name = "tf-test-policy%{random_suffix}" parent = "%{org_name}" @@ -107,7 +106,6 @@ resource "google_network_security_address_group" "basic_global_networksecurity_a type = "IPV4" capacity = 100 } -<% end -%> resource "google_compute_firewall_policy_rule" "default" { firewall_policy = google_compute_firewall_policy.default.id @@ -126,9 +124,7 @@ resource "google_compute_firewall_policy_rule" "default" { dest_fqdns = [] dest_region_codes = [] dest_threat_intelligences = [] -<% if version != "ga" -%> dest_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] -<% end -%> } } `, context) @@ -165,7 +161,6 @@ resource "google_compute_firewall_policy" "default" { description = "Resource created for Terraform acceptance testing" } -<% if version != "ga" -%> resource "google_network_security_address_group" "basic_global_networksecurity_address_group" { name = "tf-test-policy%{random_suffix}" parent = "%{org_name}" @@ -175,7 +170,6 @@ resource "google_network_security_address_group" "basic_global_networksecurity_a type = "IPV4" capacity = 100 } -<% end -%> resource "google_compute_firewall_policy_rule" "default" { firewall_policy = google_compute_firewall_policy.default.id @@ -199,9 +193,7 @@ resource "google_compute_firewall_policy_rule" "default" { dest_region_codes = ["US"] dest_threat_intelligences = ["iplist-known-malicious-ips"] src_address_groups = [] -<% if version != "ga" -%> dest_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] -<% end -%> } target_resources = [google_compute_network.network1.self_link, google_compute_network.network2.self_link] target_service_accounts = [google_service_account.service_account.email] @@ -240,7 +232,6 @@ resource "google_compute_firewall_policy" "default" { description = "Resource created for Terraform acceptance testing" } -<% if version != "ga" -%> resource "google_network_security_address_group" "basic_global_networksecurity_address_group" { name = "tf-test-policy%{random_suffix}" parent = "%{org_name}" @@ -250,7 +241,6 @@ resource "google_network_security_address_group" "basic_global_networksecurity_a type = "IPV4" capacity = 100 } -<% end -%> resource "google_compute_firewall_policy_rule" "default" { firewall_policy = google_compute_firewall_policy.default.id @@ -335,7 +325,6 @@ resource "google_compute_firewall_policy" "default" { description = "Resource created for Terraform acceptance testing" } -<% if version != "ga" -%> resource "google_network_security_address_group" "basic_global_networksecurity_address_group" { name = "tf-test-policy%{random_suffix}" parent = "%{org_name}" @@ -345,7 +334,6 @@ resource "google_network_security_address_group" "basic_global_networksecurity_a type = "IPV4" capacity = 100 } -<% end -%> resource "google_compute_firewall_policy_rule" "rule1" { firewall_policy = google_compute_firewall_policy.default.id @@ -364,9 +352,7 @@ resource "google_compute_firewall_policy_rule" "rule1" { dest_fqdns = ["google.com"] dest_region_codes = ["US"] dest_threat_intelligences = ["iplist-known-malicious-ips"] -<% if version != "ga" -%> dest_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] -<% end -%> } } @@ -390,9 +376,7 @@ resource "google_compute_firewall_policy_rule" "rule2" { src_fqdns = ["google.com"] src_region_codes = ["US"] src_threat_intelligences = ["iplist-known-malicious-ips"] -<% if version != "ga" -%> src_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] -<% end -%> } } `, context) @@ -411,7 +395,6 @@ resource "google_compute_firewall_policy" "default" { description = "Description Update" } -<% if version != "ga" -%> resource "google_network_security_address_group" "basic_global_networksecurity_address_group" { name = "tf-test-policy%{random_suffix}" parent = "%{org_name}" @@ -421,7 +404,6 @@ resource "google_network_security_address_group" "basic_global_networksecurity_a type = "IPV4" capacity = 100 } -<% end -%> resource "google_compute_firewall_policy_rule" "rule1" { firewall_policy = google_compute_firewall_policy.default.id @@ -439,9 +421,7 @@ resource "google_compute_firewall_policy_rule" "rule1" { dest_fqdns = ["google.com"] dest_region_codes = ["US"] dest_threat_intelligences = ["iplist-known-malicious-ips"] -<% if version != "ga" -%> dest_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] -<% end -%> } } @@ -465,9 +445,7 @@ resource "google_compute_firewall_policy_rule" "rule2" { src_fqdns = ["google.com"] src_region_codes = ["US"] src_threat_intelligences = ["iplist-known-malicious-ips"] -<% if version != "ga" -%> src_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] -<% end -%> } } @@ -488,9 +466,7 @@ resource "google_compute_firewall_policy_rule" "rule3" { src_fqdns = ["google.com"] src_region_codes = ["US"] src_threat_intelligences = ["iplist-known-malicious-ips"] -<% if version != "ga" -%> src_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] -<% end -%> } } `, context) @@ -509,7 +485,6 @@ resource "google_compute_firewall_policy" "default" { description = "Resource created for Terraform acceptance testing" } -<% if version != "ga" -%> resource "google_network_security_address_group" "basic_global_networksecurity_address_group" { name = "tf-test-policy%{random_suffix}" parent = "%{org_name}" @@ -519,7 +494,6 @@ resource "google_network_security_address_group" "basic_global_networksecurity_a type = "IPV4" capacity = 100 } -<% end -%> resource "google_compute_firewall_policy_rule" "rule1" { firewall_policy = google_compute_firewall_policy.default.id diff --git a/mmv1/third_party/terraform/tests/resource_compute_router_bgp_peer_test.go b/mmv1/third_party/terraform/tests/resource_compute_router_bgp_peer_test.go index 41bd0e16efcf..de9e2eb70463 100644 --- a/mmv1/third_party/terraform/tests/resource_compute_router_bgp_peer_test.go +++ b/mmv1/third_party/terraform/tests/resource_compute_router_bgp_peer_test.go @@ -480,7 +480,6 @@ resource "google_compute_router_interface" "foobar" { name = "%s" router = google_compute_router.foobar.name region = google_compute_router.foobar.region - ip_range = "169.254.3.1/30" vpn_tunnel = google_compute_vpn_tunnel.foobar.name } @@ -488,8 +487,6 @@ resource "google_compute_router_peer" "foobar" { name = "%s" router = google_compute_router.foobar.name region = google_compute_router.foobar.region - ip_address = "169.254.3.1" - peer_ip_address = "169.254.3.2" peer_asn = 65515 advertised_route_priority = 100 interface = google_compute_router_interface.foobar.name @@ -556,7 +553,6 @@ resource "google_compute_router_interface" "foobar" { name = "%s" router = google_compute_router.foobar.name region = google_compute_router.foobar.region - ip_range = "169.254.3.1/30" vpn_tunnel = google_compute_vpn_tunnel.foobar.name } `, routerName, routerName, routerName, routerName, routerName, routerName, routerName, routerName) @@ -886,7 +882,6 @@ resource "google_compute_router_interface" "foobar" { name = "%s" router = google_compute_router.foobar.name region = google_compute_router.foobar.region - ip_range = "169.254.3.1/30" vpn_tunnel = google_compute_vpn_tunnel.foobar.name } @@ -894,7 +889,6 @@ resource "google_compute_router_peer" "foobar" { name = "%s" router = google_compute_router.foobar.name region = google_compute_router.foobar.region - peer_ip_address = "169.254.3.2" peer_asn = 65515 advertised_route_priority = 100 interface = google_compute_router_interface.foobar.name @@ -962,7 +956,6 @@ resource "google_compute_router_interface" "foobar" { name = "%s" router = google_compute_router.foobar.name region = google_compute_router.foobar.region - ip_range = "169.254.3.1/30" vpn_tunnel = google_compute_vpn_tunnel.foobar.name } @@ -970,8 +963,6 @@ resource "google_compute_router_peer" "foobar" { name = "%s" router = google_compute_router.foobar.name region = google_compute_router.foobar.region - ip_address = "169.254.3.1" - peer_ip_address = "169.254.3.2" peer_asn = 65515 advertised_route_priority = 100 interface = google_compute_router_interface.foobar.name diff --git a/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb b/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb index 36aa886a4066..3ed25346a93e 100644 --- a/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb @@ -2693,6 +2693,15 @@ func TestAccContainerCluster_withMonitoringConfig(t *testing.T) { ImportStateVerify: true, ImportStateVerifyIgnore: []string{"min_master_version"}, }, + { + Config: testAccContainerCluster_withMonitoringConfigPrometheusOnly2(clusterName), + }, + { + ResourceName: "google_container_cluster.primary", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"min_master_version"}, + }, { Config: testAccContainerCluster_basic(clusterName), }, @@ -7451,6 +7460,20 @@ resource "google_container_cluster" "primary" { `, name) } +func testAccContainerCluster_withMonitoringConfigPrometheusOnly2(name string) string { + return fmt.Sprintf(` +resource "google_container_cluster" "primary" { + name = "%s" + location = "us-central1-a" + initial_node_count = 1 + monitoring_config { + managed_prometheus { + enabled = true + } + } +} +`, name) +} func testAccContainerCluster_withSoleTenantGroup(name string) string { return fmt.Sprintf(` diff --git a/mmv1/third_party/terraform/tests/resource_container_node_pool_test.go.erb b/mmv1/third_party/terraform/tests/resource_container_node_pool_test.go.erb index 508e06da0f77..f8c51ab791f3 100644 --- a/mmv1/third_party/terraform/tests/resource_container_node_pool_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_container_node_pool_test.go.erb @@ -3076,3 +3076,74 @@ resource "google_container_node_pool" "with_sole_tenant_config" { } `, cluster, np) } + +<% unless version == 'ga' -%> +func TestAccContainerNodePool_tpuTopology(t *testing.T) { + t.Parallel() + acctest.SkipIfVcr(t) + + cluster := fmt.Sprintf("tf-test-cluster-%s", RandString(t, 10)) + np1 := fmt.Sprintf("tf-test-nodepool-%s", RandString(t, 10)) + np2 := fmt.Sprintf("tf-test-nodepool-%s", RandString(t, 10)) + + VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: ProtoV5ProviderFactories(t), + CheckDestroy: testAccCheckContainerNodePoolDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testAccContainerNodePool_tpuTopology(cluster, np1, np2, "2x2x2"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("google_container_node_pool.regular_pool", "node_config.0.machine_type", "n1-standard-4"), + resource.TestCheckResourceAttr("google_container_node_pool.with_tpu_topology", "node_config.0.machine_type", "ct4p-hightpu-4t"), + resource.TestCheckResourceAttr("google_container_node_pool.with_tpu_topology", "placement_policy.0.tpu_topology", "2x2x2"), + resource.TestCheckResourceAttr("google_container_node_pool.with_tpu_topology", "placement_policy.0.type", "COMPACT"), + ), + }, + { + ResourceName: "google_container_node_pool.with_tpu_topology", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccContainerNodePool_tpuTopology(cluster, np1, np2, tpuTopology string) string { + return fmt.Sprintf(` +resource "google_container_cluster" "cluster" { + name = "%s" + location = "us-central2-b" + initial_node_count = 1 +} + +resource "google_container_node_pool" "regular_pool" { + name = "%s" + location = "us-central2-b" + cluster = google_container_cluster.cluster.name + initial_node_count = 1 + + node_config { + machine_type = "n1-standard-4" + + } + } + +resource "google_container_node_pool" "with_tpu_topology" { + name = "%s" + location = "us-central2-b" + cluster = google_container_cluster.cluster.name + initial_node_count = 2 + + node_config { + machine_type = "ct4p-hightpu-4t" + + } + placement_policy { + type = "COMPACT" + tpu_topology = "%s" + } +} +`, cluster, np1, np2, tpuTopology) +} +<% end -%> \ No newline at end of file diff --git a/mmv1/third_party/terraform/tests/resource_firebase_project_test.go.erb b/mmv1/third_party/terraform/tests/resource_firebase_project_test.go.erb index bd73c4c773fc..cd400d7de56a 100644 --- a/mmv1/third_party/terraform/tests/resource_firebase_project_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_firebase_project_test.go.erb @@ -45,8 +45,8 @@ func testAccFirebaseProject_firebaseProjectBasicExampleDestroyed(context map[str resource "google_project" "default" { provider = google-beta - project_id = "tf-test%{random_suffix}" - name = "tf-test%{random_suffix}" + project_id = "tf-test-my-project%{random_suffix}" + name = "tf-test-my-project%{random_suffix}" org_id = "%{org_id}" labels = { diff --git a/mmv1/third_party/terraform/tests/resource_gke_hub_feature_test.go.erb b/mmv1/third_party/terraform/tests/resource_gke_hub_feature_test.go.erb index 9628305e5725..a7dcc1bf37f6 100644 --- a/mmv1/third_party/terraform/tests/resource_gke_hub_feature_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_gke_hub_feature_test.go.erb @@ -15,7 +15,6 @@ import ( transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" ) -<% unless version == 'ga' -%> func TestAccGKEHubFeature_gkehubFeatureFleetObservability(t *testing.T) { // VCR fails to handle batched project services acctest.SkipIfVcr(t) @@ -29,7 +28,7 @@ func TestAccGKEHubFeature_gkehubFeatureFleetObservability(t *testing.T) { acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), CheckDestroy: testAccCheckGKEHubFeatureDestroyProducer(t), ExternalProviders: map[string]resource.ExternalProvider{ "time": {}, @@ -64,7 +63,7 @@ func TestAccGKEHubFeature_gkehubFeatureFleetObservability(t *testing.T) { } func testAccGKEHubFeature_gkehubFeatureFleetObservability(context map[string]interface{}) string { - return gkeHubFeatureProjectSetup(context) + acctest.Nprintf(` + return gkeHubFeatureProjectSetupForGA(context) + acctest.Nprintf(` resource "time_sleep" "wait_for_gkehub_enablement" { create_duration = "150s" depends_on = [google_project_service.gkehub] @@ -87,13 +86,12 @@ resource "google_gke_hub_feature" "feature" { } } depends_on = [time_sleep.wait_for_gkehub_enablement] - provider = google-beta } `, context) } func testAccGKEHubFeature_gkehubFeatureFleetObservabilityUpdate1(context map[string]interface{}) string { - return gkeHubFeatureProjectSetup(context) + acctest.Nprintf(` + return gkeHubFeatureProjectSetupForGA(context) + acctest.Nprintf(` resource "time_sleep" "wait_for_gkehub_enablement" { create_duration = "150s" depends_on = [google_project_service.gkehub] @@ -113,13 +111,12 @@ resource "google_gke_hub_feature" "feature" { } } depends_on = [time_sleep.wait_for_gkehub_enablement] - provider = google-beta } `, context) } func testAccGKEHubFeature_gkehubFeatureFleetObservabilityUpdate2(context map[string]interface{}) string { - return gkeHubFeatureProjectSetup(context) + acctest.Nprintf(` + return gkeHubFeatureProjectSetupForGA(context) + acctest.Nprintf(` resource "time_sleep" "wait_for_gkehub_enablement" { create_duration = "150s" depends_on = [google_project_service.gkehub] @@ -139,11 +136,11 @@ resource "google_gke_hub_feature" "feature" { } } depends_on = [time_sleep.wait_for_gkehub_enablement] - provider = google-beta } `, context) } +<% unless version == 'ga' -%> func gkeHubFeatureProjectSetup(context map[string]interface{}) string { return acctest.Nprintf(` resource "google_project" "project" { diff --git a/mmv1/third_party/terraform/tests/resource_network_security_address_groups_test.go.erb b/mmv1/third_party/terraform/tests/resource_network_security_address_groups_test.go similarity index 78% rename from mmv1/third_party/terraform/tests/resource_network_security_address_groups_test.go.erb rename to mmv1/third_party/terraform/tests/resource_network_security_address_groups_test.go index 2594a163324a..492d320dd0f1 100644 --- a/mmv1/third_party/terraform/tests/resource_network_security_address_groups_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_network_security_address_groups_test.go @@ -1,25 +1,24 @@ -<% autogen_exception -%> package google -<% unless version == 'ga' -%> import ( "fmt" - "github.com/hashicorp/terraform-provider-google/google/acctest" "testing" + "github.com/hashicorp/terraform-provider-google/google/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccNetworkSecurityAddressGroups_update(t *testing.T){ - t.Parallel() +func TestAccNetworkSecurityAddressGroups_update(t *testing.T) { + t.Parallel() - addressGroupsName := fmt.Sprintf("tf-test-address-group-%s", acctest.RandString(t, 10)) + addressGroupsName := fmt.Sprintf("tf-test-address-group-%s", acctest.RandString(t, 10)) projectName := GetTestProjectFromEnv() - acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - CheckDestroy: testAccCheckNetworkSecurityAddressGroupDestroyProducer(t), + CheckDestroy: testAccCheckNetworkSecurityAddressGroupDestroyProducer(t), Steps: []resource.TestStep{ { Config: testAccNetworkSecurityAddressGroups_basic(addressGroupsName, projectName), @@ -42,7 +41,7 @@ func TestAccNetworkSecurityAddressGroups_update(t *testing.T){ } func testAccNetworkSecurityAddressGroups_basic(addressGroupsName, projectName string) string { - return fmt.Sprintf(` + return fmt.Sprintf(` resource "google_network_security_address_group" "foobar" { name = "%s" parent = "projects/%s" @@ -59,7 +58,7 @@ resource "google_network_security_address_group" "foobar" { } func testAccNetworkSecurityAddressGroups_update(addressGroupsName, projectName string) string { - return fmt.Sprintf(` + return fmt.Sprintf(` resource "google_network_security_address_group" "foobar" { name = "%s" parent = "projects/%s" @@ -74,5 +73,3 @@ resource "google_network_security_address_group" "foobar" { } `, addressGroupsName, projectName) } - -<% end -%> \ No newline at end of file diff --git a/mmv1/third_party/terraform/tests/resource_network_security_gateway_security_policies_rule_test.go.erb b/mmv1/third_party/terraform/tests/resource_network_security_gateway_security_policies_rule_test.go similarity index 94% rename from mmv1/third_party/terraform/tests/resource_network_security_gateway_security_policies_rule_test.go.erb rename to mmv1/third_party/terraform/tests/resource_network_security_gateway_security_policies_rule_test.go index 45252ea227f5..5872603ec406 100644 --- a/mmv1/third_party/terraform/tests/resource_network_security_gateway_security_policies_rule_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_network_security_gateway_security_policies_rule_test.go @@ -1,6 +1,4 @@ -<% autogen_exception -%> package google -<% unless version == 'ga' -%> import ( "fmt" @@ -17,9 +15,9 @@ func TestAccNetworkSecurityGatewaySecurityPolicyRule_update(t *testing.T) { gatewaySecurityPolicyRuleName := fmt.Sprintf("tf-test-gateway-sp-rule-%s", acctest.RandString(t, 10)) acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, + PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - CheckDestroy: testAccCheckNetworkSecurityGatewaySecurityPolicyRuleDestroyProducer(t), + CheckDestroy: testAccCheckNetworkSecurityGatewaySecurityPolicyRuleDestroyProducer(t), Steps: []resource.TestStep{ { Config: testAccNetworkSecurityGatewaySecurityPolicyRule_basic(gatewaySecurityPolicyName, gatewaySecurityPolicyRuleName), @@ -93,5 +91,3 @@ resource "google_network_security_gateway_security_policy_rule" "foobar" { } `, gatewaySecurityPolicyName, gatewaySecurityPolicyRuleName) } - -<% end -%> diff --git a/mmv1/third_party/terraform/tests/resource_network_security_gateway_security_policies_test.go.erb b/mmv1/third_party/terraform/tests/resource_network_security_gateway_security_policies_test.go similarity index 88% rename from mmv1/third_party/terraform/tests/resource_network_security_gateway_security_policies_test.go.erb rename to mmv1/third_party/terraform/tests/resource_network_security_gateway_security_policies_test.go index dd5e388ad124..431a3007988c 100644 --- a/mmv1/third_party/terraform/tests/resource_network_security_gateway_security_policies_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_network_security_gateway_security_policies_test.go @@ -1,6 +1,4 @@ -<% autogen_exception -%> package google -<% unless version == 'ga' -%> import ( "fmt" @@ -16,9 +14,9 @@ func TestAccNetworkSecurityGatewaySecurityPolicy_update(t *testing.T) { gatewaySecurityPolicyName := fmt.Sprintf("tf-test-gateway-sp-%s", acctest.RandString(t, 10)) acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, + PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - CheckDestroy: testAccCheckNetworkSecurityGatewaySecurityPolicyDestroyProducer(t), + CheckDestroy: testAccCheckNetworkSecurityGatewaySecurityPolicyDestroyProducer(t), Steps: []resource.TestStep{ { Config: testAccNetworkSecurityGatewaySecurityPolicy_basic(gatewaySecurityPolicyName), @@ -59,5 +57,3 @@ resource "google_network_security_gateway_security_policy" "foobar" { } `, gatewaySecurityPolicyName) } - -<% end -%> diff --git a/mmv1/third_party/terraform/tests/resource_network_security_url_lists_test.go.erb b/mmv1/third_party/terraform/tests/resource_network_security_url_lists_test.go similarity index 74% rename from mmv1/third_party/terraform/tests/resource_network_security_url_lists_test.go.erb rename to mmv1/third_party/terraform/tests/resource_network_security_url_lists_test.go index 011e878fb6c9..be0738a66b04 100644 --- a/mmv1/third_party/terraform/tests/resource_network_security_url_lists_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_network_security_url_lists_test.go @@ -1,6 +1,4 @@ -<% autogen_exception -%> package google -<% unless version == 'ga' -%> import ( "fmt" @@ -10,15 +8,15 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccNetworkSecurityUrlLists_update(t *testing.T){ - t.Parallel() +func TestAccNetworkSecurityUrlLists_update(t *testing.T) { + t.Parallel() - urlListsName := fmt.Sprintf("tf-test-url-lists-%s", acctest.RandString(t, 10)) + urlListsName := fmt.Sprintf("tf-test-url-lists-%s", acctest.RandString(t, 10)) - acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - CheckDestroy: testAccCheckNetworkSecurityUrlListsDestroyProducer(t), + CheckDestroy: testAccCheckNetworkSecurityUrlListsDestroyProducer(t), Steps: []resource.TestStep{ { Config: testAccNetworkSecurityUrlLists_basic(urlListsName), @@ -41,7 +39,7 @@ func TestAccNetworkSecurityUrlLists_update(t *testing.T){ } func testAccNetworkSecurityUrlLists_basic(urlListsName string) string { - return fmt.Sprintf(` + return fmt.Sprintf(` resource "google_network_security_url_lists" "foobar" { name = "%s" location = "us-central1" @@ -51,7 +49,7 @@ resource "google_network_security_url_lists" "foobar" { } func testAccNetworkSecurityUrlLists_update(urlListsName string) string { - return fmt.Sprintf(` + return fmt.Sprintf(` resource "google_network_security_url_lists" "foobar" { name = "%s" location = "us-central1" @@ -60,5 +58,3 @@ resource "google_network_security_url_lists" "foobar" { } `, urlListsName) } - -<% end -%> \ No newline at end of file diff --git a/mmv1/third_party/terraform/tests/resource_network_services_gateway_test.go.erb b/mmv1/third_party/terraform/tests/resource_network_services_gateway_test.go similarity index 98% rename from mmv1/third_party/terraform/tests/resource_network_services_gateway_test.go.erb rename to mmv1/third_party/terraform/tests/resource_network_services_gateway_test.go index ef460ed39f06..d9daf50b3a4f 100644 --- a/mmv1/third_party/terraform/tests/resource_network_services_gateway_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_network_services_gateway_test.go @@ -1,6 +1,4 @@ -<% autogen_exception -%> package google -<% unless version == 'ga' -%> import ( "fmt" @@ -16,9 +14,9 @@ func TestAccNetworkServicesGateway_update(t *testing.T) { gatewayName := fmt.Sprintf("tf-test-gateway-%s", acctest.RandString(t, 10)) acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, + PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - CheckDestroy: testAccCheckNetworkServicesGatewayDestroyProducer(t), + CheckDestroy: testAccCheckNetworkServicesGatewayDestroyProducer(t), Steps: []resource.TestStep{ { Config: testAccNetworkServicesGateway_basic(gatewayName), @@ -153,12 +151,12 @@ resource "google_network_services_gateway" "foobar" { // name = "%s" // location = "us-east1" // gateway_security_policy = google_network_security_gateway_security_policy.default.name -// enabled = true +// enabled = true // priority = 1 // session_matcher = "host() == 'example.com'" // basic_profile = "ALLOW" //} -// +// //resource "google_network_services_gateway" "foobar" { // name = "%s" // location = "us-east1" @@ -231,7 +229,7 @@ resource "google_network_services_gateway" "foobar" { // name = "%s" // location = "us-east1" // gateway_security_policy = google_network_security_gateway_security_policy.default.name -// enabled = true +// enabled = true // priority = 1 // session_matcher = "host() == 'example.com'" // basic_profile = "ALLOW" @@ -247,12 +245,12 @@ resource "google_network_services_gateway" "foobar" { //# name = "%s" //# location = "us-east1" //# gateway_security_policy = google_network_security_gateway_security_policy.newpolicy.name -//# enabled = true +//# enabled = true //# priority = 1 //# session_matcher = "host() == 'example.com'" //# basic_profile = "ALLOW" //# } -// +// //resource "google_network_services_gateway" "foobar" { // name = "%s" // location = "us-east1" @@ -733,5 +731,3 @@ resource "google_compute_subnetwork" "proxyonlysubnet2" { `, cmName, netName, subnetName, pSubnetName, policyName, ruleName, gatewayName, gatewayScope, net2Name, subnet2Name, pSubnet2Name) } - -<% end -%> \ No newline at end of file diff --git a/mmv1/third_party/terraform/tests/resource_sql_database_instance_test.go b/mmv1/third_party/terraform/tests/resource_sql_database_instance_test.go index 48c9b46d9440..2e0941754f01 100644 --- a/mmv1/third_party/terraform/tests/resource_sql_database_instance_test.go +++ b/mmv1/third_party/terraform/tests/resource_sql_database_instance_test.go @@ -1308,6 +1308,60 @@ func TestAccSQLDatabaseInstance_DenyMaintenancePeriod(t *testing.T) { }) } +func TestAccSqlDatabaseInstance_Edition(t *testing.T) { + t.Parallel() + enterprisePlusName := "tf-test-enterprise-plus" + acctest.RandString(t, 10) + enterprisePlusTier := "db-perf-optimized-N-2" + enterpriseName := "tf-test-enterprise-" + acctest.RandString(t, 10) + enterpriseTier := "db-custom-2-13312" + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + CheckDestroy: testAccSqlDatabaseInstanceDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testGoogleSqlDatabaseInstance_EditionConfig(enterprisePlusName, enterprisePlusTier, "ENTERPRISE_PLUS"), + }, + { + ResourceName: "google_sql_database_instance.instance", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"deletion_protection"}, + }, + { + Config: testGoogleSqlDatabaseInstance_EditionConfig(enterpriseName, enterpriseTier, "ENTERPRISE"), + }, + { + ResourceName: "google_sql_database_instance.instance", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"deletion_protection"}, + }, + }, + }) +} + +func TestAccSQLDatabaseInstance_sqlMysqlDataCacheConfig(t *testing.T) { + t.Parallel() + instanceName := "tf-test-enterprise-plus" + acctest.RandString(t, 10) + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + CheckDestroy: testAccSqlDatabaseInstanceDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testGoogleSqlDatabaseInstance_sqlMysqlDataCacheConfig(instanceName), + }, + { + ResourceName: "google_sql_database_instance.instance", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"deletion_protection"}, + }, + }, + }) +} + func TestAccSqlDatabaseInstance_SqlServerAuditConfig(t *testing.T) { // Service Networking acctest.SkipIfVcr(t) @@ -1968,6 +2022,39 @@ resource "google_sql_database_instance" "instance" { }`, databaseName, endDate, startDate, time) } +func testGoogleSqlDatabaseInstance_EditionConfig(databaseName, tier, edition string) string { + return fmt.Sprintf(` + +resource "google_sql_database_instance" "instance" { + name = "%s" + region = "us-east1" + database_version = "POSTGRES_14" + deletion_protection = false + settings { + tier = "%s" + edition = "%s" + } +}`, databaseName, tier, edition) +} + +func testGoogleSqlDatabaseInstance_sqlMysqlDataCacheConfig(instanceName string) string { + return fmt.Sprintf(` + +resource "google_sql_database_instance" "instance" { + name = "%s" + region = "us-east1" + database_version = "MYSQL_8_0_31" + deletion_protection = false + settings { + tier = "db-perf-optimized-N-2" + edition = "ENTERPRISE_PLUS" + data_cache_config { + data_cache_enabled = true + } + } +}`, instanceName) +} + func testGoogleSqlDatabaseInstance_SqlServerAuditConfig(databaseName, rootPassword, bucketName, uploadInterval, retentionInterval string) string { return fmt.Sprintf(` resource "google_storage_bucket" "gs-bucket" { diff --git a/mmv1/third_party/terraform/tests/resource_vertex_ai_index_test.go b/mmv1/third_party/terraform/tests/resource_vertex_ai_index_test.go index b896ff0fe563..e737d6d5a75b 100644 --- a/mmv1/third_party/terraform/tests/resource_vertex_ai_index_test.go +++ b/mmv1/third_party/terraform/tests/resource_vertex_ai_index_test.go @@ -89,6 +89,7 @@ resource "google_vertex_ai_index" "index" { config { dimensions = 2 approximate_neighbors_count = 150 + shard_size = "SHARD_SIZE_SMALL" distance_measure_type = "DOT_PRODUCT_DISTANCE" algorithm_config { tree_ah_config { @@ -145,6 +146,7 @@ resource "google_vertex_ai_index" "index" { config { dimensions = 2 approximate_neighbors_count = 150 + shard_size = "SHARD_SIZE_SMALL" distance_measure_type = "DOT_PRODUCT_DISTANCE" algorithm_config { tree_ah_config { diff --git a/mmv1/third_party/terraform/utils/network_security_address_group_operation.go.erb b/mmv1/third_party/terraform/utils/network_security_address_group_operation.go.erb index aa4b6aef5e9b..944bd6e5ecea 100644 --- a/mmv1/third_party/terraform/utils/network_security_address_group_operation.go.erb +++ b/mmv1/third_party/terraform/utils/network_security_address_group_operation.go.erb @@ -1,6 +1,5 @@ <% autogen_exception -%> package google -<% unless version == 'ga' -%> import ( "time" @@ -14,4 +13,3 @@ func NetworkSecurityAddressGroupOperationWaitTime(config *transport_tpg.Config, // project is not necessary for this operation. return networksecurity.NetworkSecurityAddressGroupOperationWaitTime(config, op, activity, userAgent, timeout) } -<% end -%> diff --git a/mmv1/third_party/terraform/website/docs/r/bigquery_table.html.markdown b/mmv1/third_party/terraform/website/docs/r/bigquery_table.html.markdown index e0f551b0f46a..557680aab8d9 100644 --- a/mmv1/third_party/terraform/website/docs/r/bigquery_table.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/bigquery_table.html.markdown @@ -195,7 +195,7 @@ in Terraform state, a `terraform destroy` or `terraform apply` that would delete datasource, after creation the computed schema will be stored in `google_bigquery_table.schema` -* `source_format` (Required) - The data format. Please see sourceFormat under +* `source_format` (Optional) - The data format. Please see sourceFormat under [ExternalDataConfiguration](https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#externaldataconfiguration) in Bigquery's public API documentation for supported formats. To use "GOOGLE_SHEETS" the `scopes` must include "https://www.googleapis.com/auth/drive.readonly". @@ -205,6 +205,10 @@ in Terraform state, a `terraform destroy` or `terraform apply` that would delete * `reference_file_schema_uri` - (Optional) When creating an external table, the user can provide a reference file with the table schema. This is enabled for the following formats: AVRO, PARQUET, ORC. +* `metadata_cache_mode` - (Optional) Metadata Cache Mode for the table. Set this to enable caching of metadata from external data source. Valid values are `AUTOMATIC` and `MANUAL`. + +* `object_metadata` - (Optional) Object Metadata is used to create Object Tables. Object Tables contain a listing of objects (with their metadata) found at the sourceUris. If `object_metadata` is set, `source_format` should be omitted. + The `csv_options` block supports: * `quote` (Required) - The value that is used to quote data sections in a diff --git a/mmv1/third_party/terraform/website/docs/r/compute_shared_vpc_service_project.html.markdown b/mmv1/third_party/terraform/website/docs/r/compute_shared_vpc_service_project.html.markdown index a9224491e080..bec341cbe953 100644 --- a/mmv1/third_party/terraform/website/docs/r/compute_shared_vpc_service_project.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/compute_shared_vpc_service_project.html.markdown @@ -37,6 +37,8 @@ The following arguments are expected: * `service_project` - (Required) The ID of the project that will serve as a Shared VPC service project. +* `deletion_policy` - (Optional) The deletion policy for the shared VPC service. Setting ABANDON allows the resource to be abandoned rather than deleted. Possible values are: "ABANDON". + ## Attributes Reference In addition to the arguments listed above, the following computed attributes are exported: diff --git a/mmv1/third_party/terraform/website/docs/r/container_node_pool.html.markdown b/mmv1/third_party/terraform/website/docs/r/container_node_pool.html.markdown index 9456e67efb58..96f15535e856 100644 --- a/mmv1/third_party/terraform/website/docs/r/container_node_pool.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/container_node_pool.html.markdown @@ -241,6 +241,8 @@ cluster. Specifying COMPACT placement policy type places node pool's nodes in a closer physical proximity in order to reduce network latency between nodes. +* `tpu_topology` - (Optional, Beta) The [TPU placement topology](https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies) for pod slice node pool. + ## Attributes Reference In addition to the arguments listed above, the following computed attributes are exported: diff --git a/mmv1/third_party/terraform/website/docs/r/os_config_os_policy_assignment.html.markdown b/mmv1/third_party/terraform/website/docs/r/os_config_os_policy_assignment.html.markdown index 065726040db6..500aee593ad6 100644 --- a/mmv1/third_party/terraform/website/docs/r/os_config_os_policy_assignment.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/os_config_os_policy_assignment.html.markdown @@ -550,8 +550,8 @@ The following arguments are supported: * `path` - (Required) The absolute path of the file within the VM. * `state` - (Required) Desired state of the file. Possible values are: - `OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED`, `COMPLIANT`, `NON_COMPLIANT`, - `UNKNOWN`, `NO_OS_POLICIES_APPLICABLE`. + `DESIRED_STATE_UNSPECIFIED`, `PRESENT`, `ABSENT`, + `CONTENTS_MATCH`. * `permissions` - (Output) Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file diff --git a/mmv1/third_party/terraform/website/docs/r/sql_database_instance.html.markdown b/mmv1/third_party/terraform/website/docs/r/sql_database_instance.html.markdown index 97da2dd5ddc7..4ba8f5b721ce 100644 --- a/mmv1/third_party/terraform/website/docs/r/sql_database_instance.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/sql_database_instance.html.markdown @@ -157,6 +157,22 @@ provider "google-beta" { } ``` +### ENTERPRISE_PLUS Instance with data_cache_config + +```hcl +resource "google_sql_database_instance" "main" { + name = "enterprise-plus-main-instance" + database_version = "MYSQL_8_0_31" + settings { + tier = "db-perf-optimized-N-2" + edition = "ENTERPRISE_PLUS" + data_cache_config { + data_cache_enabled = true + } + } +} +``` + ## Argument Reference The following arguments are supported: @@ -228,6 +244,8 @@ The `settings` block supports: for more details and supported versions. Postgres supports only shared-core machine types, and custom machine types such as `db-custom-2-13312`. See the [Custom Machine Type Documentation](https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#create) to learn about specifying custom machine types. +* `edition` - (Optional) The edition of the instance, can be `ENTERPRISE` or `ENTERPRISE_PLUS`. + The optional `settings.advanced_machine_features` subblock supports: * `threads_per_core` - (Optional) The number of threads per core. The value of this flag can be 1 or 2. To disable SMT, set this flag to 1. Only available in Cloud SQL for SQL Server instances. See [smt](https://cloud.google.com/sql/docs/sqlserver/create-instance#smt-create-instance) for more details. @@ -273,6 +291,11 @@ The optional `settings.active_directory_config` subblock supports: * `domain` - (Required) The domain name for the active directory (e.g., mydomain.com). Can only be used with SQL Server. +The optional `settings.data_cache_config` subblock supports: + +* `data_cache_enabled` - (Optional) Whether data cache is enabled for the instance. Defaults to `false` + Can only be used with MYSQL. + The optional `settings.deny_maintenance_period` subblock supports: * `end_date` - (Required) "deny maintenance period" end date. If the year of the end date is empty, the year of the start date also must be empty. In this case, it means the no maintenance interval recurs every year. The date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01 diff --git a/tools/issue-labeler/enrolled_teams.yaml b/tools/issue-labeler/enrolled_teams.yaml new file mode 100755 index 000000000000..e29ef4565eca --- /dev/null +++ b/tools/issue-labeler/enrolled_teams.yaml @@ -0,0 +1,138 @@ +services/accesscontextmanager: +- google_access_context_manager_ +services/alloydb: +- google_alloydb_ +services/apigateway: +- google_api_gateway_ +services/apigee: +- google_apigee_ +services/artifactregistry: +- google_artifact_registry_ +services/beyondcorp: +- google_beyondcorp_ +services/bigquery: +- google_bigquery_ +services/bigtableadmin: +- google_bigtable_ +services/billingbudgets: +- google_billing_budget +services/certificatemanager: +- google_certificate_manager_ +services/cloudbilling: +- google_billing_account +- google_billing_subaccount +services/cloudbuild: +- google_cloudbuild_ +- google_cloudbuildv2_ +services/cloudfunctions: +- google_cloudfunctions_ +- google_cloudfunctions2_ +services/cloudkms: +- google_kms_ +services/cloudscheduler: +- google_cloud_scheduler_ +services/cloudtasks: +- google_cloud_tasks_ +services/composer: +- google_composer_ +services/compute-nat: +- google_compute_router_nat +services/compute-regional-l7-load-balancer: +- google_compute_region_target_http_proxy +- google_compute_region_target_https_proxy +services/container: +- google_container_cluster +- google_container_engine_versions +- google_container_node_pool +services/dataproc: +- google_dataproc_cluster +- google_dataproc_autoscaling_policy +- google_dataproc_job +- google_dataproc_workflow_template +- google_dataproc_batch +services/dlp: +- google_data_loss_prevention_ +services/edgenetwork: +- google_edgenetwork_ +services/eventarc: +- google_eventarc_ +services/filestore: +- google_filestore_ +services/firebase: +- google_firebase_ +- google_firebaserules_ +services/firestore-controlplane: +- google_firestore_database +services/firestore-dataplane: +- google_firestore_document +- google_firestore_index +- google_firestore_ttl +services/gkebackup: +- google_gke_backup_ +services/gkehub: +- google_gke_hub_ +services/gkemulticloud: +- google_container_aws_ +- google_container_azure_ +- google_container_attached_ +services/gkeonprem: +- google_gkeonprem_ +services/healthcare: +- google_healthcare_ +services/iam-core: +- google_organization_iam_custom_role +- google_project_iam_custom_role +- google_iam_deny_policy +- google_iam_policy +- google_iam_role +- google_iam_testable_permissions +services/iam-serviceaccount: +- google_service_account +services/iam-wlid: +- google_iam_access_boundary_policy +- google_iam_workload_identity_pool +- google_iam_workload_identity_pool_provider +services/iam-workforce: +- google_iam_workforce_pool +services/identitytoolkit: +- google_identity_platform_ +services/ids: +- google_cloud_ids_ +services/logging: +- google_logging_ +services/looker-core: +- google_looker_instance +services/monitoring-alerting: +- google_monitoring_notification_channel +- google_monitoring_alert_policy +services/monitoring-services: +- google_monitoring_custom_service +- google_monitoring_dashboard +- google_monitoring_monitored_project +- google_monitoring_service_ +- google_monitoring_slo +- google_monitoring_istio_canonical_service +services/orgpolicy: +- google_org_policy_ +services/privateca: +- google_privateca_ +services/pubsublite: +- google_pubsub_lite_ +services/redis-instance: +- google_redis_instance +services/run: +- google_cloud_run_ +- google_cloud_run_v2_ +services/secretmanager: +- google_secret_manager_ +services/spanner: +- google_spanner_ +services/sqladmin: +- google_sql_ +services/storage: +- google_storage_bucket_ +- google_storage_default_object_ +- google_storage_hmac_key +- google_storage_notification +- google_storage_object_ +- google_storage_project_service_account diff --git a/tools/issue-labeler/go.mod b/tools/issue-labeler/go.mod new file mode 100644 index 000000000000..4e8c39c87b0f --- /dev/null +++ b/tools/issue-labeler/go.mod @@ -0,0 +1,10 @@ +module github.com/trodge/magic-modules/issue-labeler/tools/issue-labeler + +go 1.19 + +require ( + github.com/golang/glog v1.1.1 + gopkg.in/yaml.v2 v2.4.0 +) + +require gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect diff --git a/tools/issue-labeler/go.sum b/tools/issue-labeler/go.sum new file mode 100644 index 000000000000..0a5a64b09c47 --- /dev/null +++ b/tools/issue-labeler/go.sum @@ -0,0 +1,12 @@ +github.com/golang/glog v1.1.1 h1:jxpi2eWoU84wbX9iIEyAeeoac3FLuifZpY9tcNUD9kw= +github.com/golang/glog v1.1.1/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/tools/issue-labeler/labels.go b/tools/issue-labeler/labels.go new file mode 100644 index 000000000000..912a8ffe320e --- /dev/null +++ b/tools/issue-labeler/labels.go @@ -0,0 +1,31 @@ +package main + +import ( + "regexp" + "sort" + "strings" + + "github.com/golang/glog" +) + +func labels(issueBody string, enrolledTeams map[string][]string) string { + sectionRegexp := regexp.MustCompile(`### (New or )?Affected Resource\(s\)[^#]+`) + affectedResources := sectionRegexp.FindString(issueBody) + var labels []string + for label, resources := range enrolledTeams { + for _, resource := range resources { + if strings.Contains(affectedResources, resource) { + glog.Infof("found resource %q, applying label %q", resource, label) + labels = append(labels, "\""+label+"\"") + break + } + } + } + + if len(labels) > 0 { + labels = append(labels, "\"forward/review\"") + sort.Strings(labels) + return "[" + strings.Join(labels, ", ") + "]" + } + return "" +} diff --git a/tools/issue-labeler/labels_test.go b/tools/issue-labeler/labels_test.go new file mode 100644 index 000000000000..3e7ae98916eb --- /dev/null +++ b/tools/issue-labeler/labels_test.go @@ -0,0 +1,42 @@ +package main + +import ( + "os" + "testing" + + "github.com/golang/glog" + "gopkg.in/yaml.v2" +) + +func TestLabels(t *testing.T) { + file, err := os.ReadFile("enrolled_teams.yaml") + if err != nil { + glog.Exitf("Error reading enrolled teams yaml: %v", err) + } + enrolledTeams := make(map[string][]string) + err = yaml.Unmarshal(file, &enrolledTeams) + if err != nil { + glog.Exitf("Error unmarshalling enrolled teams yaml: %v", err) + } + for _, tc := range []struct { + issueBody string + expectedLabels string + }{ + { + issueBody: `### New or Affected Resource(s): + google_gke_hub_feature + google_storage_hmac_key + #`, + expectedLabels: `["forward/review", "services/gkehub", "services/storage"]`, + }, + { + issueBody: `### New or Affected Resource(s): + #`, + expectedLabels: "", + }, + } { + if actualLabels := labels(tc.issueBody, enrolledTeams); actualLabels != tc.expectedLabels { + t.Errorf("unexpected labels for issue body %s: %s, expected %s", tc.issueBody, actualLabels, tc.expectedLabels) + } + } +} diff --git a/tools/issue-labeler/main.go b/tools/issue-labeler/main.go new file mode 100644 index 000000000000..3034c2bb33ae --- /dev/null +++ b/tools/issue-labeler/main.go @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "os" + + "github.com/golang/glog" + "gopkg.in/yaml.v2" +) + +func main() { + issueBody := os.Getenv("ISSUE_BODY") + file, err := os.ReadFile("enrolled_teams.yaml") + if err != nil { + glog.Exitf("Error reading enrolled teams yaml: %v", err) + } + enrolledTeams := make(map[string][]string) + err = yaml.Unmarshal(file, &enrolledTeams) + if err != nil { + glog.Exitf("Error unmarshalling enrolled teams yaml: %v", err) + } + fmt.Println(labels(issueBody, enrolledTeams)) +} diff --git a/tools/missing-test-detector/reader.go b/tools/missing-test-detector/reader.go index 7c37dcac9306..2846efe7b7a5 100644 --- a/tools/missing-test-detector/reader.go +++ b/tools/missing-test-detector/reader.go @@ -101,7 +101,9 @@ func readTestFunc(testFunc *ast.FuncDecl, funcDecls map[string]*ast.FuncDecl, va if exprStmt, ok := stmt.(*ast.ExprStmt); ok { if callExpr, ok := exprStmt.X.(*ast.CallExpr); ok { // This is a call expression. - if ident, ok := callExpr.Fun.(*ast.Ident); ok && ident.Name == "VcrTest" { + ident, isIdent := callExpr.Fun.(*ast.Ident) + selExpr, isSelExpr := callExpr.Fun.(*ast.SelectorExpr) + if isIdent && ident.Name == "VcrTest" || isSelExpr && selExpr.Sel.Name == "VcrTest" { return readVcrTestCall(callExpr, funcDecls, varDecls) } } diff --git a/tools/missing-test-detector/testdata/covered_resource_test.go b/tools/missing-test-detector/testdata/covered_resource_test.go index eff1b1ceee67..ab21e801bd57 100644 --- a/tools/missing-test-detector/testdata/covered_resource_test.go +++ b/tools/missing-test-detector/testdata/covered_resource_test.go @@ -5,10 +5,11 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-provider-google-beta/google-beta/acctest" ) func TestAccCoveredResource(t *testing.T) { - VcrTest(t, resource.TestCase{ + acctest.VcrTest(t, resource.TestCase{ Steps: []resource.TestStep{ { Config: testAccCoveredResource(), diff --git a/tools/missing-test-detector/testdata/multiple_resource_test.go b/tools/missing-test-detector/testdata/multiple_resource_test.go index a9e6fff7dd15..1a4c3eeb0a21 100644 --- a/tools/missing-test-detector/testdata/multiple_resource_test.go +++ b/tools/missing-test-detector/testdata/multiple_resource_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-provider-google-beta/google-beta/acctest" ) func TestAccMultipleResources(t *testing.T) { diff --git a/tools/missing-test-detector/testdata/uncovered_resource_test.go b/tools/missing-test-detector/testdata/uncovered_resource_test.go index 7bc0090d544d..feaa11ce27d7 100644 --- a/tools/missing-test-detector/testdata/uncovered_resource_test.go +++ b/tools/missing-test-detector/testdata/uncovered_resource_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-provider-google-beta/google-beta/acctest" ) func TestAccUncoveredResource(t *testing.T) { diff --git a/tpgtools/api/cloudbuildv2/samples/ghe_complete_connection.yaml b/tpgtools/api/cloudbuildv2/samples/ghe_complete_connection.yaml index 00c64c708a45..aa8975d661d7 100755 --- a/tpgtools/api/cloudbuildv2/samples/ghe_complete_connection.yaml +++ b/tpgtools/api/cloudbuildv2/samples/ghe_complete_connection.yaml @@ -15,7 +15,7 @@ name: ghe_complete_connection description: Creates a GitHub Enterprise connection. type: connection versions: -- beta +- ga resource: samples/ghe_complete.connection.json variables: - name: connection diff --git a/tpgtools/api/cloudbuildv2/samples/ghe_connection.yaml b/tpgtools/api/cloudbuildv2/samples/ghe_connection.yaml index 437c30c77a9b..87f8316550a8 100755 --- a/tpgtools/api/cloudbuildv2/samples/ghe_connection.yaml +++ b/tpgtools/api/cloudbuildv2/samples/ghe_connection.yaml @@ -15,7 +15,7 @@ name: ghe_connection description: Creates and updates a GitHub Enterprise connection. type: connection versions: -- beta +- ga resource: samples/ghe_initial.connection.json updates: - resource: samples/ghe_complete.connection.json diff --git a/tpgtools/api/cloudbuildv2/samples/ghe_priv_connection.yaml b/tpgtools/api/cloudbuildv2/samples/ghe_priv_connection.yaml index a8af9551288a..73025a7cf763 100755 --- a/tpgtools/api/cloudbuildv2/samples/ghe_priv_connection.yaml +++ b/tpgtools/api/cloudbuildv2/samples/ghe_priv_connection.yaml @@ -15,7 +15,7 @@ name: ghe_priv_connection description: Creates a connection to a private server using Service Directory. type: connection versions: -- beta +- ga resource: samples/ghe_priv.connection.json variables: - name: connection diff --git a/tpgtools/api/cloudbuildv2/samples/ghe_priv_update_connection.yaml b/tpgtools/api/cloudbuildv2/samples/ghe_priv_update_connection.yaml index ffbbb7aa9a11..5e12dbf3d70e 100755 --- a/tpgtools/api/cloudbuildv2/samples/ghe_priv_update_connection.yaml +++ b/tpgtools/api/cloudbuildv2/samples/ghe_priv_update_connection.yaml @@ -15,7 +15,7 @@ name: ghe_priv_update_connection description: Creates and updates a connection to a private server using Service Directory. type: connection versions: -- beta +- ga resource: samples/ghe_initial.connection.json updates: - resource: samples/ghe_priv.connection.json diff --git a/tpgtools/api/cloudbuildv2/samples/ghe_repository.yaml b/tpgtools/api/cloudbuildv2/samples/ghe_repository.yaml index 0785ed6f383f..0e457ebaa459 100755 --- a/tpgtools/api/cloudbuildv2/samples/ghe_repository.yaml +++ b/tpgtools/api/cloudbuildv2/samples/ghe_repository.yaml @@ -15,7 +15,7 @@ name: ghe_repository description: Creates a GitHub repository. type: repository versions: -- beta +- ga resource: samples/ghe.repository.json dependencies: - samples/ghe_complete.connection.json diff --git a/tpgtools/api/cloudbuildv2/samples/github_connection.yaml b/tpgtools/api/cloudbuildv2/samples/github_connection.yaml index 3e78df4eed30..f96c3d242533 100755 --- a/tpgtools/api/cloudbuildv2/samples/github_connection.yaml +++ b/tpgtools/api/cloudbuildv2/samples/github_connection.yaml @@ -15,7 +15,7 @@ name: github_connection description: Creates and updates a GitHub connection. type: connection versions: -- beta +- ga resource: samples/github_initial.connection.json updates: - resource: samples/github_update.connection.json diff --git a/tpgtools/api/cloudbuildv2/samples/github_repository.yaml b/tpgtools/api/cloudbuildv2/samples/github_repository.yaml index 8e5f5f998670..416dc48815f9 100755 --- a/tpgtools/api/cloudbuildv2/samples/github_repository.yaml +++ b/tpgtools/api/cloudbuildv2/samples/github_repository.yaml @@ -15,7 +15,7 @@ name: github_repository description: Creates a GitHub repository. type: repository versions: -- beta +- ga resource: samples/github.repository.json dependencies: - samples/github_update.connection.json diff --git a/tpgtools/api/cloudbuildv2/samples/gitlab_connection.yaml b/tpgtools/api/cloudbuildv2/samples/gitlab_connection.yaml index c8166cc58374..af304f627f0f 100755 --- a/tpgtools/api/cloudbuildv2/samples/gitlab_connection.yaml +++ b/tpgtools/api/cloudbuildv2/samples/gitlab_connection.yaml @@ -15,7 +15,7 @@ name: gitlab_connection description: Creates a gitlab.com connection. type: connection versions: -- beta +- ga resource: samples/gitlab.connection.json variables: - name: connection diff --git a/tpgtools/api/cloudbuildv2/samples/gitlab_repository.yaml b/tpgtools/api/cloudbuildv2/samples/gitlab_repository.yaml index 26a3a0186cbe..8c6ec92cff67 100755 --- a/tpgtools/api/cloudbuildv2/samples/gitlab_repository.yaml +++ b/tpgtools/api/cloudbuildv2/samples/gitlab_repository.yaml @@ -15,7 +15,7 @@ name: gitlab_repository description: Creates a gitlab repository. type: repository versions: -- beta +- ga resource: samples/gitlab.repository.json dependencies: - samples/gitlab.connection.json diff --git a/tpgtools/api/cloudbuildv2/samples/gle_connection.yaml b/tpgtools/api/cloudbuildv2/samples/gle_connection.yaml index 0d45649824db..08c141636bb1 100755 --- a/tpgtools/api/cloudbuildv2/samples/gle_connection.yaml +++ b/tpgtools/api/cloudbuildv2/samples/gle_connection.yaml @@ -15,7 +15,7 @@ name: gle_connection description: Creates a GLE connection then update to an older version. type: connection versions: -- beta +- ga resource: samples/gle.connection.json updates: - resource: samples/gle_old.connection.json diff --git a/tpgtools/api/cloudbuildv2/samples/gle_old_connection.yaml b/tpgtools/api/cloudbuildv2/samples/gle_old_connection.yaml index 6740f3309535..ba81509db2c7 100755 --- a/tpgtools/api/cloudbuildv2/samples/gle_old_connection.yaml +++ b/tpgtools/api/cloudbuildv2/samples/gle_old_connection.yaml @@ -15,7 +15,7 @@ name: gle_old_connection description: Creates a GLE connection on an old version then update to a newer version. type: connection versions: -- beta +- ga resource: samples/gle_old.connection.json updates: - resource: samples/gle.connection.json diff --git a/tpgtools/api/cloudbuildv2/samples/gle_priv_connection.yaml b/tpgtools/api/cloudbuildv2/samples/gle_priv_connection.yaml index 32e4621b4d6c..9a416479ae7b 100755 --- a/tpgtools/api/cloudbuildv2/samples/gle_priv_connection.yaml +++ b/tpgtools/api/cloudbuildv2/samples/gle_priv_connection.yaml @@ -15,7 +15,7 @@ name: gle_priv_connection description: Creates a connection to a private server using Service Directory. type: connection versions: -- beta +- ga resource: samples/gle_priv.connection.json variables: - name: connection diff --git a/tpgtools/api/cloudbuildv2/samples/gle_priv_update_connection.yaml b/tpgtools/api/cloudbuildv2/samples/gle_priv_update_connection.yaml index 4e3cb5fe727d..d38c63343248 100755 --- a/tpgtools/api/cloudbuildv2/samples/gle_priv_update_connection.yaml +++ b/tpgtools/api/cloudbuildv2/samples/gle_priv_update_connection.yaml @@ -15,7 +15,7 @@ name: gle_priv_update_connection description: Creates and updates a connection to a private server using Service Directory. type: connection versions: -- beta +- ga resource: samples/gle.connection.json updates: - resource: samples/gle_priv.connection.json diff --git a/tpgtools/api/cloudbuildv2/samples/gle_repository.yaml b/tpgtools/api/cloudbuildv2/samples/gle_repository.yaml index a3b581e2a3d5..11997f3a30e2 100755 --- a/tpgtools/api/cloudbuildv2/samples/gle_repository.yaml +++ b/tpgtools/api/cloudbuildv2/samples/gle_repository.yaml @@ -15,7 +15,7 @@ name: gle_repository description: Creates a GLE repository. type: repository versions: -- beta +- ga resource: samples/gle.repository.json dependencies: - samples/gle.connection.json diff --git a/tpgtools/api/clouddeploy/samples/basic.delivery_pipeline.json b/tpgtools/api/clouddeploy/samples/basic.delivery_pipeline.json index 0d569904fbfd..ba6a8b6f7260 100644 --- a/tpgtools/api/clouddeploy/samples/basic.delivery_pipeline.json +++ b/tpgtools/api/clouddeploy/samples/basic.delivery_pipeline.json @@ -19,6 +19,16 @@ "profiles": [ "example-profile-one", "example-profile-two" + ], + "deployParameters": [ + { + "values": { + "deployParameterKey": "deployParameterValue" + }, + "match_target_labels": { + "my_first_label": "example-label-1" + } + } ] }, { diff --git a/tpgtools/api/clouddeploy/samples/basic.target.json b/tpgtools/api/clouddeploy/samples/basic.target.json index 0f32d945c923..d185d12184f6 100644 --- a/tpgtools/api/clouddeploy/samples/basic.target.json +++ b/tpgtools/api/clouddeploy/samples/basic.target.json @@ -15,5 +15,8 @@ "requireApproval": false, "gke": { "cluster": "projects/{{project}}/locations/{{region}}/clusters/example-cluster-name" + }, + "deployParameters": { + "deployParameterKey": "deployParameterValue" } } diff --git a/tpgtools/handwritten/orgpolicy_utils.go b/tpgtools/handwritten/orgpolicy_utils.go index 24e0d70283bf..2cf61cf67ad1 100644 --- a/tpgtools/handwritten/orgpolicy_utils.go +++ b/tpgtools/handwritten/orgpolicy_utils.go @@ -24,6 +24,11 @@ func ResourceOrgPolicyPolicyCustomImport(d *schema.ResourceData, meta interface{ if err != nil { return fmt.Errorf("Error constructing id: %s", err) } + + // reset name to match the one from resourceOrgPolicyPolicyRead + if err := d.Set("name", id); err != nil { + return fmt.Errorf("Error setting name: %s", err) + } d.SetId(id) return nil diff --git a/tpgtools/overrides/cloudbuildv2/connection.yaml b/tpgtools/overrides/cloudbuildv2/connection.yaml new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tpgtools/overrides/cloudbuildv2/repository.yaml b/tpgtools/overrides/cloudbuildv2/repository.yaml new file mode 100644 index 000000000000..01ea7c579c97 --- /dev/null +++ b/tpgtools/overrides/cloudbuildv2/repository.yaml @@ -0,0 +1,18 @@ +- type: CUSTOM_NAME + # Rename to parent_connection as connection is a reserved word in terraform. + field: connection + details: + name: parent_connection +# TODO: remove once DCL is updpated to not have these fields required. +- type: CUSTOM_SCHEMA_VALUES + field: project + details: + required: false + optional: true + computed: true +- type: CUSTOM_SCHEMA_VALUES + field: location + details: + required: false + optional: true + computed: true diff --git a/tpgtools/overrides/cloudbuildv2/samples/connection/ghe.tf.tmpl b/tpgtools/overrides/cloudbuildv2/samples/connection/ghe.tf.tmpl index a95002cc17d1..2aece6005734 100644 --- a/tpgtools/overrides/cloudbuildv2/samples/connection/ghe.tf.tmpl +++ b/tpgtools/overrides/cloudbuildv2/samples/connection/ghe.tf.tmpl @@ -1,5 +1,4 @@ resource "google_secret_manager_secret" "private-key-secret" { - provider = google-beta secret_id = "ghe-pk-secret" replication { @@ -8,13 +7,11 @@ resource "google_secret_manager_secret" "private-key-secret" { } resource "google_secret_manager_secret_version" "private-key-secret-version" { - provider = google-beta secret = google_secret_manager_secret.private-key-secret.id secret_data = file("private-key.pem") } resource "google_secret_manager_secret" "webhook-secret-secret" { - provider = google-beta secret_id = "github-token-secret" replication { @@ -23,13 +20,11 @@ resource "google_secret_manager_secret" "webhook-secret-secret" { } resource "google_secret_manager_secret_version" "webhook-secret-secret-version" { - provider = google-beta secret = google_secret_manager_secret.webhook-secret-secret.id secret_data = "" } data "google_iam_policy" "p4sa-secretAccessor" { - provider = google-beta binding { role = "roles/secretmanager.secretAccessor" // Here, 123456789 is the Google Cloud project number for the project that contains the connection. @@ -38,19 +33,16 @@ data "google_iam_policy" "p4sa-secretAccessor" { } resource "google_secret_manager_secret_iam_policy" "policy-pk" { - provider = google-beta secret_id = google_secret_manager_secret.private-key-secret.secret_id policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data } resource "google_secret_manager_secret_iam_policy" "policy-whs" { - provider = google-beta secret_id = google_secret_manager_secret.webhook-secret-secret.secret_id policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data } resource "google_cloudbuildv2_connection" "my-connection" { - provider = google-beta location = "us-central1" name = "my-terraform-ghe-connection" diff --git a/tpgtools/overrides/cloudbuildv2/samples/connection/github.tf.tmpl b/tpgtools/overrides/cloudbuildv2/samples/connection/github.tf.tmpl index 240ea8bc054d..f25048ef1443 100644 --- a/tpgtools/overrides/cloudbuildv2/samples/connection/github.tf.tmpl +++ b/tpgtools/overrides/cloudbuildv2/samples/connection/github.tf.tmpl @@ -1,5 +1,4 @@ resource "google_secret_manager_secret" "github-token-secret" { - provider = google-beta secret_id = "github-token-secret" replication { @@ -8,13 +7,11 @@ resource "google_secret_manager_secret" "github-token-secret" { } resource "google_secret_manager_secret_version" "github-token-secret-version" { - provider = google-beta secret = google_secret_manager_secret.github-token-secret.id secret_data = file("my-github-token.txt") } data "google_iam_policy" "p4sa-secretAccessor" { - provider = google-beta binding { role = "roles/secretmanager.secretAccessor" // Here, {{projectNum}} is the Google Cloud project number for {{project}}. @@ -23,13 +20,11 @@ data "google_iam_policy" "p4sa-secretAccessor" { } resource "google_secret_manager_secret_iam_policy" "policy" { - provider = google-beta secret_id = google_secret_manager_secret.github-token-secret.secret_id policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data } resource "google_cloudbuildv2_connection" "my-connection" { - provider = google-beta location = "{{region}}" name = "my-connection" diff --git a/tpgtools/overrides/cloudbuildv2/samples/repository/ghe.tf.tmpl b/tpgtools/overrides/cloudbuildv2/samples/repository/ghe.tf.tmpl index 1a0143511e9b..3f6ec4778b26 100644 --- a/tpgtools/overrides/cloudbuildv2/samples/repository/ghe.tf.tmpl +++ b/tpgtools/overrides/cloudbuildv2/samples/repository/ghe.tf.tmpl @@ -1,5 +1,4 @@ resource "google_secret_manager_secret" "private-key-secret" { - provider = google-beta secret_id = "ghe-pk-secret" replication { @@ -8,13 +7,11 @@ resource "google_secret_manager_secret" "private-key-secret" { } resource "google_secret_manager_secret_version" "private-key-secret-version" { - provider = google-beta secret = google_secret_manager_secret.private-key-secret.id secret_data = file("private-key.pem") } resource "google_secret_manager_secret" "webhook-secret-secret" { - provider = google-beta secret_id = "github-token-secret" replication { @@ -23,13 +20,11 @@ resource "google_secret_manager_secret" "webhook-secret-secret" { } resource "google_secret_manager_secret_version" "webhook-secret-secret-version" { - provider = google-beta secret = google_secret_manager_secret.webhook-secret-secret.id secret_data = "" } data "google_iam_policy" "p4sa-secretAccessor" { - provider = google-beta binding { role = "roles/secretmanager.secretAccessor" // Here, 123456789 is the Google Cloud project number for the project that contains the connection. @@ -38,19 +33,16 @@ data "google_iam_policy" "p4sa-secretAccessor" { } resource "google_secret_manager_secret_iam_policy" "policy-pk" { - provider = google-beta secret_id = google_secret_manager_secret.private-key-secret.secret_id policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data } resource "google_secret_manager_secret_iam_policy" "policy-whs" { - provider = google-beta secret_id = google_secret_manager_secret.webhook-secret-secret.secret_id policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data } resource "google_cloudbuildv2_connection" "my-connection" { - provider = google-beta location = "us-central1" name = "my-terraform-ghe-connection" @@ -70,7 +62,6 @@ resource "google_cloudbuildv2_connection" "my-connection" { } resource "google_cloudbuildv2_repository" "my-repository" { - provider = google-beta name = "my-terraform-ghe-repo" location = "us-central1" parent_connection = google_cloudbuildv2_connection.my-connection.id diff --git a/tpgtools/overrides/cloudbuildv2/samples/repository/github.tf.tmpl b/tpgtools/overrides/cloudbuildv2/samples/repository/github.tf.tmpl index 06a29ecfc84e..3058a12649d1 100644 --- a/tpgtools/overrides/cloudbuildv2/samples/repository/github.tf.tmpl +++ b/tpgtools/overrides/cloudbuildv2/samples/repository/github.tf.tmpl @@ -1,5 +1,4 @@ resource "google_secret_manager_secret" "github-token-secret" { - provider = google-beta secret_id = "github-token-secret" replication { @@ -8,13 +7,11 @@ resource "google_secret_manager_secret" "github-token-secret" { } resource "google_secret_manager_secret_version" "github-token-secret-version" { - provider = google-beta secret = google_secret_manager_secret.github-token-secret.id secret_data = file("my-github-token.txt") } data "google_iam_policy" "p4sa-secretAccessor" { - provider = google-beta binding { role = "roles/secretmanager.secretAccessor" // Here, {{projectNum}} is the Google Cloud project number for {{project}}. @@ -23,13 +20,11 @@ data "google_iam_policy" "p4sa-secretAccessor" { } resource "google_secret_manager_secret_iam_policy" "policy" { - provider = google-beta secret_id = google_secret_manager_secret.github-token-secret.secret_id policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data } resource "google_cloudbuildv2_connection" "my-connection" { - provider = google-beta location = "{{region}}" name = "my-connection" @@ -42,7 +37,6 @@ resource "google_cloudbuildv2_connection" "my-connection" { } resource "google_cloudbuildv2_repository" "my-repository" { - provider = google-beta location = "{{region}}" name = "my-repo" parent_connection = google_cloudbuildv2_connection.my-connection.name diff --git a/tpgtools/overrides/cloudbuildv2/tpgtools_product.yaml b/tpgtools/overrides/cloudbuildv2/tpgtools_product.yaml new file mode 100644 index 000000000000..dd8f9eabb9de --- /dev/null +++ b/tpgtools/overrides/cloudbuildv2/tpgtools_product.yaml @@ -0,0 +1,9 @@ +## product level overrides + +- type: PRODUCT_DOCS_SECTION + details: + docssection: Cloud Build v2 + +- type: PRODUCT_BASE_PATH + details: + skip: true diff --git a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule.tf.tmpl b/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule.tf.tmpl index a4a888d77273..e3176d43aee0 100644 --- a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule.tf.tmpl +++ b/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule.tf.tmpl @@ -1,3 +1,13 @@ +resource "google_network_security_address_group" "basic_global_networksecurity_address_group" { + name = "{{policy}}" + parent = "organizations/{{org_id}}" + description = "Sample global networksecurity_address_group" + location = "global" + items = ["208.80.154.224/32"] + type = "IPV4" + capacity = 100 +} + resource "google_folder" "folder" { display_name = "{{policy}}" parent = "organizations/{{org_id}}" @@ -11,12 +21,12 @@ resource "google_compute_firewall_policy" "default" { resource "google_compute_firewall_policy_rule" "primary" { firewall_policy = google_compute_firewall_policy.default.name - description = "Resource created for Terraform acceptance testing" - priority = 9000 - enable_logging = true - action = "allow" - direction = "EGRESS" - disabled = false + description = "Resource created for Terraform acceptance testing" + priority = 9000 + enable_logging = true + action = "allow" + direction = "EGRESS" + disabled = false match { layer4_configs { ip_protocol = "tcp" @@ -28,8 +38,10 @@ resource "google_compute_firewall_policy_rule" "primary" { } dest_ip_ranges = ["11.100.0.1/32"] dest_fqdns = [] - dest_region_codes = [] + dest_region_codes = ["US"] dest_threat_intelligences = ["iplist-known-malicious-ips"] + src_address_groups = [] + dest_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] } target_service_accounts = ["{{test_service_account}}"] } diff --git a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule.yaml b/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule.yaml index 4668ac6536d8..60902db46a36 100644 --- a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule.yaml +++ b/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule.yaml @@ -1,5 +1,3 @@ -versions: -- ga updates: - resource: ./basic_fir_sec_rule_update.tf.tmpl variables: diff --git a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_addr_groups.tf.tmpl b/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_addr_groups.tf.tmpl deleted file mode 100644 index 39ec8e783ffd..000000000000 --- a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_addr_groups.tf.tmpl +++ /dev/null @@ -1,51 +0,0 @@ -resource "google_network_security_address_group" "basic_global_networksecurity_address_group" { - provider = google-beta - name = "{{policy}}" - parent = "organizations/{{org_id}}" - description = "Sample global networksecurity_address_group" - location = "global" - items = ["208.80.154.224/32"] - type = "IPV4" - capacity = 100 -} - -resource "google_folder" "folder" { - provider = google-beta - display_name = "{{policy}}" - parent = "organizations/{{org_id}}" -} - -resource "google_compute_firewall_policy" "default" { - provider = google-beta - parent = google_folder.folder.id - short_name = "{{policy}}" - description = "Resource created for Terraform acceptance testing" -} - -resource "google_compute_firewall_policy_rule" "primary" { - provider = google-beta - firewall_policy = google_compute_firewall_policy.default.name - description = "Resource created for Terraform acceptance testing" - priority = 9000 - enable_logging = true - action = "allow" - direction = "EGRESS" - disabled = false - match { - layer4_configs { - ip_protocol = "tcp" - ports = [8080] - } - layer4_configs { - ip_protocol = "udp" - ports = [22] - } - dest_ip_ranges = ["11.100.0.1/32"] - dest_fqdns = [] - dest_region_codes = ["US"] - dest_threat_intelligences = ["iplist-known-malicious-ips"] - src_address_groups = [] - dest_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] - } - target_service_accounts = ["{{test_service_account}}"] -} diff --git a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_addr_groups.yaml b/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_addr_groups.yaml deleted file mode 100644 index 846942638493..000000000000 --- a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_addr_groups.yaml +++ /dev/null @@ -1,19 +0,0 @@ -versions: -- beta -updates: -- resource: ./basic_fir_sec_rule_addr_groups_update.tf.tmpl -variables: -- name: policy - type: resource_name -- name: tagkey - type: resource_name -- name: tagvalue - type: resource_name -- name: project - type: project -- name: network - type: resource_name -- name: org_id - type: org_id -- name: test_service_account - type: test_service_account diff --git a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_addr_groups_update.tf.tmpl b/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_addr_groups_update.tf.tmpl deleted file mode 100644 index c906aadd7519..000000000000 --- a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_addr_groups_update.tf.tmpl +++ /dev/null @@ -1,51 +0,0 @@ -resource "google_network_security_address_group" "basic_global_networksecurity_address_group" { - provider = google-beta - name = "{{policy}}" - parent = "organizations/{{org_id}}" - description = "Sample global networksecurity_address_group" - location = "global" - items = ["208.80.154.224/32"] - type = "IPV4" - capacity = 100 -} - -resource "google_folder" "folder" { - provider = google-beta - display_name = "{{policy}}" - parent = "organizations/{{org_id}}" -} - -resource "google_compute_firewall_policy" "default" { - provider = google-beta - parent = google_folder.folder.id - short_name = "{{policy}}" - description = "Resource created for Terraform acceptance testing" -} - -resource "google_compute_firewall_policy_rule" "primary" { - provider = google-beta - firewall_policy = google_compute_firewall_policy.default.name - description = "Resource created for Terraform acceptance testing - Updated" - priority = 9000 - enable_logging = true - action = "allow" - direction = "EGRESS" - disabled = false - match { - layer4_configs { - ip_protocol = "tcp" - ports = [8080] - } - layer4_configs { - ip_protocol = "udp" - ports = [22] - } - dest_ip_ranges = ["11.100.0.1/32", "10.0.0.0/24"] - dest_fqdns = ["google.com"] - dest_region_codes = ["US"] - dest_threat_intelligences = ["iplist-known-malicious-ips"] - src_address_groups = [] - dest_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] - } - target_service_accounts = ["{{test_service_account}}"] -} diff --git a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_update.tf.tmpl b/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_update.tf.tmpl index 8de3d046aab6..82930ce33b3f 100644 --- a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_update.tf.tmpl +++ b/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_update.tf.tmpl @@ -1,3 +1,13 @@ +resource "google_network_security_address_group" "basic_global_networksecurity_address_group" { + name = "{{policy}}" + parent = "organizations/{{org_id}}" + description = "Sample global networksecurity_address_group" + location = "global" + items = ["208.80.154.224/32"] + type = "IPV4" + capacity = 100 +} + resource "google_folder" "folder" { display_name = "{{policy}}" parent = "organizations/{{org_id}}" @@ -11,12 +21,12 @@ resource "google_compute_firewall_policy" "default" { resource "google_compute_firewall_policy_rule" "primary" { firewall_policy = google_compute_firewall_policy.default.name - description = "Resource created for Terraform acceptance testing - Updated" - priority = 9000 - enable_logging = true - action = "allow" - direction = "EGRESS" - disabled = false + description = "Resource created for Terraform acceptance testing - Updated" + priority = 9000 + enable_logging = true + action = "allow" + direction = "EGRESS" + disabled = false match { layer4_configs { ip_protocol = "tcp" @@ -30,6 +40,8 @@ resource "google_compute_firewall_policy_rule" "primary" { dest_fqdns = ["google.com"] dest_region_codes = ["US"] dest_threat_intelligences = ["iplist-known-malicious-ips"] + src_address_groups = [] + dest_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] } target_service_accounts = ["{{test_service_account}}"] } diff --git a/tpgtools/overrides/compute/samples/firewallpolicyrule/meta.yaml b/tpgtools/overrides/compute/samples/firewallpolicyrule/meta.yaml index 1715b9ed6c41..0c276ef1daa2 100644 --- a/tpgtools/overrides/compute/samples/firewallpolicyrule/meta.yaml +++ b/tpgtools/overrides/compute/samples/firewallpolicyrule/meta.yaml @@ -9,11 +9,8 @@ test_hide: doc_hide_conditional: - location: global file_name: basic_fir_sec_rule.tf.tmpl - - location: global - file_name: basic_fir_sec_rule_addr_groups.tf.tmpl test_hide_conditional: - location: global file_name: basic_fir_sec_rule.tf.tmpl - - location: global - file_name: basic_fir_sec_rule_addr_groups.tf.tmpl + diff --git a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global.tf.tmpl b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global.tf.tmpl index bf2032c494e0..ed57eefc5625 100644 --- a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global.tf.tmpl +++ b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global.tf.tmpl @@ -1,3 +1,13 @@ +resource "google_network_security_address_group" "basic_global_networksecurity_address_group" { + name = "{{policy}}" + parent = "projects/{{project}}" + description = "Sample global networksecurity_address_group" + location = "global" + items = ["208.80.154.224/32"] + type = "IPV4" + capacity = 100 +} + resource "google_compute_network_firewall_policy" "basic_network_firewall_policy" { name = "{{policy}}" description = "Sample global network firewall policy" @@ -28,6 +38,8 @@ resource "google_compute_network_firewall_policy_rule" "primary" { layer4_configs { ip_protocol = "all" } + + src_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] } } diff --git a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global.yaml b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global.yaml index 97e1eff0caf1..3893967d7a29 100644 --- a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global.yaml +++ b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global.yaml @@ -1,7 +1,5 @@ -versions: -- ga updates: -- resource: ./global_net_sec_rule_update.tf.tmpl +- resource: ./global_update.tf.tmpl variables: - name: policy type: resource_name diff --git a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global_net_sec_rule.tf.tmpl b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global_net_sec_rule.tf.tmpl deleted file mode 100644 index 5cc4f328078b..000000000000 --- a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global_net_sec_rule.tf.tmpl +++ /dev/null @@ -1,76 +0,0 @@ -resource "google_network_security_address_group" "basic_global_networksecurity_address_group" { - provider = google-beta - - name = "{{policy}}" - parent = "projects/{{project}}" - description = "Sample global networksecurity_address_group" - location = "global" - items = ["208.80.154.224/32"] - type = "IPV4" - capacity = 100 -} - -resource "google_compute_network_firewall_policy" "basic_network_firewall_policy" { - provider = google-beta - - name = "{{policy}}" - description = "Sample global network firewall policy" - project = "{{project}}" -} - -resource "google_compute_network_firewall_policy_rule" "primary" { - provider = google-beta - - action = "allow" - description = "This is a simple rule description" - direction = "INGRESS" - disabled = false - enable_logging = true - firewall_policy = google_compute_network_firewall_policy.basic_network_firewall_policy.name - priority = 1000 - rule_name = "test-rule" - target_service_accounts = ["{{test_service_account}}"] - - match { - src_ip_ranges = ["10.100.0.1/32"] - src_fqdns = ["google.com"] - src_region_codes = ["US"] - src_threat_intelligences = ["iplist-known-malicious-ips"] - - src_secure_tags { - name = "tagValues/${google_tags_tag_value.basic_value.name}" - } - - layer4_configs { - ip_protocol = "all" - } - - src_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] - } -} - -resource "google_compute_network" "basic_network" { - provider = google-beta - - name = "{{network}}" -} - -resource "google_tags_tag_key" "basic_key" { - provider = google-beta - - description = "For keyname resources." - parent = "organizations/{{org_id}}" - purpose = "GCE_FIREWALL" - short_name = "{{tagkey}}" - purpose_data = { - network = "{{project}}/${google_compute_network.basic_network.name}" - } -} - -resource "google_tags_tag_value" "basic_value" { - provider = google-beta - - description = "For valuename resources." - parent = "tagKeys/${google_tags_tag_key.basic_key.name}" - short_name = "{{tagvalue}}" -} diff --git a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global_net_sec_rule.yaml b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global_net_sec_rule.yaml deleted file mode 100644 index c4f4e370840f..000000000000 --- a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global_net_sec_rule.yaml +++ /dev/null @@ -1,19 +0,0 @@ -versions: -- beta -updates: -- resource: ./global_net_sec_rule_update.tf.tmpl -variables: -- name: policy - type: resource_name -- name: tagkey - type: resource_name -- name: tagvalue - type: resource_name -- name: project - type: project -- name: network - type: resource_name -- name: org_id - type: org_id -- name: test_service_account - type: test_service_account diff --git a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global_net_sec_rule_update.tf.tmpl b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global_net_sec_rule_update.tf.tmpl deleted file mode 100644 index 9dea865e152f..000000000000 --- a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global_net_sec_rule_update.tf.tmpl +++ /dev/null @@ -1,79 +0,0 @@ -resource "google_network_security_address_group" "basic_global_networksecurity_address_group" { - provider = google-beta - - name = "{{policy}}" - parent = "projects/{{project}}" - description = "Sample global networksecurity_address_group. Update" - location = "global" - items = ["208.80.154.224/32"] - type = "IPV4" - capacity = 100 -} - -resource "google_compute_network_firewall_policy" "basic_network_firewall_policy" { - provider = google-beta - - name = "{{policy}}" - description = "Sample global network firewall policy" - project = "{{project}}" -} - -resource "google_compute_network_firewall_policy_rule" "primary" { - provider = google-beta - - action = "deny" - description = "This is an updated rule description" - direction = "EGRESS" - disabled = true - enable_logging = false - firewall_policy = google_compute_network_firewall_policy.basic_network_firewall_policy.name - priority = 1000 - rule_name = "updated-test-rule" - - match { - dest_ip_ranges = ["0.0.0.0/0"] - dest_fqdns = ["example.com"] - dest_region_codes = ["US"] - dest_threat_intelligences = ["iplist-known-malicious-ips"] - - layer4_configs { - ip_protocol = "tcp" - ports = ["123"] - } - - dest_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] - - } - - target_secure_tags { - name = "tagValues/${google_tags_tag_value.basic_value.name}" - } -} - -resource "google_compute_network" "basic_network" { - provider = google-beta - - name = "{{network}}" -} - -resource "google_tags_tag_key" "basic_key" { - provider = google-beta - - description = "For keyname resources." - parent = "organizations/{{org_id}}" - purpose = "GCE_FIREWALL" - short_name = "{{tagkey}}" - - purpose_data = { - network = "{{project}}/${google_compute_network.basic_network.name}" - } -} - - -resource "google_tags_tag_value" "basic_value" { - provider = google-beta - - description = "For valuename resources." - parent = "tagKeys/${google_tags_tag_key.basic_key.name}" - short_name = "{{tagvalue}}" -} diff --git a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global_update.tf.tmpl b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global_update.tf.tmpl index fdf63563aefe..b177dc952550 100644 --- a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global_update.tf.tmpl +++ b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/global_update.tf.tmpl @@ -1,3 +1,13 @@ +resource "google_network_security_address_group" "basic_global_networksecurity_address_group" { + name = "{{policy}}" + parent = "projects/{{project}}" + description = "Sample global networksecurity_address_group. Update" + location = "global" + items = ["208.80.154.224/32"] + type = "IPV4" + capacity = 100 +} + resource "google_compute_network_firewall_policy" "basic_network_firewall_policy" { name = "{{policy}}" description = "Sample global network firewall policy" @@ -24,6 +34,9 @@ resource "google_compute_network_firewall_policy_rule" "primary" { ip_protocol = "tcp" ports = ["123"] } + + dest_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id] + } target_secure_tags { diff --git a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/meta.yaml b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/meta.yaml index 2c793adba081..b94a2dd59dae 100644 --- a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/meta.yaml +++ b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/meta.yaml @@ -9,20 +9,12 @@ test_hide: - basic_regional_network_firewall_policy_rule.yaml doc_hide_conditional: - - location: global - file_name: regional_net_sec_rule.tf.tmpl - - location: region - file_name: global_net_sec_rule.tf.tmpl - location: global file_name: regional.tf.tmpl - location: region file_name: global.tf.tmpl test_hide_conditional: - - location: global - file_name: regional_net_sec_rule.tf.tmpl - - location: region - file_name: global_net_sec_rule.tf.tmpl - location: global file_name: regional.tf.tmpl - location: region diff --git a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional.tf.tmpl b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional.tf.tmpl index 701ca410afa4..61e09cc75f35 100644 --- a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional.tf.tmpl +++ b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional.tf.tmpl @@ -1,3 +1,13 @@ +resource "google_network_security_address_group" "basic_regional_networksecurity_address_group" { + name = "{{policy}}" + parent = "projects/{{project}}" + description = "Sample regional networksecurity_address_group" + location = "{{region}}" + items = ["208.80.154.224/32"] + type = "IPV4" + capacity = 100 +} + resource "google_compute_region_network_firewall_policy" "basic_regional_network_firewall_policy" { name = "{{policy}}" description = "Sample regional network firewall policy" @@ -30,6 +40,8 @@ resource "google_compute_region_network_firewall_policy_rule" "primary" { src_secure_tags { name = "tagValues/${google_tags_tag_value.basic_value.name}" } + + src_address_groups = [google_network_security_address_group.basic_regional_networksecurity_address_group.id] } } diff --git a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional.yaml b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional.yaml index 34793f81da44..4a11a12854c4 100644 --- a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional.yaml +++ b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional.yaml @@ -1,7 +1,5 @@ -versions: -- ga updates: -- resource: ./regional_net_sec_rule_update.tf.tmpl +- resource: ./regional_update.tf.tmpl variables: - name: policy type: resource_name diff --git a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional_net_sec_rule.tf.tmpl b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional_net_sec_rule.tf.tmpl deleted file mode 100644 index 09c03b1bc2cb..000000000000 --- a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional_net_sec_rule.tf.tmpl +++ /dev/null @@ -1,79 +0,0 @@ -resource "google_network_security_address_group" "basic_regional_networksecurity_address_group" { - provider = google-beta - - name = "{{policy}}" - parent = "projects/{{project}}" - description = "Sample regional networksecurity_address_group" - location = "{{region}}" - items = ["208.80.154.224/32"] - type = "IPV4" - capacity = 100 -} - -resource "google_compute_region_network_firewall_policy" "basic_regional_network_firewall_policy" { - provider = google-beta - - name = "{{policy}}" - description = "Sample regional network firewall policy" - project = "{{project}}" - region = "{{region}}" -} - -resource "google_compute_region_network_firewall_policy_rule" "primary" { - provider = google-beta - - action = "allow" - description = "This is a simple rule description" - direction = "INGRESS" - disabled = false - enable_logging = true - firewall_policy = google_compute_region_network_firewall_policy.basic_regional_network_firewall_policy.name - priority = 1000 - region = "{{region}}" - rule_name = "test-rule" - target_service_accounts = ["{{test_service_account}}"] - - match { - src_ip_ranges = ["10.100.0.1/32"] - src_fqdns = ["example.com"] - src_region_codes = ["US"] - src_threat_intelligences = ["iplist-known-malicious-ips"] - - layer4_configs { - ip_protocol = "all" - } - - src_secure_tags { - name = "tagValues/${google_tags_tag_value.basic_value.name}" - } - - src_address_groups = [google_network_security_address_group.basic_regional_networksecurity_address_group.id] - } -} - -resource "google_compute_network" "basic_network" { - provider = google-beta - - name = "{{network}}" -} - -resource "google_tags_tag_key" "basic_key" { - provider = google-beta - - description = "For keyname resources." - parent = "organizations/{{org_id}}" - purpose = "GCE_FIREWALL" - short_name = "{{tagkey}}" - - purpose_data = { - network = "{{project}}/${google_compute_network.basic_network.name}" - } -} - -resource "google_tags_tag_value" "basic_value" { - provider = google-beta - - description = "For valuename resources." - parent = "tagKeys/${google_tags_tag_key.basic_key.name}" - short_name = "{{tagvalue}}" -} diff --git a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional_net_sec_rule.yaml b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional_net_sec_rule.yaml deleted file mode 100644 index 90160519b47a..000000000000 --- a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional_net_sec_rule.yaml +++ /dev/null @@ -1,21 +0,0 @@ -versions: -- beta -updates: -- resource: ./regional_net_sec_rule_update.tf.tmpl -variables: -- name: policy - type: resource_name -- name: project - type: project -- name: region - type: region -- name: tagkey - type: resource_name -- name: tagvalue - type: resource_name -- name: network - type: resource_name -- name: org_id - type: org_id -- name: test_service_account - type: test_service_account diff --git a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional_net_sec_rule_update.tf.tmpl b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional_net_sec_rule_update.tf.tmpl deleted file mode 100644 index c9620bfd79f1..000000000000 --- a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional_net_sec_rule_update.tf.tmpl +++ /dev/null @@ -1,79 +0,0 @@ -resource "google_network_security_address_group" "basic_regional_networksecurity_address_group" { - provider = google-beta - - name = "{{policy}}" - parent = "projects/{{project}}" - description = "Sample regional networksecurity_address_group. Update" - location = "{{region}}" - items = ["208.80.154.224/32"] - type = "IPV4" - capacity = 100 -} - -resource "google_compute_region_network_firewall_policy" "basic_regional_network_firewall_policy" { - provider = google-beta - - name = "{{policy}}" - description = "Sample regional network firewall policy" - project = "{{project}}" - region = "{{region}}" -} - -resource "google_compute_region_network_firewall_policy_rule" "primary" { - provider = google-beta - - action = "deny" - description = "This is an updated rule description" - direction = "EGRESS" - disabled = true - enable_logging = false - firewall_policy = google_compute_region_network_firewall_policy.basic_regional_network_firewall_policy.name - priority = 1000 - region = "{{region}}" - rule_name = "updated-test-rule" - - match { - dest_ip_ranges = ["0.0.0.0/0"] - dest_fqdns = ["example.com"] - dest_region_codes = ["US"] - dest_threat_intelligences = ["iplist-known-malicious-ips"] - - layer4_configs { - ip_protocol = "tcp" - ports = ["123"] - } - - dest_address_groups = [google_network_security_address_group.basic_regional_networksecurity_address_group.id] - } - - target_secure_tags { - name = "tagValues/${google_tags_tag_value.basic_value.name}" - } -} - -resource "google_compute_network" "basic_network" { - provider = google-beta - - name = "{{network}}" -} - -resource "google_tags_tag_key" "basic_key" { - provider = google-beta - - description = "For keyname resources." - parent = "organizations/{{org_id}}" - purpose = "GCE_FIREWALL" - short_name = "{{tagkey}}" - - purpose_data = { - network = "{{project}}/${google_compute_network.basic_network.name}" - } -} - -resource "google_tags_tag_value" "basic_value" { - provider = google-beta - - description = "For valuename resources." - parent = "tagKeys/${google_tags_tag_key.basic_key.name}" - short_name = "{{tagvalue}}" -} diff --git a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional_update.tf.tmpl b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional_update.tf.tmpl index 0b84e25b4c96..d03bda6407a9 100644 --- a/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional_update.tf.tmpl +++ b/tpgtools/overrides/compute/samples/networkfirewallpolicyrule/regional_update.tf.tmpl @@ -1,3 +1,13 @@ +resource "google_network_security_address_group" "basic_regional_networksecurity_address_group" { + name = "{{policy}}" + parent = "projects/{{project}}" + description = "Sample regional networksecurity_address_group. Update" + location = "{{region}}" + items = ["208.80.154.224/32"] + type = "IPV4" + capacity = 100 +} + resource "google_compute_region_network_firewall_policy" "basic_regional_network_firewall_policy" { name = "{{policy}}" description = "Sample regional network firewall policy" @@ -26,6 +36,8 @@ resource "google_compute_region_network_firewall_policy_rule" "primary" { ip_protocol = "tcp" ports = ["123"] } + + dest_address_groups = [google_network_security_address_group.basic_regional_networksecurity_address_group.id] } target_secure_tags {