Skip to content

Commit

Permalink
Merge branch 'main' into fix-root-ca-sample
Browse files Browse the repository at this point in the history
  • Loading branch information
msampathkumar authored Jul 4, 2024
2 parents ac028dc + c9473b3 commit 1697025
Show file tree
Hide file tree
Showing 22 changed files with 1,314 additions and 37 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
/vertex_ai/ @terraform-google-modules/dee-data-ai @terraform-google-modules/terraform-samples-reviewers
/vpc/ @terraform-google-modules/dee-infra @terraform-google-modules/terraform-samples-reviewers
/workflows/ @terraform-google-modules/torus-dpe @terraform-google-modules/terraform-samples-reviewers
/managedkafka/ @terraform-google-modules/managedkafka-dev-team @terraform-google-modules/terraform-samples-reviewers
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Make will use bash instead of sh
SHELL := /usr/bin/env bash

DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.20
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.21
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
REGISTRY_URL := gcr.io/cloud-foundation-cicd
DOCKER_BIN ?= docker
Expand Down
2 changes: 1 addition & 1 deletion build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ tags:
- 'integration'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.20'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.21'
2 changes: 1 addition & 1 deletion build/lint.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ tags:
- 'lint'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.20'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.21'
34 changes: 34 additions & 0 deletions compute/quickstart/create_vm/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* 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.
*/

# [START compute_instances_quickstart]
resource "google_compute_instance" "default" {
name = "my-vm"
machine_type = "n1-standard-1"
zone = "us-central1-a"

boot_disk {
initialize_params {
image = "ubuntu-minimal-2210-kinetic-amd64-v20230126"
}
}

network_interface {
network = "default"
access_config {}
}
}
# [END compute_instances_quickstart]
55 changes: 55 additions & 0 deletions compute/rmig_default_action_on_failure/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* Copyright 2024 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 rmig-daof \
* --template=template \
* --size=3 \
* --region=us-central1 \
* --default-action-on-vm-failure=repair
*/
# [START compute_regional_instance_group_manager_daof_parent_tag]
resource "google_compute_instance_template" "default" {
name = "template"
machine_type = "e2-medium"

disk {
source_image = "debian-cloud/debian-11"
}

network_interface {
network = "default"
}
}
# [START compute_regional_instance_group_manager_daof_tag]
resource "google_compute_region_instance_group_manager" "default" {
name = "rmig-daof"
base_instance_name = "test"
target_size = 3
region = "us-central1"

version {
instance_template = google_compute_instance_template.default.id
name = "primary"
}

instance_lifecycle_policy {
default_action_on_failure = "REPAIR"
}
}
# [END compute_regional_instance_group_manager_daof_tag]
# [END compute_regional_instance_group_manager_daof_parent_tag]
61 changes: 61 additions & 0 deletions compute/zonal_mig_all_instances_config/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* Copyright 202 4Google 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 all-instances-config update mig-aic \
* --metadata="key1"="value1","key2"="value2" \
* --labels="key3"="value3","key4"="value4"
*/

# [START compute_zonal_instance_group_manager_aic_parent_tag]
resource "google_compute_instance_template" "default" {
name = "some-instance-template"
machine_type = "e2-medium"

disk {
source_image = "debian-cloud/debian-11"
}

network_interface {
network = "default"
}
}
# [START compute_zonal_instance_group_manager_aic_tag]
resource "google_compute_instance_group_manager" "default" {

name = "mig-aic"
base_instance_name = "test"
zone = "us-central1-f"

version {
instance_template = google_compute_instance_template.default.id
name = "primary"
}

all_instances_config {
metadata = {
key1 = "value1",
key2 = "value2"
}
labels = {
key3 = "value3",
key4 = "value4"
}
}
}
# [END compute_zonal_instance_group_manager_aic_tag]
# [END compute_zonal_instance_group_manager_aic_parent_tag]
55 changes: 55 additions & 0 deletions compute/zonal_mig_default_action_on_failure/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* Copyright 2024 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 mig-daof \
* --template=template \
* --size=3 \
* --zone=us-central1-f \
* --default-action-on-vm-failure=do_nothing
*/
# [START compute_zonal_instance_group_manager_daof_parent_tag]
resource "google_compute_instance_template" "default" {
name = "template"
machine_type = "e2-medium"

disk {
source_image = "debian-cloud/debian-11"
}

network_interface {
network = "default"
}
}
# [START compute_zonal_instance_group_manager_daof_tag]
resource "google_compute_instance_group_manager" "default" {
name = "mig-daof"
base_instance_name = "test"
target_size = 3
zone = "us-central1-f"

version {
instance_template = google_compute_instance_template.default.id
name = "primary"
}

instance_lifecycle_policy {
default_action_on_failure = "DO_NOTHING"
}
}
# [END compute_zonal_instance_group_manager_daof_tag]
# [END compute_zonal_instance_group_manager_daof_parent_tag]
54 changes: 54 additions & 0 deletions compute/zonal_mig_standby_policy/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* Copyright 2024 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 beta compute instance-groups managed update standby-mig \
* --standby-policy-mode=scale-out-pool \
* --standby-policy-initial-delay=50 \
* --zone=us-central1-f
*/
# [START compute_zonal_instance_group_manager_standby_policy_parent_tag]
resource "google_compute_instance_template" "default" {
name = "an-instance-template"
machine_type = "e2-medium"

disk {
source_image = "debian-cloud/debian-11"
}

network_interface {
network = "default"
}
}

# [START compute_zonal_instance_group_manager_standby_policy_tag]
resource "google_compute_instance_group_manager" "default" {
provider = google-beta
name = "standby-mig"
base_instance_name = "test"
target_size = 3
zone = "us-central1-f"

version {
instance_template = google_compute_instance_template.default.id
name = "primary"
}
standby_policy {
initial_delay_sec = 50
mode = "SCALE_OUT_POOL"
}
}
# [END compute_zonal_instance_group_manager_standby_policy_tag]
# [END compute_zonal_instance_group_manager_standby_policy_parent_tag]
Loading

0 comments on commit 1697025

Please sign in to comment.