Starting a networking module to get a private ip address for cloudsql.
This commit is contained in:
parent
edb515da09
commit
07b38295c3
@ -43,6 +43,13 @@ data "google_project" "project" {
|
||||
project_id = var.project
|
||||
}
|
||||
|
||||
#################### Networking ###########################
|
||||
|
||||
module "networking" {
|
||||
source = "../modules/networking"
|
||||
project = var.project
|
||||
}
|
||||
|
||||
#################### Workload Identity ####################
|
||||
|
||||
resource "random_id" "identity_pool" {
|
||||
|
@ -29,10 +29,6 @@ resource "google_sql_database_instance" "instance" {
|
||||
|
||||
settings {
|
||||
tier = var.tier
|
||||
|
||||
ip_configuration {
|
||||
private_network = true
|
||||
}
|
||||
}
|
||||
|
||||
deletion_protection = "true"
|
||||
|
10
terraform/modules/networking/networking.tf
Normal file
10
terraform/modules/networking/networking.tf
Normal file
@ -0,0 +1,10 @@
|
||||
variable "project" {
|
||||
description = "Project ID."
|
||||
type = string
|
||||
}
|
||||
|
||||
resource "google_compute_network" "private_network" {
|
||||
project = var.project
|
||||
name = "private-network"
|
||||
auto_create_subnetworks = false
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user