Skip to content

Commit

Permalink
feat!: add Terraform 0.13 constraint and module attribution (#22)
Browse files Browse the repository at this point in the history
* feat!: add Terraform 0.13 constraint and module attribution

* Bump version an fix subnet name

Co-authored-by: James Duncan <[email protected]>
  • Loading branch information
cloud-foundation-bot and JamesDuncanNz authored Apr 24, 2021
1 parent d668c42 commit 11d7179
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 20 deletions.
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 := 0
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0.13
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
REGISTRY_URL := gcr.io/cloud-foundation-cicd

Expand Down
4 changes: 2 additions & 2 deletions modules/gh-runner-gke/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
31 changes: 31 additions & 0 deletions modules/gh-runner-gke/versions.tf
Original file line number Diff line number Diff line change
@@ -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"
}

}
31 changes: 31 additions & 0 deletions modules/gh-runner-mig-container-vm/versions.tf
Original file line number Diff line number Diff line change
@@ -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"
}

}
39 changes: 39 additions & 0 deletions modules/gh-runner-mig-vm/versions.tf
Original file line number Diff line number Diff line change
@@ -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"
}

}
30 changes: 15 additions & 15 deletions test/setup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions test/setup/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit 11d7179

Please sign in to comment.