-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add new resource RegionCompositeHealthCheck to terraform-beta #14955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d1ed700
Add new resource RegionCompositeHealthCheck to terraform-beta provider.
jkrish-c 55354e7
Merge branch 'GoogleCloudPlatform:main' into chc
jkrish-c 78c752f
adding newline for lint
jkrish-c 6e93e25
remove newline for lint
jkrish-c f467aca
Apply suggestions from code review
jkrish-c c732e8a
accepting reviewer suggestions
jkrish-c 765069c
add upgrade guide to 7.0.0 branch (#13790)
jkrish-c 1cc9a71
reorder imports
jkrish-c 1f1ff6a
parameterized testAccComputeRegionCompositeHealt:hCheck_update to mak…
jkrish-c File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| # Copyright 2025 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. | ||
|
|
||
| --- | ||
| # API resource name | ||
| name: 'RegionCompositeHealthCheck' | ||
| # Resource description for the provider documentation. | ||
| description: | | ||
| A composite health check resource specifies the health source resources and | ||
| the health destination resource to which the aggregated health result from | ||
| the health source resources is delivered. | ||
| references: | ||
| guides: | ||
| 'Health checks overview': 'https://cloud.google.com/load-balancing/docs/health-check-concepts' | ||
| api: 'https://cloud.google.com/compute/docs/reference/rest/v1/regionCompositeHealthChecks' | ||
| min_version: beta | ||
|
|
||
| # URL for the resource's standard List method. https://google.aip.dev/132 | ||
| # Terraform field names enclosed in double curly braces are replaced with | ||
| # the field values from the resource at runtime. | ||
| base_url: 'projects/{{project}}/regions/{{region}}/compositeHealthChecks' | ||
| # URL for the resource's standard Get method. https://google.aip.dev/131 | ||
| # Terraform field names enclosed in double curly braces are replaced with | ||
| # the field values from the resource at runtime. | ||
| self_link: 'projects/{{project}}/regions/{{region}}/compositeHealthChecks/{{name}}' | ||
|
|
||
| # URL for the resource's standard Create method, including query parameters. | ||
| # https://google.aip.dev/133 | ||
| # Terraform field names enclosed in double curly braces are replaced with | ||
| # the field values from the resource at runtime. | ||
| create_url: 'projects/{{project}}/regions/{{region}}/compositeHealthChecks' | ||
|
|
||
| # Overrides the URL for the resource's standard Update method. (If unset, the | ||
| # self_link URL is used by default.) https://google.aip.dev/134 | ||
| # Terraform field names enclosed in double curly braces are replaced with | ||
| # the field values from the resource at runtime. | ||
| update_url: 'projects/{{project}}/regions/{{region}}/compositeHealthChecks/{{name}}' | ||
| # The HTTP verb used to update a resource. Allowed values: :POST, :PUT, :PATCH. Default: :PUT. | ||
| update_verb: 'PATCH' | ||
| # If true, the resource sets an `updateMask` query parameter listing modified | ||
| # fields when updating the resource. If false, it does not. | ||
| update_mask: true | ||
|
|
||
| # If true, code for handling long-running operations is generated along with | ||
| # the resource. If false, that code is not generated. | ||
| autogen_async: true | ||
| # Sets parameters for handling operations returned by the API. | ||
| async: | ||
| # Overrides which API calls return operations. Default: ['create', | ||
| # 'update', 'delete'] | ||
| # actions: ['create', 'update', 'delete'] | ||
| operation: | ||
| base_url: 'projects/{{project}}/regions/{{region}}/operations/{{op_id}}' | ||
|
|
||
| parameters: | ||
| - name: 'region' | ||
| type: String | ||
| required: true | ||
| immutable: true | ||
| url_param_only: true | ||
| description: | | ||
| URL of the region where the composite health check resides. | ||
| - name: 'name' | ||
| type: String | ||
| required: true | ||
| immutable: true | ||
| description: | | ||
| Name of the resource. Provided by the client when the resource is created. | ||
| The name must be 1-63 characters long, and comply with RFC1035. | ||
| Specifically, the name must be 1-63 characters long and match the regular | ||
| expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first | ||
| character must be a lowercase letter, and all following characters must | ||
| be a dash, lowercase letter, or digit, except the last character, which | ||
| cannot be a dash. | ||
|
|
||
| properties: | ||
| - name: 'description' | ||
| type: String | ||
| description: | | ||
| An optional description of this resource. Provide this property when you | ||
| create the resource. | ||
| - name: 'healthSources' | ||
| type: Array | ||
| item_type: | ||
| name: 'healthSource' | ||
| type: ResourceRef | ||
| resource: 'RegionHealthSource' | ||
| imports: 'selfLink' | ||
| description: | | ||
| URLs to the HealthSource resources whose results are AND'ed. | ||
| I.e. he aggregated result is is HEALTHY only if all sources | ||
| are HEALTHY. Must have at least 1. Must not have more than 10. | ||
| Must be regional and in the same region as the | ||
| CompositeHealthCheck. Can be mutated. | ||
| min_size: 1 | ||
| max_size: 10 | ||
| - name: 'healthDestination' | ||
| type: ResourceRef | ||
| resource: 'ForwardingRule' | ||
| imports: 'selfLink' | ||
| description: | | ||
| URL to the destination resource. Must be set. Must be a | ||
| ForwardingRule. The ForwardingRule must have | ||
| load balancing scheme INTERNAL or | ||
| INTERNAL_MANAGED and must be regional and in the same region | ||
| as the CompositeHealthCheck (cross-region deployment for | ||
| INTERNAL_MANAGED is not supported). Can be mutated. | ||
| required: true | ||
| - name: 'id' | ||
| type: String | ||
| description: 'The unique identifier for the resource. This identifier is defined by the server.' | ||
| output: true | ||
| - name: 'creationTimestamp' | ||
| type: String | ||
| description: 'Creation timestamp in RFC3339 text format.' | ||
| output: true | ||
| - name: 'selfLinkWithId' | ||
| type: String | ||
| description: 'Server-defined URL with id for the resource.' | ||
| output: true | ||
| - name: 'fingerprint' | ||
| type: Fingerprint | ||
| description: | | ||
| Fingerprint of this resource. A hash of the contents stored in this object. | ||
| This field is used in optimistic locking. This field will be ignored when | ||
| inserting a `CompositeHealthCheck`. An up-to-date fingerprint | ||
| must be provided in order to patch the CompositeHealthCheck; Otherwise, | ||
| the request will fail with error `412 conditionNotMet`. To see | ||
| the latest fingerprint, make a `get()` request to retrieve the | ||
| CompositeHealthCheck. | ||
| output: true | ||
|
|
||
| examples: | ||
| - name: "compute_region_composite_health_check_basic" | ||
| primary_resource_id: "example_test_composite_health_check" | ||
| vars: | ||
| name: "test-composite-health-check" | ||
| description: "Example composite health check basic" | ||
| min_version: 'beta' | ||
| test_env_vars: | ||
| project: 'PROJECT_NAME' | ||
66 changes: 66 additions & 0 deletions
66
mmv1/templates/terraform/examples/compute_region_composite_health_check_basic.tf.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| resource "google_compute_region_composite_health_check" "{{$.PrimaryResourceId}}" { | ||
| provider = google-beta | ||
| name = "{{index $.Vars "name"}}" | ||
| description = "test regional composite health check resource" | ||
| region = "us-central1" | ||
| health_sources = [google_compute_region_health_source.default.id] | ||
| health_destination = google_compute_forwarding_rule.default.id | ||
| } | ||
|
|
||
| resource "google_compute_region_health_source" "default" { | ||
| provider = google-beta | ||
| name = "{{index $.Vars "name"}}-hs" | ||
| region = "us-central1" | ||
| source_type = "BACKEND_SERVICE" | ||
| sources = [google_compute_region_backend_service.default.id] | ||
| health_aggregation_policy = google_compute_region_health_aggregation_policy.hap.id | ||
| } | ||
|
|
||
| resource "google_compute_region_health_aggregation_policy" "hap" { | ||
| provider = google-beta | ||
| name = "{{index $.Vars "name"}}-hap" | ||
| description = "health aggregation policy for health source" | ||
| region = "us-central1" | ||
| } | ||
|
|
||
| resource "google_compute_health_check" "default" { | ||
| provider = google-beta | ||
| name = "{{index $.Vars "name"}}-hc" | ||
| http_health_check { | ||
| port = 80 | ||
| } | ||
| } | ||
|
|
||
| resource "google_compute_region_backend_service" "default" { | ||
| provider = google-beta | ||
| name = "{{index $.Vars "name"}}-bs" | ||
| region = "us-central1" | ||
| health_checks = [google_compute_health_check.default.id] | ||
| load_balancing_scheme = "INTERNAL" | ||
| } | ||
|
|
||
| resource "google_compute_forwarding_rule" "default" { | ||
| provider = google-beta | ||
| name = "{{index $.Vars "name"}}-fr" | ||
| region = "us-central1" | ||
| load_balancing_scheme = "INTERNAL" | ||
| backend_service = google_compute_region_backend_service.default.id | ||
| network = google_compute_network.default.id | ||
| subnetwork = google_compute_subnetwork.default.id | ||
| ip_protocol = "TCP" | ||
| all_ports = true | ||
| } | ||
|
|
||
| resource "google_compute_network" "default" { | ||
| provider = google-beta | ||
| name = "{{index $.Vars "name"}}-net" | ||
| auto_create_subnetworks = false | ||
| } | ||
|
|
||
| resource "google_compute_subnetwork" "default" { | ||
| provider = google-beta | ||
| name = "{{index $.Vars "name"}}-sub" | ||
| ip_cidr_range = "10.2.0.0/16" | ||
| region = "us-central1" | ||
| network = google_compute_network.default.id | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.