|
| 1 | +/** |
| 2 | + * Copyright 2024 Google LLC |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +/** |
| 18 | + * Made to resemble |
| 19 | + * gcloud compute instance-groups managed create rmig-daof \ |
| 20 | + * --template=template \ |
| 21 | + * --size=3 \ |
| 22 | + * --region=us-central1 \ |
| 23 | + * --default-action-on-vm-failure=repair |
| 24 | + */ |
| 25 | +# [START compute_regional_instance_group_manager_daof_parent_tag] |
| 26 | +resource "google_compute_instance_template" "default" { |
| 27 | + name = "template" |
| 28 | + machine_type = "e2-medium" |
| 29 | + |
| 30 | + disk { |
| 31 | + source_image = "debian-cloud/debian-11" |
| 32 | + } |
| 33 | + |
| 34 | + network_interface { |
| 35 | + network = "default" |
| 36 | + } |
| 37 | +} |
| 38 | +# [START compute_regional_instance_group_manager_daof_tag] |
| 39 | +resource "google_compute_region_instance_group_manager" "default" { |
| 40 | + name = "rmig-daof" |
| 41 | + base_instance_name = "test" |
| 42 | + target_size = 3 |
| 43 | + region = "us-central1" |
| 44 | + |
| 45 | + version { |
| 46 | + instance_template = google_compute_instance_template.default.id |
| 47 | + name = "primary" |
| 48 | + } |
| 49 | + |
| 50 | + instance_lifecycle_policy { |
| 51 | + default_action_on_failure = "REPAIR" |
| 52 | + } |
| 53 | +} |
| 54 | +# [END compute_regional_instance_group_manager_daof_tag] |
| 55 | +# [END compute_regional_instance_group_manager_daof_parent_tag] |
0 commit comments