From 11d7179773abf41e1f4a101dd729edaf1773929a Mon Sep 17 00:00:00 2001 From: cloud-foundation-bot <60107303+cloud-foundation-bot@users.noreply.github.com> Date: Fri, 23 Apr 2021 20:25:17 -0500 Subject: [PATCH] feat!: add Terraform 0.13 constraint and module attribution (#22) * feat!: add Terraform 0.13 constraint and module attribution * Bump version an fix subnet name Co-authored-by: James Duncan --- Makefile | 2 +- modules/gh-runner-gke/main.tf | 4 +- modules/gh-runner-gke/versions.tf | 31 +++++++++++++++ .../gh-runner-mig-container-vm/versions.tf | 31 +++++++++++++++ modules/gh-runner-mig-vm/versions.tf | 39 +++++++++++++++++++ test/setup/main.tf | 30 +++++++------- test/setup/versions.tf | 4 +- 7 files changed, 121 insertions(+), 20 deletions(-) create mode 100644 modules/gh-runner-gke/versions.tf create mode 100644 modules/gh-runner-mig-container-vm/versions.tf create mode 100644 modules/gh-runner-mig-vm/versions.tf diff --git a/Makefile b/Makefile index d320c38..a7165ee 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ # Make will use bash instead of sh SHELL := /usr/bin/env bash -DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0 +DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0.13 DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools REGISTRY_URL := gcr.io/cloud-foundation-cicd diff --git a/modules/gh-runner-gke/main.tf b/modules/gh-runner-gke/main.tf index f0c2d33..3604add 100644 --- a/modules/gh-runner-gke/main.tf +++ b/modules/gh-runner-gke/main.tf @@ -50,7 +50,7 @@ resource "google_compute_subnetwork" "gh-subnetwork" { *****************************************/ module "runner-cluster" { source = "terraform-google-modules/kubernetes-engine/google//modules/beta-public-cluster/" - version = "~> 12.0" + version = "~> 14.1" project_id = var.project_id name = "gh-runner-${var.repo_name}" regional = false @@ -60,7 +60,7 @@ module "runner-cluster" { network_project_id = var.subnetwork_project != "" ? var.subnetwork_project : var.project_id subnetwork = local.subnet_name ip_range_pods = var.ip_range_pods_name - ip_range_services = var.ip_range_pods_name + ip_range_services = var.ip_range_services_name logging_service = "logging.googleapis.com/kubernetes" monitoring_service = "monitoring.googleapis.com/kubernetes" remove_default_node_pool = true diff --git a/modules/gh-runner-gke/versions.tf b/modules/gh-runner-gke/versions.tf new file mode 100644 index 0000000..aad5436 --- /dev/null +++ b/modules/gh-runner-gke/versions.tf @@ -0,0 +1,31 @@ +/** + * Copyright 2021 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. + */ + +terraform { + required_version = ">= 0.13" + required_providers { + + google = { + source = "hashicorp/google" + version = "~> 3.53" + } + } + + provider_meta "google" { + module_name = "blueprints/terraform/terraform-google-github-actions-runners:gh-runner-gke/v1.0.0" + } + +} diff --git a/modules/gh-runner-mig-container-vm/versions.tf b/modules/gh-runner-mig-container-vm/versions.tf new file mode 100644 index 0000000..0774dd8 --- /dev/null +++ b/modules/gh-runner-mig-container-vm/versions.tf @@ -0,0 +1,31 @@ +/** + * Copyright 2021 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. + */ + +terraform { + required_version = ">= 0.13" + required_providers { + + google = { + source = "hashicorp/google" + version = "~> 3.53" + } + } + + provider_meta "google" { + module_name = "blueprints/terraform/terraform-google-github-actions-runners:gh-runner-mig-container-vm/v1.0.0" + } + +} diff --git a/modules/gh-runner-mig-vm/versions.tf b/modules/gh-runner-mig-vm/versions.tf new file mode 100644 index 0000000..ec03e43 --- /dev/null +++ b/modules/gh-runner-mig-vm/versions.tf @@ -0,0 +1,39 @@ +/** + * Copyright 2021 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. + */ + +terraform { + required_version = ">= 0.13" + required_providers { + + google = { + source = "hashicorp/google" + version = "~> 3.53" + } + google-beta = { + source = "hashicorp/google-beta" + version = "~> 3.53" + } + } + + provider_meta "google" { + module_name = "blueprints/terraform/terraform-google-github-actions-runners:gh-runner-mig-vm/v1.0.0" + } + + provider_meta "google-beta" { + module_name = "blueprints/terraform/terraform-google-github-actions-runners:gh-runner-mig-vm/v1.0.0" + } + +} diff --git a/test/setup/main.tf b/test/setup/main.tf index c51662c..a41ec65 100644 --- a/test/setup/main.tf +++ b/test/setup/main.tf @@ -16,7 +16,7 @@ module "project" { source = "terraform-google-modules/project-factory/google" - version = "~> 9.0" + version = "~> 10.2" name = "ci-terraform-gh-runners" random_project_id = "true" @@ -35,14 +35,14 @@ module "project" { module "project-gke" { source = "terraform-google-modules/project-factory/google" - version = "~> 9.0" + version = "~> 10.2" + + name = "ci-runners-gke" + random_project_id = "true" + org_id = var.org_id + folder_id = var.folder_id + billing_account = var.billing_account - name = "ci-runners-gke" - random_project_id = "true" - org_id = var.org_id - folder_id = var.folder_id - billing_account = var.billing_account - skip_gcloud_download = true activate_apis = [ "iam.googleapis.com", "cloudresourcemanager.googleapis.com", @@ -56,14 +56,14 @@ module "project-gke" { module "project-mig-container-vm" { source = "terraform-google-modules/project-factory/google" - version = "~> 9.0" + version = "~> 10.2" + + name = "ci-runners-c-mig" + random_project_id = "true" + org_id = var.org_id + folder_id = var.folder_id + billing_account = var.billing_account - name = "ci-runners-c-mig" - random_project_id = "true" - org_id = var.org_id - folder_id = var.folder_id - billing_account = var.billing_account - skip_gcloud_download = true activate_apis = [ "iam.googleapis.com", "cloudresourcemanager.googleapis.com", diff --git a/test/setup/versions.tf b/test/setup/versions.tf index f87ed47..6953ccb 100644 --- a/test/setup/versions.tf +++ b/test/setup/versions.tf @@ -19,9 +19,9 @@ terraform { } provider "google" { - version = "~> 3.45.0" + version = "~> 3.53.0" } provider "google-beta" { - version = "~> 3.45.0" + version = "~> 3.53.0" }