-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
303 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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,55 @@ | ||
/** | ||
* Copyright 2023 Google LLC | ||
* | ||
* 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. | ||
*/ | ||
/** | ||
* Made to resemble: | ||
* gcloud compute instance-groups managed create igm-stateful-disk-basic \ | ||
* --template example-tempalte \ | ||
* --size 1 \ | ||
* --stateful-disk device-name=bootdisk,auto-delete=NEVER | ||
*/ | ||
|
||
# [START compute_zonal_mig_stateful_disk_basic_parent_tag] | ||
resource "google_compute_instance_template" "default" { | ||
name = "example-template" | ||
machine_type = "e2-medium" | ||
disk { | ||
device_name = "bootdisk" | ||
source_image = "debian-cloud/debian-11" | ||
} | ||
network_interface { | ||
network = "default" | ||
} | ||
} | ||
|
||
# [START compute_zonal_mig_stateful_disk_basic] | ||
resource "google_compute_instance_group_manager" "default" { | ||
name = "igm-stateful-disk-basic" | ||
zone = "us-central1-f" | ||
base_instance_name = "instance" | ||
target_size = 1 | ||
|
||
version { | ||
instance_template = google_compute_instance_template.default.id | ||
} | ||
|
||
stateful_disk { | ||
device_name = "bootdisk" | ||
delete_rule = "NEVER" | ||
} | ||
|
||
} | ||
# [END compute_zonal_mig_stateful_disk_basic] | ||
# [END compute_zonal_mig_stateful_disk_basic_parent_tag] |
This file contains 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,55 @@ | ||
/** | ||
* Copyright 2023 Google LLC | ||
* | ||
* 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. | ||
*/ | ||
/** | ||
* Made to resemble: | ||
* gcloud compute instance-groups managed create example-rmig \ | ||
* --template example-template \ | ||
* --size 30 \ | ||
* --zones us-east1-b,us-east1-c \ | ||
* --instance-redistribution-type NONE | ||
*/ | ||
|
||
# [START compute_region_igm_redistribution_parent_tag] | ||
resource "google_compute_instance_template" "default" { | ||
name = "example-template" | ||
machine_type = "e2-medium" | ||
disk { | ||
source_image = "debian-cloud/debian-11" | ||
} | ||
network_interface { | ||
network = "default" | ||
} | ||
} | ||
|
||
# [START compute_region_igm_redistribution] | ||
resource "google_compute_region_instance_group_manager" "default" { | ||
name = "example-rmig" | ||
region = "us-east1" | ||
distribution_policy_zones = ["us-east1-b", "us-east1-c"] | ||
update_policy { | ||
type = "PROACTIVE" | ||
minimal_action = "REFRESH" | ||
instance_redistribution_type = "NONE" | ||
max_unavailable_fixed = 3 | ||
} | ||
target_size = 30 | ||
base_instance_name = "instance" | ||
version { | ||
instance_template = google_compute_instance_template.default.id | ||
} | ||
} | ||
# [END compute_region_igm_redistribution] | ||
# [END compute_region_igm_redistribution_parent_tag] |
This file contains 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,57 @@ | ||
/** | ||
* Copyright 2023 Google LLC | ||
* | ||
* 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. | ||
*/ | ||
/** | ||
* Made to resemble: | ||
* gcloud compute instance-groups managed create example-rmig \ | ||
* --template example-template \ | ||
* --size 30 \ | ||
* --zones us-east1-b,us-east1-c \ | ||
* --target-distribution-shape balanced \ | ||
* --instance-redistribution-type NONE | ||
*/ | ||
|
||
# [START compute_region_igm_shape_parent_tag] | ||
resource "google_compute_instance_template" "default" { | ||
name = "example-template" | ||
machine_type = "e2-medium" | ||
disk { | ||
source_image = "debian-cloud/debian-11" | ||
} | ||
network_interface { | ||
network = "default" | ||
} | ||
} | ||
|
||
# [START compute_region_igm_shape] | ||
resource "google_compute_region_instance_group_manager" "default" { | ||
name = "example-rmig" | ||
region = "us-east1" | ||
distribution_policy_zones = ["us-east1-b", "us-east1-c"] | ||
distribution_policy_target_shape = "BALANCED" | ||
update_policy { | ||
type = "PROACTIVE" | ||
minimal_action = "REFRESH" | ||
instance_redistribution_type = "NONE" | ||
max_unavailable_fixed = 3 | ||
} | ||
target_size = 30 | ||
base_instance_name = "instance" | ||
version { | ||
instance_template = google_compute_instance_template.default.id | ||
} | ||
} | ||
# [END compute_region_igm_shape] | ||
# [END compute_region_igm_shape_parent_tag] |
This file contains 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,48 @@ | ||
/** | ||
* Copyright 2023 Google LLC | ||
* | ||
* 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. | ||
*/ | ||
/** | ||
* Made to resemble: | ||
* gcloud compute instance-groups managed create example-rmig \ | ||
* --template example-template \ | ||
* --size 30 \ | ||
* --zones us-east1-b,us-east1-c | ||
*/ | ||
|
||
# [START compute_region_igm_spreading_parent_tag] | ||
resource "google_compute_instance_template" "default" { | ||
name = "example-template" | ||
machine_type = "e2-medium" | ||
disk { | ||
source_image = "debian-cloud/debian-11" | ||
} | ||
network_interface { | ||
network = "default" | ||
} | ||
} | ||
|
||
# [START compute_region_igm_spreading] | ||
resource "google_compute_region_instance_group_manager" "default" { | ||
name = "example-rmig" | ||
region = "us-east1" | ||
distribution_policy_zones = ["us-east1-b", "us-east1-c"] | ||
target_size = 30 | ||
base_instance_name = "instance" | ||
version { | ||
instance_template = google_compute_instance_template.default.id | ||
} | ||
} | ||
# [END compute_region_igm_spreading_parent_tag] | ||
# [END compute_region_igm_spreading] |
This file contains 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,61 @@ | ||
/** | ||
* Copyright 2023 Google LLC | ||
* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* Made to resemble: | ||
* gcloud compute instance-groups managed [create-instance|instance-configs update] example-cluster \ | ||
* --instance node-12 \ | ||
* --stateful-metadata mode=active,logging=elaborate | ||
*/ | ||
|
||
# [START compute_stateful_instance_group_manager_metadata_parent_tag] | ||
resource "google_compute_instance_template" "default" { | ||
machine_type = "e2-medium" | ||
|
||
disk { | ||
source_image = "debian-cloud/debian-11" | ||
} | ||
|
||
network_interface { | ||
network = "default" | ||
} | ||
} | ||
|
||
resource "google_compute_instance_group_manager" "default" { | ||
name = "example-cluster" | ||
base_instance_name = "test" | ||
target_size = 1 | ||
zone = "europe-west4-a" | ||
|
||
version { | ||
instance_template = google_compute_instance_template.default.id | ||
name = "primary" | ||
} | ||
} | ||
# [START compute_stateful_instance_group_manager_metadata_pic] | ||
resource "google_compute_per_instance_config" "default" { | ||
instance_group_manager = google_compute_instance_group_manager.default.name | ||
zone = google_compute_instance_group_manager.default.zone | ||
name = "node-12" | ||
preserved_state { | ||
metadata = { | ||
mode = "active" | ||
logging = "elaborate" | ||
} | ||
} | ||
} | ||
# [END compute_stateful_instance_group_manager_metadata_pic] | ||
# [END compute_stateful_instance_group_manager_metadata_parent_tag] |
This file contains 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
Oops, something went wrong.