Skip to content

Commit

Permalink
chore: Update variable's order in variables.tf and update display met…
Browse files Browse the repository at this point in the history
…adta
  • Loading branch information
q2w committed Nov 27, 2024
1 parent 5e39538 commit cea9271
Show file tree
Hide file tree
Showing 6 changed files with 459 additions and 408 deletions.
23 changes: 23 additions & 0 deletions modules/mysql/metadata.display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ spec:
availability_type:
name: availability_type
title: Availability Type
invisible: false
enumValueLabels:
- label: REGIONAL
value: REGIONAL
- label: ZONAL
value: ZONAL
altDefaults:
- type: ALTERNATE_TYPE_DC
value: REGIONAL
Expand Down Expand Up @@ -77,6 +83,11 @@ spec:
database_version:
name: database_version
title: Database Version
enumValueLabels:
- label: MYSQL_8_4
value: MYSQL_8_4
- label: MYSQL_8_0
value: MYSQL_8_0
db_charset:
name: db_charset
title: Db Charset
Expand All @@ -86,6 +97,7 @@ spec:
db_name:
name: db_name
title: Db Name
invisible: false
delete_timeout:
name: delete_timeout
title: Delete Timeout
Expand Down Expand Up @@ -119,15 +131,23 @@ spec:
edition:
name: edition
title: Edition
invisible: false
enumValueLabels:
- label: ENTERPRISE_PLUS
value: ENTERPRISE_PLUS
- label: ENTERPRISE
value: ENTERPRISE
altDefaults:
- type: ALTERNATE_TYPE_DC
value: ENTERPRISE_PLUS
enable_default_db:
name: enable_default_db
title: Enable Default Db
invisible: false
enable_default_user:
name: enable_default_user
title: Enable Default User
invisible: false
enable_google_ml_integration:
name: enable_google_ml_integration
title: Enable Google Ml Integration
Expand Down Expand Up @@ -170,6 +190,8 @@ spec:
name:
name: name
title: Name
regexValidation: ^[a-z][a-z0-9-]{0,95}[a-z0-9]$
validation: Use lowercase letters, numbers, and hyphens. Start with a letter and end with letter/number. Must be 97 characters or fewer.
password_validation_policy_config:
name: password_validation_policy_config
title: Password Validation Policy Config
Expand Down Expand Up @@ -197,6 +219,7 @@ spec:
region:
name: region
title: Region
invisible: false
replica_database_version:
name: replica_database_version
title: Replica Database Version
Expand Down
189 changes: 95 additions & 94 deletions modules/mysql/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,103 @@ spec:
description: The project ID to manage the Cloud SQL resources
varType: string
required: true
- name: region
description: The region of the Cloud SQL resources
varType: string
defaultValue: us-central1
- name: name
description: The name of the Cloud SQL resources
varType: string
required: true
- name: edition
description: The edition of the instance, can be ENTERPRISE or ENTERPRISE_PLUS.
varType: string
- name: database_version
description: The database version to use
varType: string
required: true
- name: availability_type
description: The availability type for the master instance. Can be either `REGIONAL` or `null`.
varType: string
defaultValue: REGIONAL
- name: enable_default_db
description: Enable or disable the creation of the default database
varType: bool
defaultValue: true
- name: db_name
description: The name of the default database to create
varType: string
defaultValue: default
- name: enable_default_user
description: Enable or disable the creation of the default user
varType: bool
defaultValue: true
- name: user_name
description: The name of the default user
varType: string
defaultValue: default
- name: user_host
description: The host for the default user
varType: string
defaultValue: "%"
- name: root_password
description: MySQL password for the root user.
varType: string
- name: user_password
description: The password for the default user. If not set, a random one will be generated and available in the generated_user_password output variable.
varType: string
defaultValue: ""
- name: deletion_protection
description: Used to block Terraform from deleting a SQL Instance.
varType: bool
defaultValue: true
- name: user_deletion_policy
description: "The deletion policy for the user. Setting ABANDON allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles. Possible values are: \"ABANDON\"."
varType: string
- name: data_cache_enabled
description: Whether data cache is enabled for the instance. Defaults to false. Feature is only available for ENTERPRISE_PLUS tier and supported database_versions
varType: bool
defaultValue: false
- name: additional_databases
description: A list of databases to be created in your cluster
varType: |-
list(object({
name = string
charset = string
collation = string
}))
defaultValue: []
- name: additional_users
description: A list of users to be created in your cluster. A random password would be set for the user if the `random_password` variable is set.
varType: |-
list(object({
name = string
password = string
random_password = bool
type = string
host = string
}))
defaultValue: []
- name: iam_users
description: A list of IAM users to be created in your CloudSQL instance. iam.users.type can be CLOUD_IAM_USER, CLOUD_IAM_SERVICE_ACCOUNT, CLOUD_IAM_GROUP and is required for type CLOUD_IAM_GROUP (IAM groups)
varType: |-
list(object({
id = string,
email = string,
type = optional(string)
}))
defaultValue: []
connections:
- source:
source: github.com/terraform-google-modules/terraform-google-service-accounts//modules/simple-sa
version: ~> 4.4
spec:
outputExpr: account_details
- source:
source: github.com/GoogleCloudPlatform/terraform-google-cloud-run//modules/v2
version: ">= 0.14"
spec:
outputExpr: service_account_id
- name: random_instance_name
description: Sets random suffix at the end of the Cloud SQL resource name
varType: bool
Expand All @@ -78,14 +171,6 @@ spec:
description: The read replica database version to use. This var should only be used during a database update. The update sequence 1. read-replica 2. master, setting this to an updated version will cause the replica to update, then you may update the master with the var database_version and remove this field after update is complete
varType: string
defaultValue: ""
- name: database_version
description: The database version to use
varType: string
required: true
- name: region
description: The region of the Cloud SQL resources
varType: string
defaultValue: us-central1
- name: master_instance_name
description: The name of the existing instance that will act as the master in the replication setup.
varType: string
Expand All @@ -96,9 +181,6 @@ spec:
description: The tier for the master instance.
varType: string
defaultValue: db-n1-standard-1
- name: edition
description: The edition of the instance, can be ENTERPRISE or ENTERPRISE_PLUS.
varType: string
- name: zone
description: "The zone for the master instance, it should be something like: `us-central1-a`, `us-east1-c`."
varType: string
Expand All @@ -112,10 +194,6 @@ spec:
description: The activation policy for the master instance. Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`.
varType: string
defaultValue: ALWAYS
- name: availability_type
description: The availability type for the master instance. Can be either `REGIONAL` or `null`.
varType: string
defaultValue: REGIONAL
- name: deletion_protection_enabled
description: Enables protection of an instance from accidental deletion across all surfaces (API, gcloud, Cloud Console and Terraform).
varType: bool
Expand Down Expand Up @@ -168,10 +246,6 @@ spec:
description: The key/value labels for the master instances.
varType: map(string)
defaultValue: {}
- name: data_cache_enabled
description: Whether data cache is enabled for the instance. Defaults to false. Feature is only available for ENTERPRISE_PLUS tier and supported database_versions
varType: bool
defaultValue: false
- name: deny_maintenance_period
description: The Deny Maintenance Period fields to prevent automatic maintenance from occurring during a 90-day time period. List accepts only one value. See [more details](https://cloud.google.com/sql/docs/mysql/maintenance)
varType: |-
Expand Down Expand Up @@ -281,10 +355,6 @@ spec:
description: The optional suffix to add to the read instance name
varType: string
defaultValue: ""
- name: db_name
description: The name of the default database to create
varType: string
defaultValue: default
- name: db_charset
description: The charset for the default database
varType: string
Expand All @@ -293,60 +363,6 @@ spec:
description: "The collation for the default database. Example: 'utf8_general_ci'"
varType: string
defaultValue: ""
- name: additional_databases
description: A list of databases to be created in your cluster
varType: |-
list(object({
name = string
charset = string
collation = string
}))
defaultValue: []
- name: user_name
description: The name of the default user
varType: string
defaultValue: default
- name: user_host
description: The host for the default user
varType: string
defaultValue: "%"
- name: root_password
description: MySQL password for the root user.
varType: string
- name: user_password
description: The password for the default user. If not set, a random one will be generated and available in the generated_user_password output variable.
varType: string
defaultValue: ""
- name: additional_users
description: A list of users to be created in your cluster. A random password would be set for the user if the `random_password` variable is set.
varType: |-
list(object({
name = string
password = string
random_password = bool
type = string
host = string
}))
defaultValue: []
- name: iam_users
description: A list of IAM users to be created in your CloudSQL instance
varType: |-
list(object({
id = string,
email = string
}))
defaultValue: []
connections:
- source:
source: github.com/terraform-google-modules/terraform-google-service-accounts//modules/simple-sa
version: ~> 4.4
spec:
outputExpr: account_details
- source:
source: github.com/GoogleCloudPlatform/terraform-google-cloud-run//modules/v2
version: ">= 0.14"
spec:
outputExpr: service_account_id
- name: create_timeout
description: The optional timout that is applied to limit long database creates.
varType: string
Expand All @@ -366,22 +382,10 @@ spec:
description: List of modules or resources this module depends on.
varType: list(any)
defaultValue: []
- name: deletion_protection
description: Used to block Terraform from deleting a SQL Instance.
varType: bool
defaultValue: true
- name: read_replica_deletion_protection
description: Used to block Terraform from deleting replica SQL Instances.
varType: bool
defaultValue: false
- name: enable_default_db
description: Enable or disable the creation of the default database
varType: bool
defaultValue: true
- name: enable_default_user
description: Enable or disable the creation of the default user
varType: bool
defaultValue: true
- name: enable_random_password_special
description: Enable special characters in generated random passwords.
varType: bool
Expand All @@ -390,9 +394,6 @@ spec:
description: Enforce that clients use the connector library
varType: bool
defaultValue: false
- name: user_deletion_policy
description: "The deletion policy for the user. Setting ABANDON allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles. Possible values are: \"ABANDON\"."
varType: string
- name: enable_google_ml_integration
description: Enable database ML integration
varType: bool
Expand Down Expand Up @@ -922,9 +923,9 @@ spec:
- workflows.googleapis.com
providerVersions:
- source: hashicorp/google
version: ">= 5.25, < 7"
version: ">= 6.1, < 7"
- source: hashicorp/google-beta
version: ">= 5.25, < 7"
version: ">= 6.1, < 7"
- source: hashicorp/null
version: ~> 3.1
- source: hashicorp/random
Expand Down
Loading

0 comments on commit cea9271

Please sign in to comment.