diff --git a/.github/workflows/unit-test-tools.yml b/.github/workflows/unit-test-tools.yml index ea51b610f6cc..e63e9becc393 100644 --- a/.github/workflows/unit-test-tools.yml +++ b/.github/workflows/unit-test-tools.yml @@ -5,6 +5,7 @@ permissions: read-all on: pull_request: paths: + - 'docs/**' - 'tools/**' - '.github/workflows/unit-test-tools.yml' diff --git a/GNUmakefile b/GNUmakefile index ff896acab357..47b4ace1eec2 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -59,10 +59,12 @@ terraform build provider: make tpgtools mmv1: + # Chaining these with "&&" is critical so this will exit non-0 if the first + # command fails, since we're not forcing bash and errexit / pipefail here. cd mmv1;\ if [ "$(VERSION)" = "ga" ]; then \ - go run . --output $(OUTPUT_PATH) --version ga --no-docs $(mmv1_compile); \ - go run . --output $(OUTPUT_PATH) --version beta --no-code $(mmv1_compile); \ + go run . --output $(OUTPUT_PATH) --version ga --no-docs $(mmv1_compile) \ + && go run . --output $(OUTPUT_PATH) --version beta --no-code $(mmv1_compile); \ else \ go run . --output $(OUTPUT_PATH) --version $(VERSION) $(mmv1_compile); \ fi diff --git a/docs/content/code-review/review-pr.md b/docs/content/code-review/review-pr.md index 0101abb68bd4..bc796c5df425 100644 --- a/docs/content/code-review/review-pr.md +++ b/docs/content/code-review/review-pr.md @@ -9,6 +9,15 @@ aliases: This page provides guidelines for reviewing a Magic Modules pull request (PR). +## Special cases + +The following types of PRs may require additional scrutiny and/or multiple reviewers. + +- DCL to MMv1 migrations +- Adding multi-actor fields (fields whose values can be altered as a side effect of changes made to a different resource) + +## Review + 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. diff --git a/docs/content/develop/add-resource.md b/docs/content/develop/add-resource.md index db6cd2c1993d..1a50218d3808 100644 --- a/docs/content/develop/add-resource.md +++ b/docs/content/develop/add-resource.md @@ -158,6 +158,7 @@ For more information about types of resources and the generation process overall - Documentation: [`magic-modules/mmv1/third_party/terraform/website/docs/r`](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/website/docs/r) - Tests: Copy to the appropriate service folder inside [`magic-modules/mmv1/third_party/terraform/services`](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services), and remove `_generated` from the filename - Sweepers: Put to the appropriate service folder inside [`magic-modules/mmv1/third_party/terraform/services`](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services), and add `_sweeper` suffix to the filename + - Metadata: Copy `*_meta.yaml` to the appropriate service folder inside [`magic-modules/mmv1/third_party/terraform/services`](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services), and remove `_generated` from the filename 4. Modify the Go code as needed. - Replace all occurrences of `github.com/hashicorp/terraform-provider-google-beta/google-beta` with `github.com/hashicorp/terraform-provider-google/google` - Remove the `Example` suffix from all test function names. diff --git a/docs/content/reference/metadata.md b/docs/content/reference/metadata.md new file mode 100644 index 000000000000..5b5e0cd7ae50 --- /dev/null +++ b/docs/content/reference/metadata.md @@ -0,0 +1,32 @@ +--- +title: "MMv1 metadata reference" +weight: 35 +--- + +# MMv1 metadata reference + +This page documents all properties for metadata. Metadata does not impact the provider itself, but is used by Google internally for coverage metrics. + +## Required + +### `resource` + +The name of the Terraform resource e.g., "google_cloudfunctions2_function". + +### `generation_type` + +The generation method used to create the Terraform resource e.g., "mmv1", "dcl", "handwritten". + +## Optional + +### `api_service_name` + +The base name of the API used for this resource e.g., "cloudfunctions.googleapis.com". + +### `api_version` + +The version of the API used for this resource e.g., "v2". + +### `api_resource_type_kind` + +The API "resource type kind" used for this resource e.g., "Function". diff --git a/mmv1/api/resource.go b/mmv1/api/resource.go index 3edcd10210c1..0599004861d2 100644 --- a/mmv1/api/resource.go +++ b/mmv1/api/resource.go @@ -331,6 +331,10 @@ type Resource struct { // The compiler to generate the downstream files, for example "terraformgoogleconversion-codegen". Compiler string `yaml:"-"` + // The API "resource type kind" used for this resource e.g., "Function". + // If this is not set, then :name is used instead, which is strongly + // preferred wherever possible. Its main purpose is for supporting + // fine-grained resources and legacy resources. ApiResourceTypeKind string `yaml:"api_resource_type_kind,omitempty"` ImportPath string `yaml:"-"` diff --git a/mmv1/api/type.go b/mmv1/api/type.go index 8e155f9fcd89..a4d187e08cc0 100644 --- a/mmv1/api/type.go +++ b/mmv1/api/type.go @@ -399,6 +399,15 @@ func (t Type) Lineage() string { return fmt.Sprintf("%s.%s", t.ParentMetadata.Lineage(), google.Underscore(t.Name)) } +// Returns the lineage in snake case +func (t Type) LineageAsSnakeCase() string { + if t.ParentMetadata == nil { + return google.Underscore(t.Name) + } + + return fmt.Sprintf("%s_%s", t.ParentMetadata.LineageAsSnakeCase(), google.Underscore(t.Name)) +} + // Prints the access path of the field in the configration eg: metadata.0.labels // The only intended purpose is to get the value of the labes field by calling d.Get(). func (t Type) TerraformLineage() string { diff --git a/mmv1/main.go b/mmv1/main.go index 0db8a11238fc..214bfc49dbce 100644 --- a/mmv1/main.go +++ b/mmv1/main.go @@ -132,9 +132,13 @@ func main() { } startTime := time.Now() + providerName := "default (terraform)" + if *forceProvider != "" { + providerName = *forceProvider + } log.Printf("Generating MM output to '%s'", *outputPath) - log.Printf("Using %s version", *version) - log.Printf("Using %s provider", *forceProvider) + log.Printf("Building %s version", *version) + log.Printf("Building %s provider", providerName) // Building compute takes a long time and can't be parallelized within the product // so lets build it first diff --git a/mmv1/products/chronicle/DataAccessLabel.yaml b/mmv1/products/chronicle/DataAccessLabel.yaml new file mode 100644 index 000000000000..36428850ff45 --- /dev/null +++ b/mmv1/products/chronicle/DataAccessLabel.yaml @@ -0,0 +1,98 @@ +# Copyright 2024 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. + +--- +name: DataAccessLabel +description: A DataAccessLabel is a label on events to define user access to data. +min_version: 'beta' +references: + guides: + 'Introduction to data RBAC': 'https://cloud.google.com/chronicle/docs/onboard/onboard-datarbac' + api: 'https://cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.dataAccessLabels' +base_url: projects/{{project}}/locations/{{location}}/instances/{{instance}}/dataAccessLabels +self_link: projects/{{project}}/locations/{{location}}/instances/{{instance}}/dataAccessLabels/{{data_access_label_id}} +create_url: projects/{{project}}/locations/{{location}}/instances/{{instance}}/dataAccessLabels?dataAccessLabelId={{data_access_label_id}} +id_format: projects/{{project}}/locations/{{location}}/instances/{{instance}}/dataAccessLabels/{{data_access_label_id}} +import_format: + - projects/{{project}}/locations/{{location}}/instances/{{instance}}/dataAccessLabels/{{data_access_label_id}} +update_verb: PATCH +update_mask: true + +examples: + - name: 'chronicle_dataaccesslabel_basic' + primary_resource_id: 'example' + min_version: 'beta' + vars: + data_access_label_id: label-id + description: label-description + test_env_vars: + chronicle_id: 'CHRONICLE_ID' + +parameters: + - name: location + type: String + description: The location of the resource. This is the geographical region where the Chronicle instance resides, such as "us" or "europe-west2". + immutable: true + url_param_only: true + required: true + - name: instance + type: String + description: The unique identifier for the Chronicle instance, which is the same as the customer ID. + immutable: true + url_param_only: true + required: true + - name: dataAccessLabelId + type: String + description: |- + Required. The ID to use for the data access label, which will become the label's + display name and the final component of the label's resource name. It must + only contain ASCII lowercase letters, numbers, and dashes; it must begin + with a letter, and it must not exceed 1000 characters. + immutable: true + url_param_only: true + required: true +properties: + - name: author + type: String + description: Output only. The user who created the data access label. + output: true + - name: lastEditor + type: String + description: Output only. The user who last updated the data access label. + output: true + - name: description + type: String + description: Optional. A description of the data access label for a human reader. + - name: udmQuery + type: String + description: A UDM query over event data. + required: true + - name: name + type: String + description: |- + The unique resource name of the data access label. This unique identifier is generated using values provided for the URL parameters. + Format: + projects/{project}/locations/{location}/instances/{instance}/dataAccessLabels/{data_access_label_id} + output: true + - name: displayName + type: String + description: Output only. The short name displayed for the label as it appears on event data. This is same as data access label id. + output: true + - name: createTime + type: String + description: Output only. The time at which the data access label was created. + output: true + - name: updateTime + type: String + description: Output only. The time at which the data access label was last updated. + output: true diff --git a/mmv1/products/chronicle/DataAccessScope.yaml b/mmv1/products/chronicle/DataAccessScope.yaml new file mode 100644 index 000000000000..d20c7b5472c0 --- /dev/null +++ b/mmv1/products/chronicle/DataAccessScope.yaml @@ -0,0 +1,233 @@ +# Copyright 2024 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. + +--- +name: DataAccessScope +description: A DataAccessScope is a boolean expression of data access labels used to restrict access to data for users. +min_version: 'beta' +references: + guides: + 'Introduction to data RBAC': 'https://cloud.google.com/chronicle/docs/onboard/onboard-datarbac' + api: 'https://cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.dataAccessScopes' +base_url: projects/{{project}}/locations/{{location}}/instances/{{instance}}/dataAccessScopes +self_link: projects/{{project}}/locations/{{location}}/instances/{{instance}}/dataAccessScopes/{{data_access_scope_id}} +create_url: projects/{{project}}/locations/{{location}}/instances/{{instance}}/dataAccessScopes?dataAccessScopeId={{data_access_scope_id}} +id_format: projects/{{project}}/locations/{{location}}/instances/{{instance}}/dataAccessScopes/{{data_access_scope_id}} +import_format: + - projects/{{project}}/locations/{{location}}/instances/{{instance}}/dataAccessScopes/{{data_access_scope_id}} +update_verb: PATCH +update_mask: true + +examples: + - name: 'chronicle_dataaccessscope_with_logtype' + primary_resource_id: 'example' + min_version: 'beta' + vars: + data_access_scope_id: scope-id + description: scope-description + test_env_vars: + chronicle_id: 'CHRONICLE_ID' + - name: 'chronicle_dataaccessscope_with_dataaccesslabel' + primary_resource_id: 'example' + min_version: 'beta' + vars: + data_access_scope_id: scope-id + description: scope-description + data_access_label_id: label-id + test_env_vars: + chronicle_id: 'CHRONICLE_ID' + - name: 'chronicle_dataaccessscope_with_asset_namespace' + primary_resource_id: 'example' + min_version: 'beta' + vars: + data_access_scope_id: scope-id + description: scope-description + test_env_vars: + chronicle_id: 'CHRONICLE_ID' + - name: 'chronicle_dataaccessscope_with_ingestion_label' + primary_resource_id: 'example' + min_version: 'beta' + vars: + data_access_scope_id: scope-id + description: scope-description + test_env_vars: + chronicle_id: 'CHRONICLE_ID' + - name: 'chronicle_dataaccessscope_with_denied_labels' + primary_resource_id: 'example' + min_version: 'beta' + vars: + data_access_scope_id: scope-id + description: scope-description + data_access_label_id: label-id + test_env_vars: + chronicle_id: 'CHRONICLE_ID' + + +parameters: + - name: location + type: String + description: The location of the resource. This is the geographical region where the Chronicle instance resides, such as "us" or "europe-west2". + immutable: true + url_param_only: true + required: true + - name: instance + type: String + description: The unique identifier for the Chronicle instance, which is the same as the customer ID. + immutable: true + url_param_only: true + required: true + - name: dataAccessScopeId + type: String + description: |- + Required. The user provided scope id which will become the last part of the name + of the scope resource. + Needs to be compliant with https://google.aip.dev/122 + immutable: true + url_param_only: true + required: true +properties: + - name: name + type: String + description: |- + The unique full name of the data access scope. This unique identifier is generated using values provided for the URL parameters. + Format: + projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{data_access_scope_id} + output: true + - name: allowedDataAccessLabels + type: Array + description: |- + The allowed labels for the scope. There has to be at + least one label allowed for the scope to be valid. + The logical operator for evaluation of the allowed labels is OR. + Either allow_all or allowed_data_access_labels needs to be provided. + E.g.: A customer with scope with allowed labels A and B will be able + to see data with labeled with A or B or (A and B). + at_least_one_of: + - 'allowed_data_access_labels' + - 'allow_all' + item_type: + type: NestedObject + properties: + - name: dataAccessLabel + type: String + description: The name of the data access label. + - name: logType + type: String + description: The name of the log type. + - name: assetNamespace + type: String + description: |- + The asset namespace configured in the forwarder + of the customer's events. + - name: ingestionLabel + type: NestedObject + description: Representation of an ingestion label type. + properties: + - name: ingestionLabelKey + type: String + description: Required. The key of the ingestion label. Always required. + required: true + - name: ingestionLabelValue + type: String + description: |- + Optional. The value of the ingestion label. Optional. An object + with no provided value and some key provided would match + against the given key and ANY value. + - name: displayName + type: String + description: |- + Output only. The display name of the label. + Data access label and log types's name + will match the display name of the resource. + The asset namespace will match the namespace itself. + The ingestion key value pair will match the key of the tuple. + output: true + - name: allowAll + type: Boolean + description: |- + Optional. Whether or not the scope allows all labels, allow_all and + allowed_data_access_labels are mutually exclusive and one of them must be + present. denied_data_access_labels can still be used along with allow_all. + When combined with denied_data_access_labels, access will be granted to all + data that doesn't have labels mentioned in denied_data_access_labels. E.g.: + A customer with scope with denied labels A and B and allow_all will be able + to see all data except data labeled with A and data labeled with B and data + with labels A and B. + - name: deniedDataAccessLabels + type: Array + description: |- + Optional. The denied labels for the scope. + The logical operator for evaluation of the denied labels is AND. + E.g.: A customer with scope with denied labels A and B won't be able + to see data labeled with A and data labeled with B + and data with labels A and B. + item_type: + type: NestedObject + properties: + - name: displayName + type: String + description: |- + Output only. The display name of the label. + Data access label and log types's name + will match the display name of the resource. + The asset namespace will match the namespace itself. + The ingestion key value pair will match the key of the tuple. + output: true + - name: dataAccessLabel + type: String + description: The name of the data access label. + - name: logType + type: String + description: The name of the log type. + - name: assetNamespace + type: String + description: |- + The asset namespace configured in the forwarder + of the customer's events. + - name: ingestionLabel + type: NestedObject + description: Representation of an ingestion label type. + properties: + - name: ingestionLabelKey + type: String + description: Required. The key of the ingestion label. Always required. + required: true + - name: ingestionLabelValue + type: String + description: |- + Optional. The value of the ingestion label. Optional. An object + with no provided value and some key provided would match + against the given key and ANY value. + - name: displayName + type: String + description: Output only. The name to be used for display to customers of the data access scope. + output: true + - name: createTime + type: String + description: Output only. The time at which the data access scope was created. + output: true + - name: author + type: String + description: Output only. The user who created the data access scope. + output: true + - name: lastEditor + type: String + description: Output only. The user who last updated the data access scope. + output: true + - name: description + type: String + description: Optional. A description of the data access scope for a human reader. + - name: updateTime + type: String + description: Output only. The time at which the data access scope was last updated. + output: true diff --git a/mmv1/products/developerconnect/Connection.yaml b/mmv1/products/developerconnect/Connection.yaml index 32cc8383038b..b1c0047b149a 100644 --- a/mmv1/products/developerconnect/Connection.yaml +++ b/mmv1/products/developerconnect/Connection.yaml @@ -12,218 +12,401 @@ # limitations under the License. --- -name: 'Connection' -description: | - A connection to a GitHub App installation. -min_version: 'beta' -docs: -id_format: 'projects/{{project}}/locations/{{location}}/connections/{{connection_id}}' -base_url: 'projects/{{project}}/locations/{{location}}/connections' -self_link: 'projects/{{project}}/locations/{{location}}/connections/{{connection_id}}' -create_url: 'projects/{{project}}/locations/{{location}}/connections?connectionId={{connection_id}}' -update_verb: 'PATCH' +name: Connection +description: A connection for GitHub, GitHub Enterprise, GitLab, and GitLab Enterprise. +base_url: projects/{{project}}/locations/{{location}}/connections update_mask: true +self_link: projects/{{project}}/locations/{{location}}/connections/{{connection_id}} +create_url: projects/{{project}}/locations/{{location}}/connections?connectionId={{connection_id}} +update_verb: PATCH +id_format: projects/{{project}}/locations/{{location}}/connections/{{connection_id}} import_format: - - 'projects/{{project}}/locations/{{location}}/connections/{{connection_id}}' -timeouts: - insert_minutes: 20 - update_minutes: 20 - delete_minutes: 20 -autogen_async: true -async: - actions: ['create', 'delete', 'update'] - type: 'OpAsync' - operation: - base_url: '{{op_id}}' - result: - resource_inside_response: true -custom_code: + - projects/{{project}}/locations/{{location}}/connections/{{connection_id}} examples: - name: 'developer_connect_connection_new' primary_resource_id: 'my-connection' primary_resource_name: 'fmt.Sprintf("tf-test-connection-new%s", context["random_suffix"])' - min_version: 'beta' vars: connection_name: 'tf-test-connection-new' test_env_vars: project: 'PROJECT_NAME' + exclude_test: true - name: 'developer_connect_connection_existing_credentials' primary_resource_id: 'my-connection' primary_resource_name: 'fmt.Sprintf("tf-test-connection-cred%s", context["random_suffix"])' - min_version: 'beta' vars: connection_name: 'tf-test-connection-cred' secret_name: "projects/your-project/secrets/your-secret-id/versions/latest" test_vars_overrides: secret_name: '"projects/devconnect-terraform-creds/secrets/tf-test-do-not-change-github-oauthtoken-e0b9e7/versions/1"' - name: 'developer_connect_connection_existing_installation' - min_version: 'beta' exclude_test: true + - name: 'developer_connect_connection_github' + primary_resource_id: 'my-connection' + primary_resource_name: 'fmt.Sprintf("tf-test-connection%s", context["random_suffix"])' + vars: + connection_name: 'tf-test-connection' + - name: 'developer_connect_connection_github_doc' + exclude_test: true + - name: 'developer_connect_connection_github_enterprise' + primary_resource_id: 'my-connection' + primary_resource_name: 'fmt.Sprintf("tf-test-connection%s", context["random_suffix"])' + vars: + connection_name: 'tf-test-connection' + - name: 'developer_connect_connection_github_enterprise_doc' + exclude_test: true + - name: 'developer_connect_connection_gitlab' + primary_resource_id: 'my-connection' + primary_resource_name: 'fmt.Sprintf("tf-test-connection%s", context["random_suffix"])' + vars: + connection_name: 'tf-test-connection' + - name: 'developer_connect_connection_gitlab_doc' + exclude_test: true + - name: 'developer_connect_connection_gitlab_enterprise' + primary_resource_id: 'my-connection' + primary_resource_name: 'fmt.Sprintf("tf-test-connection%s", context["random_suffix"])' + vars: + connection_name: 'tf-test-connection' + - name: 'developer_connect_connection_gitlab_enterprise_doc' + exclude_test: true +autogen_async: true +async: + operation: + timeouts: + insert_minutes: 20 + update_minutes: 20 + delete_minutes: 20 + base_url: '{{op_id}}' + actions: + - create + - delete + - update + type: OpAsync + result: + resource_inside_response: true + error: {} + include_project: false +autogen_status: Q29ubmVjdGlvbg== parameters: - - name: 'location' + - name: location type: String - description: | - Resource ID segment making up resource `name`. It identifies the resource - within its parent collection as described in https://google.aip.dev/122. See documentation - for resource type `developerconnect.googleapis.com/GitRepositoryLink`. - min_version: 'beta' + description: Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. + immutable: true url_param_only: true required: true - immutable: true - - name: 'connectionId' + - name: connectionId type: String - description: | - Required. Id of the requesting object. If auto-generating Id server-side, - remove this field and connection_id from the method_signature of Create RPC. - min_version: 'beta' + description: |- + Required. Id of the requesting object + If auto-generating Id server-side, remove this field and + connection_id from the method_signature of Create RPC + immutable: true url_param_only: true required: true - immutable: true properties: - - name: 'githubConfig' + - name: githubConfig type: NestedObject - description: | - Configuration for connections to github.com. - min_version: 'beta' + description: Configuration for connections to github.com. properties: - - name: 'githubApp' + - name: installationUri type: String - description: | - Required. Immutable. The GitHub Application that was installed to - the GitHub user or organization. + description: |- + Output only. The URI to navigate to in order to manage the installation associated + with this GitHubConfig. + output: true + - name: githubApp + type: String + description: |- + Required. Immutable. The GitHub Application that was installed to the GitHub user or + organization. Possible values: - GIT_HUB_APP_UNSPECIFIED - DEVELOPER_CONNECT - FIREBASE" - min_version: 'beta' - required: true + GIT_HUB_APP_UNSPECIFIED + DEVELOPER_CONNECT + FIREBASE immutable: true - - name: 'authorizerCredential' + required: true + - name: authorizerCredential type: NestedObject - description: | - Represents an OAuth token of the account that authorized the Connection,and - associated metadata. - min_version: 'beta' + description: |- + Represents an OAuth token of the account that authorized the Connection, + and associated metadata. default_from_api: true properties: - - name: 'oauthTokenSecretVersion' + - name: oauthTokenSecretVersion type: String - description: | - Required. A SecretManager resource containing the OAuth token - that authorizes the connection. - Format: `projects/*/secrets/*/versions/*`. - min_version: 'beta' + description: |- + Required. A SecretManager resource containing the OAuth token that authorizes + the connection. Format: `projects/*/secrets/*/versions/*`. required: true - - name: 'username' + - name: username type: String - description: | - Output only. The username associated with this token. - min_version: 'beta' + description: Output only. The username associated with this token. output: true - - name: 'appInstallationId' + - name: appInstallationId type: String - description: | - Optional. GitHub App installation id. - min_version: 'beta' + description: Optional. GitHub App installation id. default_from_api: true - - name: 'installationUri' + - name: githubEnterpriseConfig + type: NestedObject + description: Configuration for connections to an instance of GitHub Enterprise. + properties: + - name: appSlug + type: String + description: Output only. The URL-friendly name of the GitHub App. + output: true + - name: privateKeySecretVersion + type: String + description: |- + Optional. SecretManager resource containing the private key of the GitHub App, + formatted as `projects/*/secrets/*/versions/*`. + - name: installationUri + type: String + description: |- + Output only. The URI to navigate to in order to manage the installation associated + with this GitHubEnterpriseConfig. + output: true + - name: serviceDirectoryConfig + type: NestedObject + description: |- + ServiceDirectoryConfig represents Service Directory configuration for a + connection. + properties: + - name: service + type: String + description: |- + Required. The Service Directory service name. + Format: + projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}. + required: true + - name: serverVersion type: String - description: | - Output only. The URI to navigate to in order to manage the installation - associated with this GitHubConfig. - min_version: 'beta' + description: Output only. GitHub Enterprise version installed at the host_uri. output: true - - name: 'name' + - name: sslCaCertificate + type: String + description: Optional. SSL certificate to use for requests to GitHub Enterprise. + - name: hostUri + type: String + description: Required. The URI of the GitHub Enterprise host this connection is for. + required: true + - name: appId + type: String + description: Optional. ID of the GitHub App created from the manifest. + - name: webhookSecretSecretVersion + type: String + description: |- + Optional. SecretManager resource containing the webhook secret of the GitHub App, + formatted as `projects/*/secrets/*/versions/*`. + - name: appInstallationId + type: String + description: Optional. ID of the installation of the GitHub App. + - name: labels + type: KeyValueLabels + description: Optional. Labels as key value pairs + - name: etag type: String - description: | + description: |- + Optional. 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. + - name: uid + type: String + description: Output only. A system-assigned unique identifier for a the GitRepositoryLink. + output: true + - name: name + type: String + description: |- Identifier. The resource name of the connection, in the format `projects/{project}/locations/{location}/connections/{connection_id}`. - min_version: 'beta' output: true - - name: 'createTime' - type: String - description: | - Output only. [Output only] Create timestamp - min_version: 'beta' + - name: reconciling + type: Boolean + description: |- + Output only. Set to true when the connection is being set up or updated in the + background. output: true - - name: 'updateTime' + - name: gitlabEnterpriseConfig + type: NestedObject + description: Configuration for connections to an instance of GitLab Enterprise. + properties: + - name: authorizerCredential + type: NestedObject + description: |- + Represents a personal access token that authorized the Connection, + and associated metadata. + required: true + properties: + - name: userTokenSecretVersion + type: String + description: |- + Required. A SecretManager resource containing the user token that authorizes + the Developer Connect connection. Format: + `projects/*/secrets/*/versions/*`. + required: true + - name: username + type: String + description: Output only. The username associated with this token. + output: true + - name: serviceDirectoryConfig + type: NestedObject + description: |- + ServiceDirectoryConfig represents Service Directory configuration for a + connection. + properties: + - name: service + type: String + description: |- + Required. The Service Directory service name. + Format: + projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}. + required: true + - name: sslCaCertificate + type: String + description: |- + Optional. SSL Certificate Authority certificate to use for requests to GitLab + Enterprise instance. + - name: serverVersion + type: String + description: Output only. Version of the GitLab Enterprise server running on the `host_uri`. + output: true + - name: hostUri + type: String + description: Required. The URI of the GitLab Enterprise host this connection is for. + required: true + - name: webhookSecretSecretVersion + type: String + description: |- + Required. Immutable. SecretManager resource containing the webhook secret of a GitLab project, + formatted as `projects/*/secrets/*/versions/*`. This is used to validate + webhooks. + immutable: true + required: true + - name: readAuthorizerCredential + type: NestedObject + description: |- + Represents a personal access token that authorized the Connection, + and associated metadata. + required: true + properties: + - name: userTokenSecretVersion + type: String + description: |- + Required. A SecretManager resource containing the user token that authorizes + the Developer Connect connection. Format: + `projects/*/secrets/*/versions/*`. + required: true + - name: username + type: String + description: Output only. The username associated with this token. + output: true + - name: updateTime type: String - description: | - Output only. [Output only] Update timestamp - min_version: 'beta' + description: Output only. [Output only] Update timestamp output: true - - name: 'deleteTime' + - name: deleteTime type: String - description: | - Output only. [Output only] Delete timestamp - min_version: 'beta' + description: Output only. [Output only] Delete timestamp output: true - - name: 'labels' - type: KeyValueLabels - description: | - Optional. Labels as key value pairs - min_version: 'beta' - - name: 'installationState' + - name: installationState type: NestedObject - description: | - Describes stage and necessary actions to be taken by the user to complete the installation. - Used for GitHub and GitHub Enterprise based connections. - min_version: 'beta' + description: |- + Describes stage and necessary actions to be taken by the + user to complete the installation. Used for GitHub and GitHub Enterprise + based connections. output: true properties: - - name: 'stage' + - name: message + type: String + description: |- + Output only. Message of what the user should do next to continue the installation. + Empty string if the installation is already complete. + - name: actionUri type: String - description: | + description: |- + Output only. Link to follow for next action. Empty string if the installation is already + complete. + - name: stage + type: String + description: |- Output only. Current step of the installation process. Possible values: - STAGE_UNSPECIFIED - PENDING_CREATE_APP - PENDING_USER_OAUTH - PENDING_INSTALL_APP - COMPLETE - min_version: 'beta' + STAGE_UNSPECIFIED + PENDING_CREATE_APP + PENDING_USER_OAUTH + PENDING_INSTALL_APP + COMPLETE output: true - - name: 'message' - type: String - description: | - Output only. Message of what the user should do next to continue - the installation.Empty string if the installation is already complete. - min_version: 'beta' - - name: 'actionUri' - type: String - description: | - Output only. Link to follow for next action. Empty string if the - installation is already complete. - min_version: 'beta' - - name: 'disabled' - type: Boolean - description: - Optional. If disabled is set to true, functionality is disabled for - this connection. Repository based API methods and webhooks processing - for repositories in this connection will be disabled. - min_version: 'beta' - - name: 'reconciling' + - name: disabled type: Boolean - description: | - Output only. Set to true when the connection is being set up or updated - in the background. - min_version: 'beta' - output: true - - name: 'annotations' + description: |- + Optional. If disabled is set to true, functionality is disabled for this connection. + Repository based API methods and webhooks processing for repositories in + this connection will be disabled. + - name: annotations type: KeyValueAnnotations - description: | - Optional. Allows clients to store small amounts of arbitrary data. - min_version: 'beta' - - name: 'etag' - type: String - description: | - Optional. 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. - min_version: 'beta' - - name: 'uid' + description: Optional. Allows clients to store small amounts of arbitrary data. + - name: gitlabConfig + type: NestedObject + description: Configuration for connections to gitlab.com. + properties: + - name: webhookSecretSecretVersion + type: String + description: |- + Required. Immutable. SecretManager resource containing the webhook secret of a GitLab project, + formatted as `projects/*/secrets/*/versions/*`. This is used to validate + webhooks. + immutable: true + required: true + - name: readAuthorizerCredential + type: NestedObject + description: |- + Represents a personal access token that authorized the Connection, + and associated metadata. + required: true + properties: + - name: userTokenSecretVersion + type: String + description: |- + Required. A SecretManager resource containing the user token that authorizes + the Developer Connect connection. Format: + `projects/*/secrets/*/versions/*`. + required: true + - name: username + type: String + description: Output only. The username associated with this token. + output: true + - name: authorizerCredential + type: NestedObject + description: |- + Represents a personal access token that authorized the Connection, + and associated metadata. + required: true + properties: + - name: userTokenSecretVersion + type: String + description: |- + Required. A SecretManager resource containing the user token that authorizes + the Developer Connect connection. Format: + `projects/*/secrets/*/versions/*`. + required: true + - name: username + type: String + description: Output only. The username associated with this token. + output: true + - name: createTime type: String - description: | - Output only. A system-assigned unique identifier for a the GitRepositoryLink. - min_version: 'beta' + description: Output only. [Output only] Create timestamp output: true + - name: cryptoKeyConfig + type: NestedObject + description: |- + The crypto key configuration. This field is used by the Customer-managed + encryption keys (CMEK) feature. + properties: + - name: keyReference + type: String + description: |- + Required. The name of the key which is used to encrypt/decrypt customer data. For key + in Cloud KMS, the key should be in the format of + `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + required: true diff --git a/mmv1/products/developerconnect/GitRepositoryLink.yaml b/mmv1/products/developerconnect/GitRepositoryLink.yaml index 7a0f083e3bf8..1b69af6c1f7a 100644 --- a/mmv1/products/developerconnect/GitRepositoryLink.yaml +++ b/mmv1/products/developerconnect/GitRepositoryLink.yaml @@ -14,7 +14,6 @@ --- name: 'GitRepositoryLink' description: "A git repository link to a parent connection." -min_version: 'beta' docs: id_format: 'projects/{{project}}/locations/{{location}}/connections/{{parent_connection}}/gitRepositoryLinks/{{git_repository_link_id}}' base_url: 'projects/{{project}}/locations/{{location}}/connections/{{parent_connection}}/gitRepositoryLinks' @@ -41,13 +40,11 @@ examples: # to show them in the docs. - name: 'developer_connect_git_repository_link_github' primary_resource_id: 'primary' - min_version: 'beta' vars: connection_name: 'my-connection' git_repository_link_name: 'my-repository' exclude_docs: true - name: 'developer_connect_git_repository_link_github_doc' - min_version: 'beta' exclude_test: true parameters: - name: 'location' @@ -56,7 +53,6 @@ parameters: "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `developerconnect.googleapis.com/GitRepositoryLink`. " - min_version: 'beta' url_param_only: true required: true immutable: true @@ -66,7 +62,6 @@ parameters: "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `developerconnect.googleapis.com/GitRepositoryLink`. " - min_version: 'beta' url_param_only: true required: true immutable: true @@ -76,7 +71,6 @@ parameters: "Required. The ID to use for the repository, which will become the final component of\nthe repository's resource name. This ID should be unique in the connection.\nAllows alphanumeric characters and any of -._~%!$&'()*+,;=@. " - min_version: 'beta' url_param_only: true required: true immutable: true @@ -84,52 +78,42 @@ properties: - name: 'name' type: String description: "Identifier. Resource name of the repository, in the format\n`projects/*/locations/*/connections/*/gitRepositoryLinks/*`. " - min_version: 'beta' output: true - name: 'cloneUri' type: String description: "Required. Git Clone URI. " - min_version: 'beta' required: true - name: 'createTime' type: String description: "Output only. [Output only] Create timestamp " - min_version: 'beta' output: true - name: 'updateTime' type: String description: "Output only. [Output only] Update timestamp " - min_version: 'beta' output: true - name: 'deleteTime' type: String description: "Output only. [Output only] Delete timestamp " - min_version: 'beta' output: true - name: 'labels' type: KeyValueLabels description: "Optional. Labels as key value pairs " - min_version: 'beta' - name: 'etag' type: String description: "Optional. This checksum is computed by the server based on the value of other\nfields, and may be sent on update and delete requests to ensure the\nclient has an up-to-date value before proceeding. " - min_version: 'beta' - name: 'reconciling' type: Boolean description: "Output only. Set to true when the connection is being set up or updated in the\nbackground. " - min_version: 'beta' output: true - name: 'annotations' type: KeyValueAnnotations description: "Optional. Allows clients to store small amounts of arbitrary data. " - min_version: 'beta' - name: 'uid' type: String description: "Output only. A system-assigned unique identifier for a the GitRepositoryLink. " - min_version: 'beta' output: true diff --git a/mmv1/products/developerconnect/product.yaml b/mmv1/products/developerconnect/product.yaml index 5a32e127e0af..ee8ce01b6678 100644 --- a/mmv1/products/developerconnect/product.yaml +++ b/mmv1/products/developerconnect/product.yaml @@ -12,10 +12,11 @@ # limitations under the License. --- -name: 'DeveloperConnect' -display_name: 'Developer Connect' -versions: - - name: 'beta' - base_url: 'https://developerconnect.googleapis.com/v1/' +name: DeveloperConnect +display_name: Developer Connect scopes: - 'https://www.googleapis.com/auth/cloud-platform' +versions: + - base_url: 'https://developerconnect.googleapis.com/v1/' + name: ga +caibaseurl: "" diff --git a/mmv1/products/iap/Settings.yaml b/mmv1/products/iap/Settings.yaml index 60294b9eb1e0..aada2dbf8fb7 100644 --- a/mmv1/products/iap/Settings.yaml +++ b/mmv1/products/iap/Settings.yaml @@ -74,6 +74,7 @@ properties: type: NestedObject description: | GCIP claims and endpoint configurations for 3p identity providers. + * Enabling gcipSetting significantly changes the way IAP authenticates users. Identity Platform does not support IAM, so IAP will not enforce any IAM policies for requests to your application. properties: - name: 'tenantIds' type: Array @@ -114,6 +115,7 @@ properties: (https://developers.google.com/identity/protocols/OpenIDConnect#hd-param) Note: IAP does not verify that the id token's hd claim matches this value since access behavior is managed by IAM policies. + * loginHint setting is not a replacement for access control. Always enforce an appropriate access policy if you want to restrict access to users outside your domain. - name: 'programmaticClients' type: Array description: | diff --git a/mmv1/products/kms/AutokeyConfig.yaml b/mmv1/products/kms/AutokeyConfig.yaml index 6eb50384b002..d25d82d5fb73 100644 --- a/mmv1/products/kms/AutokeyConfig.yaml +++ b/mmv1/products/kms/AutokeyConfig.yaml @@ -51,6 +51,8 @@ custom_code: pre_read: 'templates/terraform/pre_read/kms_autokey_config_folder.go.tmpl' pre_update: 'templates/terraform/pre_update/kms_autokey_config_folder.go.tmpl' pre_delete: 'templates/terraform/pre_delete/kms_autokey_config_folder.go.tmpl' + post_create: 'templates/terraform/post_create/sleep.go.tmpl' + post_update: 'templates/terraform/post_create/sleep.go.tmpl' test_check_destroy: 'templates/terraform/custom_check_destroy/kms_autokey_config.go.tmpl' # Using a handwritten sweeper because of pre_delete. exclude_sweeper: true @@ -65,9 +67,6 @@ examples: org_id: 'ORG_ID' billing_account: 'BILLING_ACCT' external_providers: ["random", "time"] - # Need the time_sleep resource - # Currently failing - skip_vcr: true parameters: - name: 'folder' type: String diff --git a/mmv1/provider/terraform.go b/mmv1/provider/terraform.go index 056a1ffeb893..89c7aeecd457 100644 --- a/mmv1/provider/terraform.go +++ b/mmv1/provider/terraform.go @@ -499,7 +499,7 @@ func (t Terraform) CompileFileList(outputFolder string, files map[string]string, func (t Terraform) addHashicorpCopyRightHeader(outputFolder, target string) { if !expectedOutputFolder(outputFolder) { - log.Printf("Unexpected output folder (%s) detected"+ + log.Printf("Unexpected output folder (%s) detected "+ "when deciding to add HashiCorp copyright headers.\n"+ "Watch out for unexpected changes to copied files", outputFolder) } diff --git a/mmv1/templates/terraform/constants/network_services_gateway.go.tmpl b/mmv1/templates/terraform/constants/network_services_gateway.go.tmpl index c5e1a0a8b4fa..e1607aad1e43 100644 --- a/mmv1/templates/terraform/constants/network_services_gateway.go.tmpl +++ b/mmv1/templates/terraform/constants/network_services_gateway.go.tmpl @@ -10,6 +10,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -}} + +import ( +{{ if eq $.TargetVersionName `ga` }} + tpgcompute "github.com/hashicorp/terraform-provider-google/google/services/compute" +{{- else }} + tpgcompute "github.com/hashicorp/terraform-provider-google-beta/google-beta/services/compute" +{{- end }} +) + // Checks if there is another gateway under the same location. func gatewaysSameLocation(d *schema.ResourceData, config *transport_tpg.Config, billingProject, userAgent string) ([]interface{}, error) { log.Print("[DEBUG] Looking for gateways under the same location.") @@ -104,7 +113,7 @@ func deleteSWGAutoGenRouter(d *schema.ResourceData, config *transport_tpg.Config return err } - _, err = transport_tpg.SendRequest(transport_tpg.SendRequestOptions{ + res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{ Config: config, Method: "DELETE", Project: billingProject, @@ -122,5 +131,9 @@ func deleteSWGAutoGenRouter(d *schema.ResourceData, config *transport_tpg.Config return err } + err = tpgcompute.ComputeOperationWaitTime( + config, res, billingProject, "Deleting autogen router", userAgent, + d.Timeout(schema.TimeoutDelete)) + return nil } diff --git a/mmv1/templates/terraform/examples/chronicle_dataaccesslabel_basic.tf.tmpl b/mmv1/templates/terraform/examples/chronicle_dataaccesslabel_basic.tf.tmpl new file mode 100644 index 000000000000..704b2099beb1 --- /dev/null +++ b/mmv1/templates/terraform/examples/chronicle_dataaccesslabel_basic.tf.tmpl @@ -0,0 +1,8 @@ +resource "google_chronicle_data_access_label" "{{$.PrimaryResourceId}}" { + provider = "google-beta" + location = "us" + instance = "{{index $.TestEnvVars "chronicle_id"}}" + data_access_label_id = "{{index $.Vars "data_access_label_id"}}" + udm_query = "principal.hostname=\"google.com\"" + description = "{{index $.Vars "description"}}" +} diff --git a/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_asset_namespace.tf.tmpl b/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_asset_namespace.tf.tmpl new file mode 100644 index 000000000000..268c31a7cb7c --- /dev/null +++ b/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_asset_namespace.tf.tmpl @@ -0,0 +1,11 @@ +resource "google_chronicle_data_access_scope" "{{$.PrimaryResourceId}}" { + provider = "google-beta" + location = "us" + instance = "{{index $.TestEnvVars "chronicle_id"}}" + data_access_scope_id = "{{index $.Vars "data_access_scope_id"}}" + description = "{{index $.Vars "description"}}" + allowed_data_access_labels { + asset_namespace = "my-namespace" + } +} + diff --git a/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_dataaccesslabel.tf.tmpl b/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_dataaccesslabel.tf.tmpl new file mode 100644 index 000000000000..e820c848cc18 --- /dev/null +++ b/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_dataaccesslabel.tf.tmpl @@ -0,0 +1,18 @@ +resource "google_chronicle_data_access_label" "custom_data_access_label" { + provider = "google-beta" + location = "us" + instance = "{{index $.TestEnvVars "chronicle_id"}}" + data_access_label_id = "{{index $.Vars "data_access_label_id"}}" + udm_query = "principal.hostname=\"google.com\"" +} + +resource "google_chronicle_data_access_scope" "{{$.PrimaryResourceId}}" { + provider = "google-beta" + location = "us" + instance = "{{index $.TestEnvVars "chronicle_id"}}" + data_access_scope_id = "{{index $.Vars "data_access_scope_id"}}" + description = "{{index $.Vars "description"}}" + allowed_data_access_labels { + data_access_label = resource.google_chronicle_data_access_label.custom_data_access_label.data_access_label_id + } +} diff --git a/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_denied_labels.tf.tmpl b/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_denied_labels.tf.tmpl new file mode 100644 index 000000000000..9fa855e83e03 --- /dev/null +++ b/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_denied_labels.tf.tmpl @@ -0,0 +1,31 @@ +resource "google_chronicle_data_access_label" "custom_data_access_label" { + provider = "google-beta" + location = "us" + instance = "{{index $.TestEnvVars "chronicle_id"}}" + data_access_label_id = "{{index $.Vars "data_access_label_id"}}" + udm_query = "principal.hostname=\"google.com\"" +} + +resource "google_chronicle_data_access_scope" "{{$.PrimaryResourceId}}" { + provider = "google-beta" + location = "us" + instance = "{{index $.TestEnvVars "chronicle_id"}}" + data_access_scope_id = "{{index $.Vars "data_access_scope_id"}}" + description = "{{index $.Vars "description"}}" + allow_all = true + denied_data_access_labels { + log_type = "GCP_CLOUDAUDIT" + } + denied_data_access_labels { + data_access_label = resource.google_chronicle_data_access_label.custom_data_access_label.data_access_label_id + } + denied_data_access_labels { + ingestion_label { + ingestion_label_key = "ingestion_key" + ingestion_label_value = "ingestion_value" + } + } + denied_data_access_labels { + asset_namespace = "my-namespace" + } +} diff --git a/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_ingestion_label.tf.tmpl b/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_ingestion_label.tf.tmpl new file mode 100644 index 000000000000..283cf977a2ba --- /dev/null +++ b/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_ingestion_label.tf.tmpl @@ -0,0 +1,14 @@ +resource "google_chronicle_data_access_scope" "{{$.PrimaryResourceId}}" { + provider = "google-beta" + location = "us" + instance = "{{index $.TestEnvVars "chronicle_id"}}" + data_access_scope_id = "{{index $.Vars "data_access_scope_id"}}" + description = "{{index $.Vars "description"}}" + allowed_data_access_labels { + ingestion_label { + ingestion_label_key = "ingestion_key" + ingestion_label_value = "ingestion_value" + } + } +} + diff --git a/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_logtype.tf.tmpl b/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_logtype.tf.tmpl new file mode 100644 index 000000000000..0193f4030101 --- /dev/null +++ b/mmv1/templates/terraform/examples/chronicle_dataaccessscope_with_logtype.tf.tmpl @@ -0,0 +1,13 @@ +resource "google_chronicle_data_access_scope" "{{$.PrimaryResourceId}}" { + provider = "google-beta" + location = "us" + instance = "{{index $.TestEnvVars "chronicle_id"}}" + data_access_scope_id = "{{index $.Vars "data_access_scope_id"}}" + description = "{{index $.Vars "description"}}" + allowed_data_access_labels { + log_type = "GCP_CLOUDAUDIT" + } + allowed_data_access_labels { + log_type = "GITHUB" + } +} diff --git a/mmv1/templates/terraform/examples/developer_connect_connection_existing_credentials.tf.tmpl b/mmv1/templates/terraform/examples/developer_connect_connection_existing_credentials.tf.tmpl index 90886cce18ef..3ccf7d5433a1 100644 --- a/mmv1/templates/terraform/examples/developer_connect_connection_existing_credentials.tf.tmpl +++ b/mmv1/templates/terraform/examples/developer_connect_connection_existing_credentials.tf.tmpl @@ -1,5 +1,4 @@ resource "google_developer_connect_connection" "{{$.PrimaryResourceId}}" { - provider = google-beta location = "us-central1" connection_id = "{{index $.Vars "connection_name"}}" @@ -15,4 +14,4 @@ resource "google_developer_connect_connection" "{{$.PrimaryResourceId}}" { output "next_steps" { description = "Follow the action_uri if present to continue setup" value = google_developer_connect_connection.{{$.PrimaryResourceId}}.installation_state -} \ No newline at end of file +} diff --git a/mmv1/templates/terraform/examples/developer_connect_connection_existing_installation.tf.tmpl b/mmv1/templates/terraform/examples/developer_connect_connection_existing_installation.tf.tmpl index de83625203c3..30a75fcad543 100644 --- a/mmv1/templates/terraform/examples/developer_connect_connection_existing_installation.tf.tmpl +++ b/mmv1/templates/terraform/examples/developer_connect_connection_existing_installation.tf.tmpl @@ -1,6 +1,5 @@ resource "google_secret_manager_secret" "github-token-secret" { - provider = google-beta secret_id = "github-token-secret" replication { @@ -9,15 +8,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") } resource "google_project_service_identity" "devconnect-p4sa" { - provider = google-beta - service = "developerconnect.googleapis.com" } @@ -31,14 +26,12 @@ 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_developer_connect_connection" "my-connection" { - provider = google-beta location = "us-central1" connection_id = "my-connection" diff --git a/mmv1/templates/terraform/examples/developer_connect_connection_github.tf.tmpl b/mmv1/templates/terraform/examples/developer_connect_connection_github.tf.tmpl new file mode 100644 index 000000000000..97d07f9deacf --- /dev/null +++ b/mmv1/templates/terraform/examples/developer_connect_connection_github.tf.tmpl @@ -0,0 +1,12 @@ +resource "google_developer_connect_connection" "{{$.PrimaryResourceId}}" { + location = "us-central1" + connection_id = "{{index $.Vars "connection_name"}}" + + github_config { + github_app = "DEVELOPER_CONNECT" + + authorizer_credential { + oauth_token_secret_version = "projects/devconnect-terraform-creds/secrets/tf-test-do-not-change-github-oauthtoken-e0b9e7/versions/1" + } + } +} diff --git a/mmv1/templates/terraform/examples/developer_connect_connection_github_doc.tf.tmpl b/mmv1/templates/terraform/examples/developer_connect_connection_github_doc.tf.tmpl new file mode 100644 index 000000000000..4fe608a1bede --- /dev/null +++ b/mmv1/templates/terraform/examples/developer_connect_connection_github_doc.tf.tmpl @@ -0,0 +1,42 @@ +resource "google_secret_manager_secret" "github-token-secret" { + + secret_id = "github-token-secret" + + replication { + auto {} + } +} + +resource "google_secret_manager_secret_version" "github-token-secret-version" { + + secret = google_secret_manager_secret.github-token-secret.id + secret_data = file("my-github-token.txt") +} + +data "google_iam_policy" "p4sa-secretAccessor" { + binding { + role = "roles/secretmanager.secretAccessor" + // Here, 123456789 is the Google Cloud project number for the project that contains the connection. + members = ["serviceAccount:service-123456789@gcp-sa-devconnect.iam.gserviceaccount.com"] + } +} + +resource "google_secret_manager_secret_iam_policy" "policy" { + + secret_id = google_secret_manager_secret.github-token-secret.secret_id + policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data +} + +resource "google_developer_connect_connection" "my-connection" { + + location = "us-central1" + connection_id = "my-connection" + + github_config { + github_app = "DEVELOPER_CONNECT" + app_installation_id = 123123 + authorizer_credential { + oauth_token_secret_version = google_secret_manager_secret_version.github-token-secret-version.id + } + } +} diff --git a/mmv1/templates/terraform/examples/developer_connect_connection_github_enterprise.tf.tmpl b/mmv1/templates/terraform/examples/developer_connect_connection_github_enterprise.tf.tmpl new file mode 100644 index 000000000000..1ded312974f5 --- /dev/null +++ b/mmv1/templates/terraform/examples/developer_connect_connection_github_enterprise.tf.tmpl @@ -0,0 +1,12 @@ +resource "google_developer_connect_connection" "{{$.PrimaryResourceId}}" { + location = "us-central1" + connection_id = "{{index $.Vars "connection_name"}}" + + github_enterprise_config { + host_uri = "https://ghe.proctor-staging-test.com" + app_id = 864434 + private_key_secret_version = "projects/devconnect-terraform-creds/secrets/tf-test-ghe-do-not-change-ghe-private-key-f522d2/versions/latest" + webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/tf-test-ghe-do-not-change-ghe-webhook-secret-3c806f/versions/latest" + app_installation_id = 837537 + } +} diff --git a/mmv1/templates/terraform/examples/developer_connect_connection_github_enterprise_doc.tf.tmpl b/mmv1/templates/terraform/examples/developer_connect_connection_github_enterprise_doc.tf.tmpl new file mode 100644 index 000000000000..456a7d34e8ca --- /dev/null +++ b/mmv1/templates/terraform/examples/developer_connect_connection_github_enterprise_doc.tf.tmpl @@ -0,0 +1,61 @@ +resource "google_secret_manager_secret" "private-key-secret" { + secret_id = "ghe-pk-secret" + + replication { + auto {} + } +} + +resource "google_secret_manager_secret_version" "private-key-secret-version" { + secret = google_secret_manager_secret.private-key-secret.id + secret_data = file("private-key.pem") +} + +resource "google_secret_manager_secret" "webhook-secret-secret" { + secret_id = "ghe-token-secret" + + replication { + auto {} + } +} + +resource "google_secret_manager_secret_version" "webhook-secret-secret-version" { + secret = google_secret_manager_secret.webhook-secret-secret.id + secret_data = "" +} + +data "google_iam_policy" "p4sa-secretAccessor" { + binding { + role = "roles/secretmanager.secretAccessor" + // Here, 123456789 is the Google Cloud project number for the project that contains the connection. + members = ["serviceAccount:service-123456789@gcp-sa-devconnect.iam.gserviceaccount.com"] + } +} + +resource "google_secret_manager_secret_iam_policy" "policy-pk" { + 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" { + secret_id = google_secret_manager_secret.webhook-secret-secret.secret_id + policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data +} + +resource "google_developer_connect_connection" "my-connection" { + location = "us-central1" + connection_id = "my-connection" + + github_enterprise_config { + host_uri = "https://ghe.com" + private_key_secret_version = google_secret_manager_secret_version.private-key-secret-version.id + webhook_secret_secret_version = google_secret_manager_secret_version.webhook-secret-secret-version.id + app_id = 100 + app_installation_id = 123123 + } + + depends_on = [ + google_secret_manager_secret_iam_policy.policy-pk, + google_secret_manager_secret_iam_policy.policy-whs + ] +} diff --git a/mmv1/templates/terraform/examples/developer_connect_connection_gitlab.tf.tmpl b/mmv1/templates/terraform/examples/developer_connect_connection_gitlab.tf.tmpl new file mode 100644 index 000000000000..e62e64a88461 --- /dev/null +++ b/mmv1/templates/terraform/examples/developer_connect_connection_gitlab.tf.tmpl @@ -0,0 +1,16 @@ +resource "google_developer_connect_connection" "{{$.PrimaryResourceId}}" { + location = "us-central1" + connection_id = "{{index $.Vars "connection_name"}}" + + gitlab_config { + webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-webhook/versions/latest" + + read_authorizer_credential { + user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-read-cred/versions/latest" + } + + authorizer_credential { + user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-auth-cred/versions/latest" + } + } +} diff --git a/mmv1/templates/terraform/examples/developer_connect_connection_gitlab_doc.tf.tmpl b/mmv1/templates/terraform/examples/developer_connect_connection_gitlab_doc.tf.tmpl new file mode 100644 index 000000000000..51c2f4714f38 --- /dev/null +++ b/mmv1/templates/terraform/examples/developer_connect_connection_gitlab_doc.tf.tmpl @@ -0,0 +1,81 @@ +resource "google_secret_manager_secret" "gitlab-read-cred-secret" { + secret_id = "gitlab-read-cred" + replication { + auto {} + } +} + +resource "google_secret_manager_secret_version" "gitlab-read-cred-secret-version" { + secret = google_secret_manager_secret.gitlab-read-cred-secret.id + secret_data = file("my-gitlab-read-cred.txt") +} + +resource "google_secret_manager_secret" "gitlab-auth-cred-secret" { + secret_id = "gitlab-auth-cred" + replication { + auto {} + } +} + +resource "google_secret_manager_secret_version" "gitlab-auth-cred-secret-version" { + secret = google_secret_manager_secret.gitlab-auth-cred-secret.id + secret_data = file("my-gitlab-auth-cred.txt") +} + +resource "google_secret_manager_secret" "gitlab-webhook-secret-secret" { + secret_id = "gitlab-webhook-secret" + replication { + auto {} + } +} + +resource "google_secret_manager_secret_version" "gitlab-webhook-secret-secret-version" { + secret = google_secret_manager_secret.gitlab-webhook-secret-secret.id + secret_data = file("my-gitlab-webhook-secret.txt") + +data "google_iam_policy" "p4sa-secretAccessor" { + binding { + role = "roles/secretmanager.secretAccessor" + // Here, 123456789 is the Google Cloud project number for the project that contains the connection. + members = ["serviceAccount:service-123456789@gcp-sa-devconnect.iam.gserviceaccount.com"] + } +} + +resource "google_secret_manager_secret_iam_policy" "policy-rc" { + secret_id = google_secret_manager_secret.gitlab-read-cred-secret.secret_id + policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data +} + +resource "google_secret_manager_secret_iam_policy" "policy-ac" { + secret_id = google_secret_manager_secret.gitlab-auth-cred-secret.secret_id + policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data +} + +resource "google_secret_manager_secret_iam_policy" "policy-wh" { + secret_id = google_secret_manager_secret.gitlab-webhook-secret-secret.secret_id + policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data +} + +resource "google_developer_connect_connection" "my-connection" { + + location = "us-central1" + connection_id = "my-connection" + + gitlab_config { + webhook_secret_secret_version = google_secret_manager_secret_version.gitlab-webhook-secret-secret-version.id + + read_authorizer_credential { + user_token_secret_version = google_secret_manager_secret_version.gitlab-read-cred-secret-version.id + } + + authorizer_credential { + user_token_secret_version = google_secret_manager_secret_version.gitlab-auth-cred-secret-version.id + } + } + + depends_on = [ + google_secret_manager_secret_iam_policy.policy-rc, + google_secret_manager_secret_iam_policy.policy-ac, + google_secret_manager_secret_iam_policy.policy-wh + ] +} diff --git a/mmv1/templates/terraform/examples/developer_connect_connection_gitlab_enterprise.tf.tmpl b/mmv1/templates/terraform/examples/developer_connect_connection_gitlab_enterprise.tf.tmpl new file mode 100644 index 000000000000..dcf4fa7847a2 --- /dev/null +++ b/mmv1/templates/terraform/examples/developer_connect_connection_gitlab_enterprise.tf.tmpl @@ -0,0 +1,18 @@ +resource "google_developer_connect_connection" "{{$.PrimaryResourceId}}" { + location = "us-central1" + connection_id = "{{index $.Vars "connection_name"}}" + + gitlab_enterprise_config { + host_uri = "https://gle-us-central1.gcb-test.com" + + webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-enterprise-webhook/versions/latest" + + read_authorizer_credential { + user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-enterprise-read-cred/versions/latest" + } + + authorizer_credential { + user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-enterprise-auth-cred/versions/latest" + } + } +} diff --git a/mmv1/templates/terraform/examples/developer_connect_connection_gitlab_enterprise_doc.tf.tmpl b/mmv1/templates/terraform/examples/developer_connect_connection_gitlab_enterprise_doc.tf.tmpl new file mode 100644 index 000000000000..1ff9b798b57a --- /dev/null +++ b/mmv1/templates/terraform/examples/developer_connect_connection_gitlab_enterprise_doc.tf.tmpl @@ -0,0 +1,83 @@ +resource "google_secret_manager_secret" "gitlab-read-cred-secret" { + secret_id = "gitlab-read-cred" + replication { + auto {} + } +} + +resource "google_secret_manager_secret_version" "gitlab-read-cred-secret-version" { + secret = google_secret_manager_secret.gitlab-read-cred-secret.id + secret_data = file("my-gitlab-read-cred.txt") +} + +resource "google_secret_manager_secret" "gitlab-auth-cred-secret" { + secret_id = "gitlab-auth-cred" + replication { + auto {} + } +} + +resource "google_secret_manager_secret_version" "gitlab-auth-cred-secret-version" { + secret = google_secret_manager_secret.gitlab-auth-cred-secret.id + secret_data = file("my-gitlab-auth-cred.txt") +} + +resource "google_secret_manager_secret" "gitlab-webhook-secret-secret" { + secret_id = "gitlab-webhook-secret" + replication { + auto {} + } +} + +resource "google_secret_manager_secret_version" "gitlab-webhook-secret-secret-version" { + secret = google_secret_manager_secret.gitlab-webhook-secret-secret.id + secret_data = file("my-gitlab-webhook-secret.txt") + +data "google_iam_policy" "p4sa-secretAccessor" { + binding { + role = "roles/secretmanager.secretAccessor" + // Here, 123456789 is the Google Cloud project number for the project that contains the connection. + members = ["serviceAccount:service-123456789@gcp-sa-devconnect.iam.gserviceaccount.com"] + } +} + +resource "google_secret_manager_secret_iam_policy" "policy-rc" { + secret_id = google_secret_manager_secret.gitlab-read-cred-secret.secret_id + policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data +} + +resource "google_secret_manager_secret_iam_policy" "policy-ac" { + secret_id = google_secret_manager_secret.gitlab-auth-cred-secret.secret_id + policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data +} + +resource "google_secret_manager_secret_iam_policy" "policy-wh" { + secret_id = google_secret_manager_secret.gitlab-webhook-secret-secret.secret_id + policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data +} + +resource "google_developer_connect_connection" "my-connection" { + + location = "us-central1" + connection_id = "my-connection" + + gitlab_enterprise_config { + host_uri = "https://gle.com" + + webhook_secret_secret_version = google_secret_manager_secret_version.gitlab-webhook-secret-secret-version.id + + read_authorizer_credential { + user_token_secret_version = google_secret_manager_secret_version.gitlab-read-cred-secret-version.id + } + + authorizer_credential { + user_token_secret_version = google_secret_manager_secret_version.gitlab-auth-cred-secret-version.id + } + } + + depends_on = [ + google_secret_manager_secret_iam_policy.policy-rc, + google_secret_manager_secret_iam_policy.policy-ac, + google_secret_manager_secret_iam_policy.policy-wh + ] +} diff --git a/mmv1/templates/terraform/examples/developer_connect_connection_new.tf.tmpl b/mmv1/templates/terraform/examples/developer_connect_connection_new.tf.tmpl index 9c6dede4321f..e5349abecb34 100644 --- a/mmv1/templates/terraform/examples/developer_connect_connection_new.tf.tmpl +++ b/mmv1/templates/terraform/examples/developer_connect_connection_new.tf.tmpl @@ -2,30 +2,23 @@ resource "google_developer_connect_connection" "{{$.PrimaryResourceId}}" { provider = google-beta location = "us-central1" connection_id = "{{index $.Vars "connection_name"}}" - github_config { github_app = "FIREBASE" } - depends_on = [google_project_iam_member.devconnect-secret] } - output "next_steps" { description = "Follow the action_uri if present to continue setup" value = google_developer_connect_connection.{{$.PrimaryResourceId}}.installation_state } - # Setup permissions. Only needed once per project resource "google_project_service_identity" "devconnect-p4sa" { provider = google-beta - service = "developerconnect.googleapis.com" } - resource "google_project_iam_member" "devconnect-secret" { provider = google-beta - project = "{{index $.TestEnvVars "project"}}" role = "roles/secretmanager.admin" member = google_project_service_identity.devconnect-p4sa.member -} \ No newline at end of file +} diff --git a/mmv1/templates/terraform/examples/developer_connect_git_repository_link_github.tf.tmpl b/mmv1/templates/terraform/examples/developer_connect_git_repository_link_github.tf.tmpl index 1c253849206f..d4cb09a4c0f0 100644 --- a/mmv1/templates/terraform/examples/developer_connect_git_repository_link_github.tf.tmpl +++ b/mmv1/templates/terraform/examples/developer_connect_git_repository_link_github.tf.tmpl @@ -1,5 +1,4 @@ resource "google_developer_connect_git_repository_link" "{{$.PrimaryResourceId}}" { - provider = google-beta git_repository_link_id = "{{index $.Vars "git_repository_link_name"}}" parent_connection = google_developer_connect_connection.github_conn.connection_id clone_uri = "https://github.com/gcb-developerconnect-robot/tf-demo.git" @@ -9,7 +8,6 @@ resource "google_developer_connect_git_repository_link" "{{$.PrimaryResourceId}} resource "google_developer_connect_connection" "github_conn" { - provider = google-beta location = "us-central1" connection_id = "{{index $.Vars "connection_name"}}" disabled = false diff --git a/mmv1/templates/terraform/examples/developer_connect_git_repository_link_github_doc.tf.tmpl b/mmv1/templates/terraform/examples/developer_connect_git_repository_link_github_doc.tf.tmpl index db9d1943ebb4..63829f055fde 100644 --- a/mmv1/templates/terraform/examples/developer_connect_git_repository_link_github_doc.tf.tmpl +++ b/mmv1/templates/terraform/examples/developer_connect_git_repository_link_github_doc.tf.tmpl @@ -1,5 +1,4 @@ resource "google_secret_manager_secret" "github-token-secret" { - provider = google-beta secret_id = "github-token-secret" replication { diff --git a/mmv1/templates/terraform/nested_property_documentation.html.markdown.tmpl b/mmv1/templates/terraform/nested_property_documentation.html.markdown.tmpl index 4b4979bc6193..4a4b0703a25c 100644 --- a/mmv1/templates/terraform/nested_property_documentation.html.markdown.tmpl +++ b/mmv1/templates/terraform/nested_property_documentation.html.markdown.tmpl @@ -4,7 +4,7 @@ {{- trimTemplate "nested_property_documentation.html.markdown.tmpl" $np -}} {{- end -}} {{- else if $.NestedProperties }} -The `{{ underscore $.Name }}` block {{ if $.Output }}contains{{ else }}supports{{ end }}: +The `{{ underscore $.Name }}` block {{ if $.Output }}contains{{ else }}supports{{ end }}: {{ "" }} {{- if $.IsA "Map" }} * `{{ underscore $.KeyName }}` - (Required) The identifier for this object. Format specified above. diff --git a/mmv1/templates/terraform/property_documentation.html.markdown.tmpl b/mmv1/templates/terraform/property_documentation.html.markdown.tmpl index 4eed7644c652..65dc62f1dadc 100644 --- a/mmv1/templates/terraform/property_documentation.html.markdown.tmpl +++ b/mmv1/templates/terraform/property_documentation.html.markdown.tmpl @@ -37,7 +37,7 @@ **Note**: This property is sensitive and will not be displayed in the plan. {{- end }} {{- if and (not $.FlattenObject) $.NestedProperties }} - Structure is [documented below](#nested_{{ underscore $.Name }}). + Structure is [documented below](#nested_{{ $.LineageAsSnakeCase}}). {{- end }} {{- if $.DeprecationMessage }} diff --git a/mmv1/third_party/terraform/main.go.tmpl b/mmv1/third_party/terraform/main.go.tmpl index 928a117a33db..d3b62681ef8e 100644 --- a/mmv1/third_party/terraform/main.go.tmpl +++ b/mmv1/third_party/terraform/main.go.tmpl @@ -31,7 +31,7 @@ func main() { // use the muxer muxServer, err := tf5muxserver.NewMuxServer(context.Background(), providers...) if err != nil { - log.Fatalf(err.Error()) + log.Fatal(err.Error()) } var serveOpts []tf5server.ServeOpt diff --git a/mmv1/third_party/terraform/services/chronicle/resource_chronicle_data_access_label_test.go.tmpl b/mmv1/third_party/terraform/services/chronicle/resource_chronicle_data_access_label_test.go.tmpl new file mode 100644 index 000000000000..f4b1493c0163 --- /dev/null +++ b/mmv1/third_party/terraform/services/chronicle/resource_chronicle_data_access_label_test.go.tmpl @@ -0,0 +1,76 @@ +package chronicle_test + +{{- if ne $.TargetVersionName "ga" }} + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/hashicorp/terraform-provider-google/google/acctest" + "github.com/hashicorp/terraform-provider-google/google/envvar" +) + +func TestAccChronicleDataAccessLabel_chronicleDataaccesslabelBasicExample_update(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "chronicle_id": envvar.GetTestChronicleInstanceIdFromEnv(t), + "random_suffix": acctest.RandString(t, 10), + } + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), + CheckDestroy: testAccCheckChronicleDataAccessLabelDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testAccChronicleDataAccessLabel_chronicleDataaccesslabelBasicExample_full(context), + }, + { + ResourceName: "google_chronicle_data_access_label.example", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"data_access_label_id", "instance", "location"}, + }, + + { + Config: testAccChronicleDataAccessLabel_chronicleDataaccesslabelBasicExample_update(context), + }, + { + ResourceName: "google_chronicle_data_access_label.example", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"data_access_label_id", "instance", "location"}, + }, + }, + }) +} + +func testAccChronicleDataAccessLabel_chronicleDataaccesslabelBasicExample_full(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_chronicle_data_access_label" "example" { + provider = "google-beta" + location = "us" + instance = "%{chronicle_id}" + data_access_label_id = "tf-test-label-id%{random_suffix}" + udm_query = "principal.hostname=\"google.com\"" + description = "tf-test-label-description%{random_suffix}" +} +`, context) +} + +func testAccChronicleDataAccessLabel_chronicleDataaccesslabelBasicExample_update(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_chronicle_data_access_label" "example" { + provider = "google-beta" + location = "us" + instance = "%{chronicle_id}" + data_access_label_id = "tf-test-label-id%{random_suffix}" + udm_query = "principal.hostname=\"google-updated.com\"" + description = "tf-test-label-updated-description%{random_suffix}" +} +`, context) +} + +{{- end }} diff --git a/mmv1/third_party/terraform/services/chronicle/resource_chronicle_data_access_scope_test.go.tmpl b/mmv1/third_party/terraform/services/chronicle/resource_chronicle_data_access_scope_test.go.tmpl new file mode 100644 index 000000000000..69f1fb1f02d5 --- /dev/null +++ b/mmv1/third_party/terraform/services/chronicle/resource_chronicle_data_access_scope_test.go.tmpl @@ -0,0 +1,125 @@ +package chronicle_test + +{{- if ne $.TargetVersionName "ga" }} + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/hashicorp/terraform-provider-google/google/acctest" + "github.com/hashicorp/terraform-provider-google/google/envvar" +) + +func TestAccChronicleDataAccessScope_chronicleDataaccessscopeBasicExample_update(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "chronicle_id": envvar.GetTestChronicleInstanceIdFromEnv(t), + "random_suffix": acctest.RandString(t, 10), + } + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), + CheckDestroy: testAccCheckChronicleDataAccessScopeDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testAccChronicleDataAccessScope_chronicleDataaccessscopeBasicExample_full(context), + }, + { + ResourceName: "google_chronicle_data_access_scope.example", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"data_access_scope_id", "instance", "location"}, + }, + + { + Config: testAccChronicleDataAccessScope_chronicleDataaccessscopeBasicExample_update(context), + }, + { + ResourceName: "google_chronicle_data_access_scope.example", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"data_access_scope_id", "instance", "location"}, + }, + }, + }) +} + +func testAccChronicleDataAccessScope_chronicleDataaccessscopeBasicExample_full(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_chronicle_data_access_label" "custom_data_access_label" { + provider = "google-beta" + location = "us" + instance = "%{chronicle_id}" + data_access_label_id = "tf-test-label-id%{random_suffix}" + udm_query = "principal.hostname=\"google.com\"" +} + +resource "google_chronicle_data_access_scope" "example" { + provider = "google-beta" + location = "us" + instance = "%{chronicle_id}" + data_access_scope_id = "tf-test-scope-id%{random_suffix}" + description = "tf-test-scope-description%{random_suffix}" + allow_all = false + allowed_data_access_labels { + log_type = "GITHUB" + } + denied_data_access_labels { + log_type = "GCP_CLOUDAUDIT" + } + denied_data_access_labels { + data_access_label = resource.google_chronicle_data_access_label.custom_data_access_label.data_access_label_id + } + denied_data_access_labels { + ingestion_label { + ingestion_label_key = "ingestion_key" + ingestion_label_value = "ingestion_value" + } + } + denied_data_access_labels { + asset_namespace = "my-namespace" + } +} +`, context) +} + +func testAccChronicleDataAccessScope_chronicleDataaccessscopeBasicExample_update(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_chronicle_data_access_label" "custom_data_access_label" { + provider = "google-beta" + location = "us" + instance = "%{chronicle_id}" + data_access_label_id = "tf-test-label-id%{random_suffix}" + udm_query = "principal.hostname=\"google-updated.com\"" +} + +resource "google_chronicle_data_access_scope" "example" { + provider = "google-beta" + location = "us" + instance = "%{chronicle_id}" + data_access_scope_id = "tf-test-scope-id%{random_suffix}" + description = "tf-test-scope-description-updated%{random_suffix}" + allow_all = true + denied_data_access_labels { + log_type = "GITHUB" + } + denied_data_access_labels { + data_access_label = resource.google_chronicle_data_access_label.custom_data_access_label.data_access_label_id + } + denied_data_access_labels { + ingestion_label { + ingestion_label_key = "ingestion_key-updated" + ingestion_label_value = "ingestion_value-updated" + } + } + denied_data_access_labels { + asset_namespace = "my-namespace-updated" + } +} +`, context) +} + +{{- end }} diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_instance_group_manager.go.tmpl b/mmv1/third_party/terraform/services/compute/resource_compute_instance_group_manager.go.tmpl index 61e911f809b1..9a966c17a24f 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_instance_group_manager.go.tmpl +++ b/mmv1/third_party/terraform/services/compute/resource_compute_instance_group_manager.go.tmpl @@ -221,7 +221,6 @@ func ResourceComputeInstanceGroupManager() *schema.Resource { }, }, - {{ if ne $.TargetVersionName `ga` -}} "standby_policy": { Computed: true, Type: schema.TypeList, @@ -262,7 +261,6 @@ func ResourceComputeInstanceGroupManager() *schema.Resource { Optional: true, Description: `The target number of stopped instances for this managed instance group.`, }, - {{- end }} "update_policy": { Computed: true, @@ -657,11 +655,9 @@ func resourceComputeInstanceGroupManagerCreate(d *schema.ResourceData, meta inte TargetPools: tpgresource.ConvertStringSet(d.Get("target_pools").(*schema.Set)), AutoHealingPolicies: expandAutoHealingPolicies(d.Get("auto_healing_policies").([]interface{})), Versions: expandVersions(d.Get("version").([]interface{})), - {{- if ne $.TargetVersionName "ga" }} StandbyPolicy: expandStandbyPolicy(d), TargetSuspendedSize: int64(d.Get("target_suspended_size").(int)), TargetStoppedSize: int64(d.Get("target_stopped_size").(int)), - {{- end }} UpdatePolicy: expandUpdatePolicy(d.Get("update_policy").([]interface{})), InstanceLifecyclePolicy: expandInstanceLifecyclePolicy(d.Get("instance_lifecycle_policy").([]interface{})), AllInstancesConfig: expandAllInstancesConfig(nil, d.Get("all_instances_config").([]interface{})), @@ -890,7 +886,6 @@ func resourceComputeInstanceGroupManagerRead(d *schema.ResourceData, meta interf if err := d.Set("version", flattenVersions(manager.Versions)); err != nil { return err } - {{- if ne $.TargetVersionName "ga" }} if err = d.Set("standby_policy", flattenStandbyPolicy(manager.StandbyPolicy)); err != nil { return fmt.Errorf("Error setting standby_policy in state: %s", err.Error()) } @@ -900,7 +895,6 @@ func resourceComputeInstanceGroupManagerRead(d *schema.ResourceData, meta interf if err := d.Set("target_stopped_size", manager.TargetStoppedSize); err != nil { return fmt.Errorf("Error setting target_stopped_size: %s", err) } - {{- end }} if err = d.Set("update_policy", flattenUpdatePolicy(manager.UpdatePolicy)); err != nil { return fmt.Errorf("Error setting update_policy in state: %s", err.Error()) } @@ -972,7 +966,6 @@ func resourceComputeInstanceGroupManagerUpdate(d *schema.ResourceData, meta inte change = true } - {{ if ne $.TargetVersionName `ga` -}} if d.HasChange("standby_policy") { updatedManager.StandbyPolicy = expandStandbyPolicy(d) change = true @@ -989,7 +982,6 @@ func resourceComputeInstanceGroupManagerUpdate(d *schema.ResourceData, meta inte updatedManager.ForceSendFields = append(updatedManager.ForceSendFields, "TargetStoppedSize") change = true } - {{- end }} if d.HasChange("update_policy") { updatedManager.UpdatePolicy = expandUpdatePolicy(d.Get("update_policy").([]interface{})) @@ -1315,7 +1307,6 @@ func expandInstanceLifecyclePolicy(configured []interface{}) *compute.InstanceGr return instanceLifecyclePolicy } -{{ if ne $.TargetVersionName `ga` -}} func expandStandbyPolicy(d *schema.ResourceData) *compute.InstanceGroupManagerStandbyPolicy { standbyPolicy := &compute.InstanceGroupManagerStandbyPolicy{} for _, sp := range d.Get("standby_policy").([]any) { @@ -1326,7 +1317,6 @@ func expandStandbyPolicy(d *schema.ResourceData) *compute.InstanceGroupManagerSt } return standbyPolicy } -{{- end }} func expandUpdatePolicy(configured []interface{}) *compute.InstanceGroupManagerUpdatePolicy { updatePolicy := &compute.InstanceGroupManagerUpdatePolicy{} @@ -1464,7 +1454,6 @@ func flattenStatefulPolicyStatefulIps(d *schema.ResourceData, ipfieldName string return sorted } -{{ if ne $.TargetVersionName `ga` -}} func flattenStandbyPolicy(standbyPolicy *compute.InstanceGroupManagerStandbyPolicy) []map[string]any{ results := []map[string]any{} if standbyPolicy != nil { @@ -1475,7 +1464,6 @@ func flattenStandbyPolicy(standbyPolicy *compute.InstanceGroupManagerStandbyPoli } return results } -{{- end }} func flattenUpdatePolicy(updatePolicy *compute.InstanceGroupManagerUpdatePolicy) []map[string]interface{} { results := []map[string]interface{}{} diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_instance_group_manager_test.go.tmpl b/mmv1/third_party/terraform/services/compute/resource_compute_instance_group_manager_test.go.tmpl index eeb7e45cd581..34adc0951e4e 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_instance_group_manager_test.go.tmpl +++ b/mmv1/third_party/terraform/services/compute/resource_compute_instance_group_manager_test.go.tmpl @@ -394,7 +394,6 @@ func TestAccInstanceGroupManager_stateful(t *testing.T) { }) } -{{ if ne $.TargetVersionName `ga` -}} func TestAccInstanceGroupManager_stoppedSuspendedTargetSize(t *testing.T) { t.Parallel() @@ -428,7 +427,6 @@ func TestAccInstanceGroupManager_stoppedSuspendedTargetSize(t *testing.T) { }, }) } -{{- end }} func TestAccInstanceGroupManager_waitForStatus(t *testing.T) { t.Parallel() @@ -1743,7 +1741,6 @@ resource "google_compute_instance_group_manager" "igm-basic" { `, network, template, target, igm) } -{{ if ne $.TargetVersionName `ga` -}} func testAccInstanceGroupManager_stoppedSuspendedTargetSize(network, template, igm string) string { return fmt.Sprintf(` data "google_compute_image" "my_image" { @@ -1835,7 +1832,6 @@ resource "google_compute_instance_group_manager" "sr-igm" { } `, network, template, igm) } -{{- end }} func testAccInstanceGroupManager_waitForStatus(template, target, igm, perInstanceConfig string) string { return fmt.Sprintf(` diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_group_manager.go.tmpl b/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_group_manager.go.tmpl index a6457ee97b32..053fdfd57b8d 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_group_manager.go.tmpl +++ b/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_group_manager.go.tmpl @@ -326,7 +326,6 @@ func ResourceComputeRegionInstanceGroupManager() *schema.Resource { }, }, - {{- if ne $.TargetVersionName "ga" }} "standby_policy": { Type: schema.TypeList, Computed: true, @@ -367,7 +366,6 @@ func ResourceComputeRegionInstanceGroupManager() *schema.Resource { Optional: true, Description: `The target number of stopped instances for this managed instance group.`, }, - {{- end }} "update_policy": { Type: schema.TypeList, @@ -671,11 +669,9 @@ func resourceComputeRegionInstanceGroupManagerCreate(d *schema.ResourceData, met TargetPools: tpgresource.ConvertStringSet(d.Get("target_pools").(*schema.Set)), AutoHealingPolicies: expandAutoHealingPolicies(d.Get("auto_healing_policies").([]interface{})), Versions: expandVersions(d.Get("version").([]interface{})), - {{- if ne $.TargetVersionName "ga" }} StandbyPolicy: expandStandbyPolicy(d), TargetSuspendedSize: int64(d.Get("target_suspended_size").(int)), TargetStoppedSize: int64(d.Get("target_stopped_size").(int)), - {{- end }} InstanceFlexibilityPolicy: expandInstanceFlexibilityPolicy(d), UpdatePolicy: expandRegionUpdatePolicy(d.Get("update_policy").([]interface{})), InstanceLifecyclePolicy: expandInstanceLifecyclePolicy(d.Get("instance_lifecycle_policy").([]interface{})), @@ -872,7 +868,6 @@ func resourceComputeRegionInstanceGroupManagerRead(d *schema.ResourceData, meta if err := d.Set("version", flattenVersions(manager.Versions)); err != nil { return err } - {{- if ne $.TargetVersionName "ga" }} if err = d.Set("standby_policy", flattenStandbyPolicy(manager.StandbyPolicy)); err != nil { return fmt.Errorf("Error setting standby_policy in state: %s", err.Error()) } @@ -882,7 +877,6 @@ func resourceComputeRegionInstanceGroupManagerRead(d *schema.ResourceData, meta if err := d.Set("target_stopped_size", manager.TargetStoppedSize); err != nil { return fmt.Errorf("Error setting target_stopped_size: %s", err) } - {{- end }} if err := d.Set("instance_flexibility_policy", flattenInstanceFlexibilityPolicy(manager.InstanceFlexibilityPolicy)); err != nil { return err } @@ -977,7 +971,6 @@ func resourceComputeRegionInstanceGroupManagerUpdate(d *schema.ResourceData, met change = true } - {{- if ne $.TargetVersionName "ga" }} if d.HasChange("standby_policy") { updatedManager.StandbyPolicy = expandStandbyPolicy(d) change = true @@ -994,7 +987,6 @@ func resourceComputeRegionInstanceGroupManagerUpdate(d *schema.ResourceData, met updatedManager.ForceSendFields = append(updatedManager.ForceSendFields, "TargetStoppedSize") change = true } - {{- end }} if d.HasChange("update_policy") { updatedManager.UpdatePolicy = expandRegionUpdatePolicy(d.Get("update_policy").([]interface{})) diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_group_manager_test.go.tmpl b/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_group_manager_test.go.tmpl index 7df6c05380d5..c3dcb8f9ca31 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_group_manager_test.go.tmpl +++ b/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_group_manager_test.go.tmpl @@ -398,7 +398,6 @@ func TestAccRegionInstanceGroupManager_stateful(t *testing.T) { } -{{- if ne $.TargetVersionName "ga" }} func TestAccRegionInstanceGroupManager_stoppedSuspendedTargetSize(t *testing.T) { t.Parallel() @@ -432,7 +431,6 @@ func TestAccRegionInstanceGroupManager_stoppedSuspendedTargetSize(t *testing.T) }, }) } -{{- end }} func TestAccRegionInstanceGroupManager_instanceFlexibilityPolicy(t *testing.T) { t.Parallel() @@ -1860,7 +1858,6 @@ resource "google_compute_region_instance_group_manager" "igm-basic" { `, context) } -{{- if ne $.TargetVersionName "ga" }} func testAccRegionInstanceGroupManager_stoppedSuspendedTargetSize(network, template, igm string) string { return fmt.Sprintf(` data "google_compute_image" "my_image" { @@ -1969,7 +1966,6 @@ resource "google_compute_region_instance_group_manager" "sr-igm" { } `, network, template, igm) } -{{- end }} func testAccRegionInstanceGroupManager_instanceFlexibilityPolicy(network, template, igm string) string { return fmt.Sprintf(` diff --git a/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster.go b/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster.go index 9f53c12df146..834f88fadc60 100644 --- a/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster.go +++ b/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster.go @@ -2241,6 +2241,7 @@ func expandGceClusterConfig(d *schema.ResourceData, config *transport_tpg.Config if v, ok := d.GetOk("cluster_config.0.gce_cluster_config.0.shielded_instance_config"); ok { cfgSic := v.([]interface{})[0].(map[string]interface{}) conf.ShieldedInstanceConfig = &dataproc.ShieldedInstanceConfig{} + conf.ShieldedInstanceConfig.ForceSendFields = []string{"EnableIntegrityMonitoring", "EnableSecureBoot", "EnableVtpm"} if v, ok := cfgSic["enable_integrity_monitoring"]; ok { conf.ShieldedInstanceConfig.EnableIntegrityMonitoring = v.(bool) } diff --git a/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster_test.go.tmpl b/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster_test.go.tmpl index 3b72d55d195e..85cb9de1aa05 100644 --- a/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster_test.go.tmpl +++ b/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster_test.go.tmpl @@ -254,6 +254,31 @@ func TestAccDataprocCluster_withInternalIpOnlyTrueAndShieldedConfig(t *testing.T }) } +func TestAccDataprocCluster_withShieldedConfig(t *testing.T) { + t.Parallel() + + var cluster dataproc.Cluster + rnd := acctest.RandString(t, 10) + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + CheckDestroy: testAccCheckDataprocClusterDestroy(t), + Steps: []resource.TestStep{ + { + Config: testAccDataprocCluster_withShieldedConfig(rnd), + Check: resource.ComposeTestCheckFunc( + testAccCheckDataprocClusterExists(t, "google_dataproc_cluster.basic", &cluster), + + // Testing behavior for Dataproc to use only internal IP addresses + resource.TestCheckResourceAttr("google_dataproc_cluster.basic", "cluster_config.0.gce_cluster_config.0.shielded_instance_config.0.enable_integrity_monitoring", "false"), + resource.TestCheckResourceAttr("google_dataproc_cluster.basic", "cluster_config.0.gce_cluster_config.0.shielded_instance_config.0.enable_secure_boot", "false"), + resource.TestCheckResourceAttr("google_dataproc_cluster.basic", "cluster_config.0.gce_cluster_config.0.shielded_instance_config.0.enable_vtpm", "false"), + ), + }, + }, + }) +} + func TestAccDataprocCluster_withConfidentialCompute(t *testing.T) { t.Parallel() @@ -1581,6 +1606,25 @@ resource "google_dataproc_cluster" "basic" { `, rnd, rnd, rnd, rnd) } +func testAccDataprocCluster_withShieldedConfig(rnd string) string { + return fmt.Sprintf(` +resource "google_dataproc_cluster" "basic" { + name = "tf-test-dproc-%s" + region = "us-central1" + + cluster_config { + gce_cluster_config { + shielded_instance_config { + enable_integrity_monitoring = false + enable_secure_boot = false + enable_vtpm = false + } + } + } +} +`, rnd) +} + func testAccDataprocCluster_withConfidentialCompute(rnd, subnetworkName string, imageUri string) string { return fmt.Sprintf(` resource "google_dataproc_cluster" "confidential" { diff --git a/mmv1/third_party/terraform/services/developerconnect/resource_developer_connect_connection_test.go.tmpl b/mmv1/third_party/terraform/services/developerconnect/resource_developer_connect_connection_test.go.tmpl index 717d43ef0330..5844c1819188 100644 --- a/mmv1/third_party/terraform/services/developerconnect/resource_developer_connect_connection_test.go.tmpl +++ b/mmv1/third_party/terraform/services/developerconnect/resource_developer_connect_connection_test.go.tmpl @@ -1,15 +1,15 @@ package developerconnect_test -{{- if ne $.TargetVersionName "ga" }} import ( "testing" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-google/google/acctest" + ) -func TestAccDeveloperConnectConnection_update(t *testing.T) { +func TestAccDeveloperConnectConnection_developerConnectConnectionGithubUpdate(t *testing.T) { t.Parallel() context := map[string]interface{}{ @@ -18,10 +18,10 @@ func TestAccDeveloperConnectConnection_update(t *testing.T) { acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), Steps: []resource.TestStep{ { - Config: testAccDeveloperConnectConnection_basic(context), + Config: testAccDeveloperConnectConnection_Github(context), }, { ResourceName: "google_developer_connect_connection.my-connection", @@ -30,22 +30,22 @@ func TestAccDeveloperConnectConnection_update(t *testing.T) { ImportStateVerifyIgnore: []string{"annotations", "connection_id", "labels", "location", "terraform_labels"}, }, { - Config: testAccDeveloperConnectConnection_update(context), + Config: testAccDeveloperConnectConnection_GithubUpdate(context), }, { ResourceName: "google_developer_connect_connection.my-connection", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"annotations", "connection_id", "labels", "location", "terraform_labels"}, + ImportStateVerifyIgnore: []string{"connection_id", "location", "terraform_labels"}, }, }, }) } -func testAccDeveloperConnectConnection_basic(context map[string]interface{}) string { - return acctest.Nprintf(` + +func testAccDeveloperConnectConnection_Github(context map[string]interface{}) string { + return acctest.Nprintf(` resource "google_developer_connect_connection" "my-connection" { - provider = google-beta location = "us-central1" connection_id = "tf-test-tf-test-connection%{random_suffix}" @@ -61,12 +61,17 @@ resource "google_developer_connect_connection" "my-connection" { } -func testAccDeveloperConnectConnection_update(context map[string]interface{}) string { +func testAccDeveloperConnectConnection_GithubUpdate(context map[string]interface{}) string { return acctest.Nprintf(` resource "google_developer_connect_connection" "my-connection" { - provider = google-beta location = "us-central1" connection_id = "tf-test-tf-test-connection%{random_suffix}" + annotations = {} + labels = {} + + crypto_key_config { + key_reference = "projects/devconnect-terraform-creds/locations/us-central1/keyRings/tf-keyring/cryptoKeys/tf-crypto-key" + } github_config { github_app = "DEVELOPER_CONNECT" @@ -80,4 +85,359 @@ resource "google_developer_connect_connection" "my-connection" { `, context) } -{{ end }} + +func TestAccDeveloperConnectConnection_developerConnectConnectionGithubEnterpriseUpdate(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(t, 10), + } + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + Steps: []resource.TestStep{ + { + Config: testAccDeveloperConnectConnection_GithubEnterprise(context), + }, + { + ResourceName: "google_developer_connect_connection.my-connection", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"connection_id", "labels", "terraform_labels"}, + }, + { + Config: testAccDeveloperConnectConnection_GithubEnterpriseUpdate(context), + }, + { + ResourceName: "google_developer_connect_connection.my-connection", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"connection_id", "location", "terraform_labels"}, + }, + }, + }) +} + + +func testAccDeveloperConnectConnection_GithubEnterprise(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_developer_connect_connection" "my-connection" { + location = "us-central1" + connection_id = "tf-test-tf-test-connection%{random_suffix}" + + github_enterprise_config { + host_uri = "https://ghe.proctor-staging-test.com" + app_id = 864434 + private_key_secret_version = "projects/devconnect-terraform-creds/secrets/tf-test-ghe-do-not-change-ghe-private-key-f522d2/versions/latest" + webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/tf-test-ghe-do-not-change-ghe-webhook-secret-3c806f/versions/latest" + } +} +`, context) +} + + +func testAccDeveloperConnectConnection_GithubEnterpriseUpdate(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_developer_connect_connection" "my-connection" { + location = "us-central1" + connection_id = "tf-test-tf-test-connection%{random_suffix}" + annotations = {} + labels = {} + + crypto_key_config { + key_reference = "projects/devconnect-terraform-creds/locations/us-central1/keyRings/tf-keyring/cryptoKeys/tf-crypto-key" + } + + github_enterprise_config { + host_uri = "https://ghe-asia.proctor-staging-test.com" + app_id = 866372 + private_key_secret_version = "projects/devconnect-terraform-creds/secrets/ghe-private-key-update/versions/latest" + webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/ghe-webhook-secret-update/versions/latest" + app_installation_id = 808867 + } +} +`, context) +} + + +func TestAccDeveloperConnectConnection_GhePrivConnection(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(t, 10), + } + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + Steps: []resource.TestStep{ + { + Config: testAccDeveloperConnectConnection_GhePrivConnection(context), + }, + { + ResourceName: "google_developer_connect_connection.my-connection", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"connection_id", "location", "terraform_labels"}, + }, + }, + }) +} + + +func testAccDeveloperConnectConnection_GhePrivConnection(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_developer_connect_connection" "my-connection" { + location = "us-central1" + connection_id = "tf-test-tf-test-connection%{random_suffix}" + annotations = {} + labels = {} + + github_enterprise_config { + host_uri = "https://ghe.proctor-private-ca.com" + app_id = 26 + private_key_secret_version = "projects/devconnect-terraform-creds/secrets/ghe-priv-private-key/versions/latest" + webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/tf-test-ghe-do-not-change-ghe-webhook-secret-3c806f/versions/latest" + app_installation_id = 24 + + ssl_ca_certificate = "-----BEGIN CERTIFICATE-----\nMIIEXTCCA0WgAwIBAgIUANaBCc9j/xdKJHU0sgmv6yE2WCIwDQYJKoZIhvcNAQEL\nBQAwLDEUMBIGA1UEChMLUHJvY3RvciBFbmcxFDASBgNVBAMTC1Byb2N0b3ItZW5n\nMB4XDTIxMDcxNTIwMDcwMloXDTIyMDcxNTIwMDcwMVowADCCASIwDQYJKoZIhvcN\nAQEBBQADggEPADCCAQoCggEBAMVel7I88DkhwW445BNPBZvJNTV1AreHdz4um4U1\nop2+4L7JeNrUs5SRc0fzeOyOmA9ZzTDu9hBC7zj/sVNUy6cIQGCj32sr5SCAEIat\nnFZlzmVqJPT4J5NAaE37KO5347myTJEBrvpq8az4CtvX0yUzPK0gbUmaSaztVi4o\ndbJLKyv575xCLC/Hu6fIHBDH19eG1Ath9VpuAOkttRRoxu2VqijJZrGqaS+0o+OX\nrLi5HMtZbZjgQB4mc1g3ZDKX/gynxr+CDNaqNOqxuog33Tl5OcOk9DrR3MInaE7F\nyQFuH9mzF64AqOoTf7Tr/eAIz5XVt8K51nk+fSybEfKVwtMCAwEAAaOCAaEwggGd\nMA4GA1UdDwEB/wQEAwIFoDAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBQU/9dYyqMz\nv9rOMwPZcoIRMDAQCjAfBgNVHSMEGDAWgBTkQGTiCkLCmv/Awxdz5TAVRmyFfDCB\njQYIKwYBBQUHAQEEgYAwfjB8BggrBgEFBQcwAoZwaHR0cDovL3ByaXZhdGVjYS1j\nb250ZW50LTYxYWEyYzA5LTAwMDAtMjJjMi05ZjYyLWQ0ZjU0N2Y4MDIwMC5zdG9y\nYWdlLmdvb2dsZWFwaXMuY29tLzQxNGU4ZTJjZjU2ZWEyYzQxNmM0L2NhLmNydDAo\nBgNVHREBAf8EHjAcghpnaGUucHJvY3Rvci1wcml2YXRlLWNhLmNvbTCBggYDVR0f\nBHsweTB3oHWgc4ZxaHR0cDovL3ByaXZhdGVjYS1jb250ZW50LTYxYWEyYzA5LTAw\nMDAtMjJjMi05ZjYyLWQ0ZjU0N2Y4MDIwMC5zdG9yYWdlLmdvb2dsZWFwaXMuY29t\nLzQxNGU4ZTJjZjU2ZWEyYzQxNmM0L2NybC5jcmwwDQYJKoZIhvcNAQELBQADggEB\nABo6BQLEZZ+YNiDuv2sRvcxSopQQb7fZjqIA9XOA35pNSKay2SncODnNvfsdRnOp\ncoy25sQSIzWyJ9zWl8DZ6evoOu5csZ2PoFqx5LsIq37w+ZcwD6DM8Zm7JqASxmxx\nGqTF0nHC4Aw8q8aJBeRD3PsSkfN5Q3DP3nTDnLyd0l+yPIkHUbZMoiFHX3BkhCng\nG96mYy/y3t16ghfV9lZkXpD/JK5aiN0bTHCDRc69owgfYiAcAqzBJ9gfZ90MBgzv\ngTTQel5dHg49SYXfnUpTy0HdQLEcoggOF8Q8V+xKdKa6eVbrvjJrkEJmvIQI5iCR\nhNvKR25mx8JUopqEXmONmqU=\n-----END CERTIFICATE-----\n\n-----BEGIN CERTIFICATE-----\nMIIDSDCCAjCgAwIBAgITMwWN+62nLcgyLa7p+jD1K90g6TANBgkqhkiG9w0BAQsF\nADAsMRQwEgYDVQQKEwtQcm9jdG9yIEVuZzEUMBIGA1UEAxMLUHJvY3Rvci1lbmcw\nHhcNMjEwNzEyMTM1OTQ0WhcNMzEwNzEwMTM1OTQzWjAsMRQwEgYDVQQKEwtQcm9j\ndG9yIEVuZzEUMBIGA1UEAxMLUHJvY3Rvci1lbmcwggEiMA0GCSqGSIb3DQEBAQUA\nA4IBDwAwggEKAoIBAQCYqJP5Qt90jIbld2dtuUV/zIkBFsTe4fapJfhBji03xBpN\nO1Yxj/jPSZ67Kdeoy0lEwvc2hL5FQGhIjLMR0mzOyN4fk/DZiA/4tAVi7hJyqpUC\n71JSwp7MwXL1b26CSE1MhcoCqA/E4iZxfJfF/ef4lhmC24UEmu8FEbldoy+6OysB\nRu7dGDwicW5F9h7eSkpGAsCRdJHh65iUx/IH0C4Ux2UZRDZdj6wVbuVu9tb938xF\nyRuVClONoLSn/lwdzeV7hQmBSm8qmfgbNPbYRaNLz3hOpsT+27aDQp2/pxue8hFJ\nd7We3+Lr5O4IL45PBwhVEAiFZqde6d4qViNEB2qTAgMBAAGjYzBhMA4GA1UdDwEB\n/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTkQGTiCkLCmv/Awxdz\n5TAVRmyFfDAfBgNVHSMEGDAWgBTkQGTiCkLCmv/Awxdz5TAVRmyFfDANBgkqhkiG\n9w0BAQsFAAOCAQEAfy5BJsWdx0oWWi7SFg9MbryWjBVPJl93UqACgG0Cgh813O/x\nlDZQhGO/ZFVhHz/WgooE/HgVNoVJTubKLLzz+zCkOB0wa3GMqJDyFjhFmUtd/3VM\nZh0ZQ+JWYsAiZW4VITj5xEn/d/B3xCFWGC1vhvhptEJ8Fo2cE1yM2pzk08NqFWoY\n4FaH0sbxWgyCKwTmtcYDbnx4FYuddryGCIxbYizqUK1dr4DGKeHonhm/d234Ew3x\n3vIBPoHMOfBec/coP1xAf5o+F+MRMO/sQ3tTGgyOH18lwsHo9SmXCrmOwVQPKrEw\nm+A+5TjXLmenyaBhqXa0vkAZYJhWdROhWC0VTA==\n-----END CERTIFICATE-----\n" + + service_directory_config { + service = "projects/devconnect-terraform-creds/locations/us-central1/namespaces/my-namespace/services/terraform-github" + } + } + +} +`, context) +} + + +func TestAccDeveloperConnectConnection_developerConnectConnectionGitlabUpdate(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(t, 10), + } + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + Steps: []resource.TestStep{ + { + Config: testAccDeveloperConnectConnection_Gitlab(context), + }, + { + ResourceName: "google_developer_connect_connection.my-connection", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"connection_id", "location", "terraform_labels"}, + }, + { + Config: testAccDeveloperConnectConnection_GitlabUpdate(context), + }, + { + ResourceName: "google_developer_connect_connection.my-connection", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"connection_id", "location", "terraform_labels"}, + }, + }, + }) +} + + +func testAccDeveloperConnectConnection_Gitlab(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_developer_connect_connection" "my-connection" { + location = "us-central1" + connection_id = "tf-test-tf-test-connection%{random_suffix}" + + gitlab_config { + webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-webhook/versions/latest" + + read_authorizer_credential { + user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-read-cred/versions/latest" + } + + authorizer_credential { + user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-auth-cred/versions/latest" + } + } +} +`, context) +} + + +func testAccDeveloperConnectConnection_GitlabUpdate(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_developer_connect_connection" "my-connection" { + location = "us-central1" + connection_id = "tf-test-tf-test-connection%{random_suffix}" + annotations = {} + labels = {} + + crypto_key_config { + key_reference = "projects/devconnect-terraform-creds/locations/us-central1/keyRings/tf-keyring/cryptoKeys/tf-crypto-key" + } + + gitlab_config { + webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-webhook/versions/latest" + + read_authorizer_credential { + user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-read-cred-update/versions/latest" + } + + authorizer_credential { + user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-auth-cred-update/versions/latest" + } + } +} +`, context) +} + +func TestAccDeveloperConnectConnection_GlePrivConnection(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(t, 10), + } + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + Steps: []resource.TestStep{ + { + Config: testAccDeveloperConnectConnection_GlePrivConnection(context), + }, + { + ResourceName: "google_developer_connect_connection.my-connection", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"connection_id", "location", "terraform_labels"}, + }, + }, + }) +} + + +func testAccDeveloperConnectConnection_GlePrivConnection(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_developer_connect_connection" "my-connection" { + location = "us-central1" + connection_id = "tf-test-tf-test-connection%{random_suffix}" + annotations = {} + labels = {} + + gitlab_enterprise_config { + host_uri = "https://gle-us.gle-us-private.com" + + webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-enterprise-webhook/versions/latest" + + read_authorizer_credential { + user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gle-private-read-token/versions/latest" + } + + authorizer_credential { + user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gle-private-api/versions/latest" + } + + ssl_ca_certificate = "-----BEGIN CERTIFICATE-----\nMIIFbjCCA1agAwIBAgIUH+nsWsqagMW9Ld8E9J71yPLPpD8wDQYJKoZIhvcNAQEL\nBQAwJDEiMCAGA1UEAwwZZ2xlLXVzLmdsZS11cy1wcml2YXRlLmNvbTAeFw0yNDEw\nMzExNjQzMjBaFw0zNDEwMjkxNjQzMjBaMCQxIjAgBgNVBAMMGWdsZS11cy5nbGUt\ndXMtcHJpdmF0ZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDL\n+dUU8MHo+Eskx4SSnI1thRIiljgsyJSzSOplaD4lqahFnrG0cB0ovKpyRL4A+0wM\nzVW7W1Pfi8DiEOxxfNo7pEj+0zrzJHHqnzW9kApIlRmO1TBBJ7i9HaVamJ1Od01b\n2WI/pnKFEvNfLQSDQBulhkHZ2McyauDhb1DxefKnVX8ac6qhxtc4IzrezIQuJ18N\nDPtNLUDD4rtU4mIX4lx1yBIplrgypAo1HDbJOwW8OR76MtjAY7ek3K6UCyduQtwy\nmfZ23b3Eg69W10HVMVTy6m5NaGKi/TWy2MJ71hKUQ1+tWIPH5SL7FzYPKL4XXw5W\np61LhIiBAd2tgD41b2cQxhUbVifc1qHtnwNz/tE77M9ySH37rEUIlExzr3D3JV+f\nXjXEXUr9as8GRnS5zhD/opKe7wKbwpYMHhylK1h6XH/sBO7dBajf5xCvpZZBDzrK\nkpTqwHspT7p40WF9d8odjEk/xZKn5LdcDG2I+4U7SVS5e8ud41HUQxJwQx56lKfh\n2WB+zs7nSyMfspTj4doY1OADEC1VQCyGrwlbclKTKmUWrgwQdm38KxDzW5Juyjmm\nzvfsWIlSMdnes0qVVo38N3Jz8/MHCLD79R2veWgA2fbqS3+4h2dRkR7htjaVlJMJ\nt7SwFiG39ic3OZpo+wTkaHlG4CBnbFDueUsOW2wEpQIDAQABo4GXMIGUMB0GA1Ud\nDgQWBBTExgzH2gz9+rJHvlTFPO0AvG88azAfBgNVHSMEGDAWgBTExgzH2gz9+rJH\nvlTFPO0AvG88azAPBgNVHRMBAf8EBTADAQH/MEEGA1UdEQQ6MDiCGWdsZS11cy5n\nbGUtdXMtcHJpdmF0ZS5jb22CGyouZ2xlLXVzLmdsZS11cy1wcml2YXRlLmNvbTAN\nBgkqhkiG9w0BAQsFAAOCAgEAjkd1ZNoekoWrmozD+Ta1OM0zWhv04eqhP8aYzhbd\nXRS+GyF6ifMwfWg9HogkH22ZPT5GszaL5DacSyOUqZgJ905Q6g1EFPnaKmFVHHeC\nzZAhg5oedAzcakZpYwZDSiLuPgsQfwgRnqWIYR8JcIM5bKRZNGyOg8eZ8cKu23A2\nPavL4B3Ra1l93KllKm21rigIhLPIPLoEyxEg9c9oTJF92r0+aRdf2Ln853260Fqf\ncEUWoXhqMGvDv/YEbqDjGQ/Kh7ZWdlIWhcKFOA0gluF7oExjt/MgSitukgg3aaic\n/eXXOrZDNYH7Ve610NUuNlhub1M47Tp7EgjUJVWlsKK84T8ZcZq7Hn4BzioUr95d\nHao6u19HWA/ISM8bwzHaYxscFI4u6phEL0HJzLf4EysEmS0rAnLxyol0apNx6znR\nhXsqxnSexKhXoLqnK1Vuhcg8DsvobXHqg68EGZ7BZ3ycPYaHSWU8Xh3l1gtYkcQ6\nzxXsKIijlpVKuYJvGA3EOMoZu6+2MYF8Tgp3N4sKMvPhqBhsmgxOYF5OkAbGlsUP\nyCYWFDBFHmbhvUu5JpbKuID2CPkBi16EetemvMQ9PGlLq/0fO/BBNkn6TYn9Kvg8\nAyvuONz54uFEAIKPCcZIosa3ml+5/pt+tBhtVzHA6vMxn18IYaNpuTwSxi/+M10K\nRjw=\n-----END CERTIFICATE-----\n" + + + service_directory_config { + service = "projects/devconnect-terraform-creds/locations/us-central1/namespaces/my-namespace/services/terraform-gle" + } + } + +} +`, context) +} + + +func TestAccDeveloperConnectConnection_developerConnectConnectionGitlabEnterpriseUpdate(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(t, 10), + } + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + Steps: []resource.TestStep{ + { + Config: testAccDeveloperConnectConnection_GitlabEnterprise(context), + }, + { + ResourceName: "google_developer_connect_connection.my-connection", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"connection_id", "location", "terraform_labels"}, + }, + { + Config: testAccDeveloperConnectConnection_GitlabEnterpriseUpdate(context), + }, + { + ResourceName: "google_developer_connect_connection.my-connection", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"connection_id", "location", "terraform_labels"}, + }, + }, + }) +} + + +func testAccDeveloperConnectConnection_GitlabEnterprise(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_developer_connect_connection" "my-connection" { + location = "us-central1" + connection_id = "tf-test-tf-test-connection%{random_suffix}" + + gitlab_enterprise_config { + host_uri = "https://gle-us-central1.gcb-test.com" + + webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-enterprise-webhook/versions/latest" + + read_authorizer_credential { + user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-enterprise-read-cred/versions/latest" + } + + authorizer_credential { + user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-enterprise-auth-cred/versions/latest" + } + } +} +`, context) +} + + +func testAccDeveloperConnectConnection_GitlabEnterpriseUpdate(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_developer_connect_connection" "my-connection" { + location = "us-central1" + connection_id = "tf-test-tf-test-connection%{random_suffix}" + annotations = {} + labels = {} + + crypto_key_config { + key_reference = "projects/devconnect-terraform-creds/locations/us-central1/keyRings/tf-keyring/cryptoKeys/tf-crypto-key" + } + + gitlab_enterprise_config { + host_uri = "https://gle-old.gcb-test.com" + + webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-enterprise-webhook/versions/latest" + + read_authorizer_credential { + user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-enterprise-read-cred-update/versions/latest" + } + + authorizer_credential { + user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-enterprise-auth-cred-update/versions/latest" + } + } +} +`, context) +} diff --git a/mmv1/third_party/terraform/website/docs/r/compute_instance_group_manager.html.markdown b/mmv1/third_party/terraform/website/docs/r/compute_instance_group_manager.html.markdown index 4492397f2d0d..284e66bb9fae 100644 --- a/mmv1/third_party/terraform/website/docs/r/compute_instance_group_manager.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/compute_instance_group_manager.html.markdown @@ -89,10 +89,9 @@ resource "google_compute_instance_group_manager" "appserver" { } ``` -## Example Usage with standby policy (`google-beta` provider) +## Example Usage with standby policy (`google` provider) ```hcl resource "google_compute_instance_group_manager" "igm-sr" { - provider = google-beta name = "tf-sr-igm" base_instance_name = "tf-sr-igm-instance" @@ -183,11 +182,11 @@ group. You can specify only one value. Structure is [documented below](#nested_a allInstancesConfig on the group, you must update the group's instances to apply the configuration. -* `standby_policy` - (Optional [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/suspended-and-stopped-vms-in-mig) and [API](https://cloud.google.com/compute/docs/reference/rest/beta/regionInstanceGroupManagers/patch) +* `standby_policy` - (Optional) The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/suspended-and-stopped-vms-in-mig). -* `target_suspended_size` - (Optional [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) The target number of suspended instances for this managed instance group. +* `target_suspended_size` - (Optional) The target number of suspended instances for this managed instance group. -* `target_stopped_size` - (Optional [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) The target number of stopped instances for this managed instance group. +* `target_stopped_size` - (Optional) The target number of stopped instances for this managed instance group. * `stateful_disk` - (Optional) Disks created on the instances that will be preserved on instance delete, update, etc. Structure is [documented below](#nested_stateful_disk). For more information see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs). diff --git a/mmv1/third_party/terraform/website/docs/r/compute_region_instance_group_manager.html.markdown b/mmv1/third_party/terraform/website/docs/r/compute_region_instance_group_manager.html.markdown index 9becef0feddf..c39fbe2503e3 100644 --- a/mmv1/third_party/terraform/website/docs/r/compute_region_instance_group_manager.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/compute_region_instance_group_manager.html.markdown @@ -91,10 +91,9 @@ resource "google_compute_region_instance_group_manager" "appserver" { } } ``` -## Example Usage with standby policy (`google-beta` provider) +## Example Usage with standby policy (`google` provider) ```hcl resource "google_compute_region_instance_group_manager" "igm-sr" { - provider = google-beta name = "tf-sr-igm" base_instance_name = "tf-sr-igm-instance" @@ -184,11 +183,11 @@ group. You can specify only one value. Structure is documented below. For more i allInstancesConfig on the group, you must update the group's instances to apply the configuration. -* `standby_policy` - (Optional [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/suspended-and-stopped-vms-in-mig) and [API](https://cloud.google.com/compute/docs/reference/rest/beta/regionInstanceGroupManagers/patch) +* `standby_policy` - (Optional) The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/suspended-and-stopped-vms-in-mig). -* `target_suspended_size` - (Optional [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) The target number of suspended instances for this managed instance group. +* `target_suspended_size` - (Optional) The target number of suspended instances for this managed instance group. -* `target_stopped_size` - (Optional [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) The target number of stopped instances for this managed instance group. +* `target_stopped_size` - (Optional) The target number of stopped instances for this managed instance group. * `update_policy` - (Optional) The update policy for this managed instance group. Structure is [documented below](#nested_update_policy). For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/updating-managed-instance-groups) and [API](https://cloud.google.com/compute/docs/reference/rest/beta/regionInstanceGroupManagers/patch) diff --git a/tools/diff-processor/breaking_changes/breaking_changes.go b/tools/diff-processor/breaking_changes/breaking_changes.go index 37404e53aa33..633a3fd4e652 100644 --- a/tools/diff-processor/breaking_changes/breaking_changes.go +++ b/tools/diff-processor/breaking_changes/breaking_changes.go @@ -14,7 +14,7 @@ type BreakingChange struct { RuleName string } -const breakingChangesPath = "develop/breaking-changes/breaking-changes" +const breakingChangesPath = "breaking-changes/breaking-changes" func NewBreakingChange(message, identifier string) BreakingChange { return BreakingChange{ diff --git a/tools/diff-processor/breaking_changes/breaking_changes_test.go b/tools/diff-processor/breaking_changes/breaking_changes_test.go index 91d4a75c3198..25f306f0e0bf 100644 --- a/tools/diff-processor/breaking_changes/breaking_changes_test.go +++ b/tools/diff-processor/breaking_changes/breaking_changes_test.go @@ -94,7 +94,7 @@ func TestComputeBreakingChanges(t *testing.T) { wantViolations: []BreakingChange{ { Message: "Resource `google-x` was either removed or renamed", - DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/develop/breaking-changes/breaking-changes#resource-map-resource-removal-or-rename", + DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/breaking-changes/breaking-changes#resource-map-resource-removal-or-rename", }, }, }, @@ -118,7 +118,7 @@ func TestComputeBreakingChanges(t *testing.T) { wantViolations: []BreakingChange{ { Message: "Field `field-b` within resource `google-x` was either removed or renamed", - DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/develop/breaking-changes/breaking-changes#resource-schema-field-removal-or-rename", + DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/breaking-changes/breaking-changes#resource-schema-field-removal-or-rename", }, }, }, @@ -143,7 +143,7 @@ func TestComputeBreakingChanges(t *testing.T) { wantViolations: []BreakingChange{ { Message: "Field `field-a` changed from optional to required on `google-x`", - DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/develop/breaking-changes/breaking-changes#field-optional-to-required", + DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/breaking-changes/breaking-changes#field-optional-to-required", }, }, }, @@ -167,11 +167,11 @@ func TestComputeBreakingChanges(t *testing.T) { wantViolations: []BreakingChange{ { Message: "Field `field-a` changed from optional to required on `google-x`", - DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/develop/breaking-changes/breaking-changes#field-optional-to-required", + DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/breaking-changes/breaking-changes#field-optional-to-required", }, { Message: "Field `field-b` within resource `google-x` was either removed or renamed", - DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/develop/breaking-changes/breaking-changes#resource-schema-field-removal-or-rename", + DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/breaking-changes/breaking-changes#resource-schema-field-removal-or-rename", }, }, }, @@ -200,15 +200,15 @@ func TestComputeBreakingChanges(t *testing.T) { wantViolations: []BreakingChange{ { Message: "Field `field-a` changed from optional to required on `google-x`", - DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/develop/breaking-changes/breaking-changes#field-optional-to-required", + DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/breaking-changes/breaking-changes#field-optional-to-required", }, { Message: "Field `field-b` within resource `google-x` was either removed or renamed", - DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/develop/breaking-changes/breaking-changes#resource-schema-field-removal-or-rename", + DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/breaking-changes/breaking-changes#resource-schema-field-removal-or-rename", }, { Message: "Resource `google-y` was either removed or renamed", - DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/develop/breaking-changes/breaking-changes#resource-map-resource-removal-or-rename", + DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/breaking-changes/breaking-changes#resource-map-resource-removal-or-rename", }, }, }, @@ -254,7 +254,7 @@ func TestComputeBreakingChanges(t *testing.T) { wantViolations: []BreakingChange{ { Message: "Field `field-a.sub-field-2` within resource `google-x` was either removed or renamed", - DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/develop/breaking-changes/breaking-changes#resource-schema-field-removal-or-rename", + DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/breaking-changes/breaking-changes#resource-schema-field-removal-or-rename", }, }, }, @@ -299,7 +299,7 @@ func TestComputeBreakingChanges(t *testing.T) { wantViolations: []BreakingChange{ { Message: "Field `field-a.sub-field-1` MinItems went from 100 to 25 on `google-x`", - DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/develop/breaking-changes/breaking-changes#field-shrinking-max", + DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/breaking-changes/breaking-changes#field-shrinking-max", }, }, }, @@ -344,7 +344,7 @@ func TestComputeBreakingChanges(t *testing.T) { wantViolations: []BreakingChange{ { Message: "Field `field-a.sub-field-1` MinItems went from 100 to 25 on `google-x`", - DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/develop/breaking-changes/breaking-changes#field-shrinking-max", + DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/breaking-changes/breaking-changes#field-shrinking-max", }, }, }, @@ -375,7 +375,7 @@ func TestComputeBreakingChanges(t *testing.T) { wantViolations: []BreakingChange{ { Message: "Field `field-a` MinItems went from 1 to 4 on `google-x`", - DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/develop/breaking-changes/breaking-changes#field-growing-min", + DocumentationReference: "https://googlecloudplatform.github.io/magic-modules/breaking-changes/breaking-changes#field-growing-min", }, }, },