Skip to content

Commit a996f11

Browse files
committed
add editions support and bump provider version
1 parent e917ca9 commit a996f11

File tree

5 files changed

+23
-12
lines changed

5 files changed

+23
-12
lines changed

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ resource "google_spanner_instance" "instance_num_node" {
5050
config = var.instance_config
5151
display_name = var.instance_display_name
5252
name = var.instance_name
53+
edition = var.edition
5354
num_nodes = var.instance_size.num_nodes
5455
labels = var.instance_labels
5556
}
@@ -60,6 +61,7 @@ resource "google_spanner_instance" "instance_processing_units" {
6061
config = var.instance_config
6162
display_name = var.instance_display_name
6263
name = var.instance_name
64+
edition = var.edition
6365
processing_units = var.instance_size.processing_units
6466
labels = var.instance_labels
6567
}

modules/schedule_spanner_backup/main.tf

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,25 @@
1515
*/
1616

1717
module "service_account_scheduler" {
18-
source = "terraform-google-modules/service-accounts/google"
19-
version = "~> 4.1.1"
20-
project_id = var.project_id
21-
prefix = "spanner-backup-scheduler"
22-
names = ["1"]
23-
18+
source = "terraform-google-modules/service-accounts/google"
19+
version = "~> 4.4.0"
20+
project_id = var.project_id
21+
prefix = "spanner-backup-scheduler"
22+
names = ["1"]
2423
project_roles = ["${var.project_id}=>roles/workflows.invoker"]
2524
}
2625

2726
module "service_account_workflow" {
2827
source = "terraform-google-modules/service-accounts/google"
29-
version = "~> 4.1.1"
28+
version = "~> 4.4.0"
3029
project_id = var.project_id
3130
prefix = "spanner-backup-workflow"
3231
names = ["1"]
3332
project_roles = ["${var.project_id}=>roles/spanner.backupAdmin"]
3433
}
3534

3635
module "workflow" {
37-
source = "github.com/GoogleCloudPlatform/terraform-google-cloud-workflows?ref=v0.1.1"
36+
source = "github.com/livechat/terraform-google-cloud-workflows"
3837
project_id = var.project_id
3938
workflow_name = "spanner-backup-workflow"
4039
region = var.backup_schedule_region

modules/schedule_spanner_backup/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">= 0.13"
18+
required_version = ">= 1.5.0"
1919
required_providers {
2020
google = {
2121
source = "hashicorp/google"
22-
version = ">= 3.53, < 7"
22+
version = ">= 6.8.0, < 7"
2323
}
2424
}
2525
}

variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ variable "instance_size" {
5252
}
5353
}
5454

55+
variable "edition" {
56+
description = "The edition selected for this instance. Different editions provide different capabilities at different price points."
57+
type = string
58+
default = "STANDARD"
59+
validation {
60+
condition = can(regex("^(EDITION_UNSPECIFIED|STANDARD|ENTERPRISE|ENTERPRISE_PLUS)$", var.edition))
61+
error_message = "The edition must be one of the following: STANDARD, ENTERPRISE, ENTERPRISE_PLUS or EDITION_UNSPECIFIED"
62+
}
63+
}
64+
5565
variable "create_instance" {
5666
description = "Switch to use create OR use existing Spanner Instance "
5767
type = bool

versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">= 0.13"
18+
required_version = ">= 1.5.0"
1919
required_providers {
2020
google = {
2121
source = "hashicorp/google"
22-
version = ">= 3.53, < 7"
22+
version = ">= 6.8, < 7"
2323
}
2424
}
2525

0 commit comments

Comments
 (0)