Skip to content

Commit

Permalink
fix!: Update min provider to TPG ~> 3.44, CI fixes (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
apeabody authored Apr 21, 2022
1 parent e9c5b90 commit 1971baa
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 16 deletions.
1 change: 1 addition & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ suites:
driver:
name: "terraform"
command_timeout: 3600
verify_version: false
root_module_directory: test/fixtures/simple_example/
verifier:
name: terraform
Expand Down
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.0
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0.14
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
REGISTRY_URL := gcr.io/cloud-foundation-cicd

Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ data:

![GitLab on GKE architecture diagram](img/arch.png)

## Compatibility

This module is meant for use with Terraform 0.13+ and tested using Terraform 0.14.

## Usage
There are examples included in the [examples](./examples/) folder but simple usage is as follows:

Expand Down Expand Up @@ -40,6 +44,7 @@ Then perform the following commands on the root folder:
| gitlab\_db\_name | Instance name for the GitLab Postgres database. | `string` | `"gitlab-db"` | no |
| gitlab\_db\_password | Password for the GitLab Postgres user | `string` | `""` | no |
| gitlab\_db\_random\_prefix | Sets random suffix at the end of the Cloud SQL instance name. | `bool` | `false` | no |
| gitlab\_deletion\_protection | Must be false to allow Terraform to destroy the Cloud SQL instance. | `bool` | `true` | no |
| gitlab\_nodes\_subnet\_cidr | Cidr range to use for gitlab GKE nodes subnet | `string` | `"10.0.0.0/16"` | no |
| gitlab\_pods\_subnet\_cidr | Cidr range to use for gitlab GKE pods subnet | `string` | `"10.3.0.0/16"` | no |
| gitlab\_runner\_install | Choose whether to install the gitlab runner in the cluster | `bool` | `true` | no |
Expand Down Expand Up @@ -76,8 +81,8 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog

### Software Dependencies
### Terraform
- [Terraform](https://www.terraform.io/downloads.html) 0.13.x
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) plugin v1.8.0
- [Terraform](https://www.terraform.io/downloads.html) 0.13+
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) ~> 3.44

### Configure a Service Account
In order to execute this module you must have a Service Account with the
Expand All @@ -87,7 +92,7 @@ following project roles:
## Install

### Terraform
Be sure you have the correct Terraform version (0.13.x), you can choose the binary here:
Be sure you have the correct Terraform version, you can choose the binary here:
- https://releases.hashicorp.com/terraform/

## File structure
Expand Down
2 changes: 1 addition & 1 deletion build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ tags:
- 'integration'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.0'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0.14'
options:
machineType: 'N1_HIGHCPU_8'
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.0'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0.14'
8 changes: 5 additions & 3 deletions examples/simple_example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ provider "google-beta" {
}

module "gke-gitlab" {
source = "../../"
project_id = var.project_id
certmanager_email = "no-reply@${var.project_id}.example.com"
source = "../../"
project_id = var.project_id
certmanager_email = "no-reply@${var.project_id}.example.com"
gitlab_deletion_protection = false
gitlab_db_random_prefix = true
}
11 changes: 6 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ resource "google_service_networking_connection" "private_vpc_connection" {
}

resource "google_sql_database_instance" "gitlab_db" {
depends_on = [google_service_networking_connection.private_vpc_connection]
name = local.gitlab_db_name
region = var.region
database_version = "POSTGRES_11"
depends_on = [google_service_networking_connection.private_vpc_connection]
name = local.gitlab_db_name
region = var.region
database_version = "POSTGRES_11"
deletion_protection = var.gitlab_deletion_protection

settings {
tier = "db-custom-4-15360"
Expand Down Expand Up @@ -366,7 +367,7 @@ data "google_compute_address" "gitlab" {

locals {
gitlab_address = var.gitlab_address_name == "" ? google_compute_address.gitlab.0.address : data.google_compute_address.gitlab.0.address
domain = var.domain != "" ? var.domain : "${local.gitlab_address}.xip.io"
domain = var.domain != "" ? var.domain : "${local.gitlab_address}.nip.io"
}
data "template_file" "helm_values" {
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ variable "gitlab_db_random_prefix" {
default = false
}

variable "gitlab_deletion_protection" {
description = "Must be false to allow Terraform to destroy the Cloud SQL instance."
default = true
}

variable "gitlab_db_password" {
description = "Password for the GitLab Postgres user"
default = ""
Expand Down
4 changes: 2 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 3.42"
version = "~> 3.44"
}
google-beta = {
source = "hashicorp/google-beta"
version = "~> 3.42"
version = "~> 3.44"
}
helm = {
source = "hashicorp/helm"
Expand Down

0 comments on commit 1971baa

Please sign in to comment.