Add new variables to spanner instance and database (#4001)
* added new variables to instance and database * tf fmt
This commit is contained in:
@@ -168,13 +168,13 @@ module "spanner_instance" {
|
||||
|
||||
| name | description | type | required | default |
|
||||
|---|---|:---:|:---:|:---:|
|
||||
| [instance](variables.tf#L89) | Instance attributes. | <code>object({…})</code> | ✓ | |
|
||||
| [project_id](variables.tf#L134) | Project id. | <code>string</code> | ✓ | |
|
||||
| [instance](variables.tf#L90) | Instance attributes. | <code>object({…})</code> | ✓ | |
|
||||
| [project_id](variables.tf#L137) | Project id. | <code>string</code> | ✓ | |
|
||||
| [databases](variables.tf#L17) | Databases. | <code>map(object({…}))</code> | | <code>{}</code> |
|
||||
| [iam](variables.tf#L63) | IAM bindings in {ROLE => [MEMBERS]} format. | <code>map(list(string))</code> | | <code>{}</code> |
|
||||
| [iam_bindings](variables.tf#L69) | Authoritative IAM bindings in {KEY => {role = ROLE, members = [], condition = {}}}. Keys are arbitrary. | <code>map(object({…}))</code> | | <code>{}</code> |
|
||||
| [iam_bindings_additive](variables.tf#L79) | Individual additive IAM bindings. Keys are arbitrary. | <code>map(object({…}))</code> | | <code>{}</code> |
|
||||
| [instance_create](variables.tf#L127) | Set to false to manage databases and IAM bindings in an existing instance. | <code>bool</code> | | <code>true</code> |
|
||||
| [iam](variables.tf#L64) | IAM bindings in {ROLE => [MEMBERS]} format. | <code>map(list(string))</code> | | <code>{}</code> |
|
||||
| [iam_bindings](variables.tf#L70) | Authoritative IAM bindings in {KEY => {role = ROLE, members = [], condition = {}}}. Keys are arbitrary. | <code>map(object({…}))</code> | | <code>{}</code> |
|
||||
| [iam_bindings_additive](variables.tf#L80) | Individual additive IAM bindings. Keys are arbitrary. | <code>map(object({…}))</code> | | <code>{}</code> |
|
||||
| [instance_create](variables.tf#L130) | Set to false to manage databases and IAM bindings in an existing instance. | <code>bool</code> | | <code>true</code> |
|
||||
|
||||
## Outputs
|
||||
|
||||
|
||||
@@ -55,12 +55,14 @@ resource "google_spanner_instance" "spanner_instance" {
|
||||
? var.instance.config.name
|
||||
: google_spanner_instance_config.spanner_instance_config[0].name
|
||||
)
|
||||
name = var.instance.name
|
||||
display_name = coalesce(var.instance.display_name, var.instance.name)
|
||||
num_nodes = var.instance.num_nodes
|
||||
labels = var.instance.labels
|
||||
force_destroy = var.instance.force_destroy
|
||||
processing_units = var.instance.processing_units
|
||||
name = var.instance.name
|
||||
display_name = coalesce(var.instance.display_name, var.instance.name)
|
||||
num_nodes = var.instance.num_nodes
|
||||
labels = var.instance.labels
|
||||
force_destroy = var.instance.force_destroy
|
||||
processing_units = var.instance.processing_units
|
||||
edition = var.instance.edition
|
||||
default_backup_schedule_type = var.instance.default_backup_schedule_type
|
||||
dynamic "autoscaling_config" {
|
||||
for_each = var.instance.autoscaling == null ? [] : [""]
|
||||
content {
|
||||
@@ -92,6 +94,7 @@ resource "google_spanner_database" "spanner_databases" {
|
||||
instance = local.spanner_instance.name
|
||||
name = each.key
|
||||
ddl = each.value.ddl
|
||||
default_time_zone = each.value.default_time_zone
|
||||
enable_drop_protection = each.value.enable_drop_protection
|
||||
deletion_protection = false
|
||||
version_retention_period = each.value.version_retention_period
|
||||
|
||||
@@ -19,6 +19,7 @@ variable "databases" {
|
||||
type = map(object({
|
||||
database_dialect = optional(string)
|
||||
ddl = optional(list(string), [])
|
||||
default_time_zone = optional(string)
|
||||
deletion_protection = optional(bool)
|
||||
enable_drop_protection = optional(bool)
|
||||
iam = optional(map(list(string)), {})
|
||||
@@ -115,12 +116,14 @@ variable "instance" {
|
||||
))
|
||||
}))
|
||||
}))
|
||||
display_name = optional(string)
|
||||
labels = optional(map(string), {})
|
||||
name = string
|
||||
num_nodes = optional(number)
|
||||
processing_units = optional(number)
|
||||
force_destroy = optional(bool)
|
||||
display_name = optional(string)
|
||||
edition = optional(string)
|
||||
default_backup_schedule_type = optional(string)
|
||||
labels = optional(map(string), {})
|
||||
name = string
|
||||
num_nodes = optional(number)
|
||||
processing_units = optional(number)
|
||||
force_destroy = optional(bool)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user