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

Cloud SQL activation policy selectable #1613

Merged
merged 9 commits into from Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/cloudsql-instance/main.tf
Expand Up @@ -119,6 +119,7 @@ resource "google_sql_database_instance" "primary" {
}
}
deletion_protection = var.deletion_protection
activation_policy = var.activation_policy
}

resource "google_sql_database_instance" "replicas" {
Expand Down
10 changes: 10 additions & 0 deletions modules/cloudsql-instance/variables.tf
Expand Up @@ -13,6 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
variable "activation_policy" {
description = "(Optional) This specifies when the instance should be active. Can be either ALWAYS, NEVER or ON_DEMAND. Default is ALWAYS"
cmvalla marked this conversation as resolved.
Show resolved Hide resolved
cmvalla marked this conversation as resolved.
Show resolved Hide resolved
default = "ALWAYS"
validation {
condition = var.activation_policy == "NEVER" || var.activation_policy == "ON_DEMAND" || var.activation_policy == "ALWAYS"
error_message = "activation_policy must be ALWAYS, NEVER or ON_DEMAND"
juliocc marked this conversation as resolved.
Show resolved Hide resolved
}
nullable = false
}

variable "allocated_ip_ranges" {
description = "(Optional)The name of the allocated ip range for the private ip CloudSQL instance. For example: \"google-managed-services-default\". If set, the instance ip will be created in the allocated range. The range name must comply with RFC 1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z?."
Expand Down Expand Up @@ -189,3 +198,4 @@ variable "users" {
type = map(string)
default = null
}