Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add editions support and bump provider version #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ resource "google_spanner_instance" "instance_num_node" {
config = var.instance_config
display_name = var.instance_display_name
name = var.instance_name
edition = var.edition
num_nodes = var.instance_size.num_nodes
labels = var.instance_labels
}
Expand All @@ -60,6 +61,7 @@ resource "google_spanner_instance" "instance_processing_units" {
config = var.instance_config
display_name = var.instance_display_name
name = var.instance_name
edition = var.edition
processing_units = var.instance_size.processing_units
labels = var.instance_labels
}
Expand Down
15 changes: 7 additions & 8 deletions modules/schedule_spanner_backup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,25 @@
*/

module "service_account_scheduler" {
source = "terraform-google-modules/service-accounts/google"
version = "~> 4.1.1"
project_id = var.project_id
prefix = "spanner-backup-scheduler"
names = ["1"]

source = "terraform-google-modules/service-accounts/google"
version = "~> 4.4.0"
project_id = var.project_id
prefix = "spanner-backup-scheduler"
names = ["1"]
project_roles = ["${var.project_id}=>roles/workflows.invoker"]
}

module "service_account_workflow" {
source = "terraform-google-modules/service-accounts/google"
version = "~> 4.1.1"
version = "~> 4.4.0"
project_id = var.project_id
prefix = "spanner-backup-workflow"
names = ["1"]
project_roles = ["${var.project_id}=>roles/spanner.backupAdmin"]
}

module "workflow" {
source = "github.com/GoogleCloudPlatform/terraform-google-cloud-workflows?ref=v0.1.1"
source = "github.com/livechat/terraform-google-cloud-workflows"
project_id = var.project_id
workflow_name = "spanner-backup-workflow"
region = var.backup_schedule_region
Expand Down
4 changes: 2 additions & 2 deletions modules/schedule_spanner_backup/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/

terraform {
required_version = ">= 0.13"
required_version = ">= 1.5.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 3.53, < 7"
version = ">= 6.8.0, < 7"
}
}
}
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ variable "instance_size" {
}
}

variable "edition" {
description = "The edition selected for this instance. Different editions provide different capabilities at different price points."
type = string
default = "STANDARD"
validation {
condition = can(regex("^(EDITION_UNSPECIFIED|STANDARD|ENTERPRISE|ENTERPRISE_PLUS)$", var.edition))
error_message = "The edition must be one of the following: STANDARD, ENTERPRISE, ENTERPRISE_PLUS or EDITION_UNSPECIFIED"
}
}

variable "create_instance" {
description = "Switch to use create OR use existing Spanner Instance "
type = bool
Expand Down
4 changes: 2 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/

terraform {
required_version = ">= 0.13"
required_version = ">= 1.5.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 3.53, < 7"
version = ">= 6.8, < 7"
}
}

Expand Down