Skip to content

Commit

Permalink
fix: resource replace on deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
denise89p committed Aug 16, 2022
1 parent bf8ab7f commit ab398e6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/deploy_weka/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ resource "google_compute_instance_template" "backends-template" {
dynamic "network_interface" {
for_each = range(local.private_nic_first_index)
content {
subnetwork = "https://www.googleapis.com/compute/v1/projects/${var.project}/regions/${var.region}/subnetworks/${var.subnets_name[network_interface.value]}"
subnetwork = data.google_compute_subnetwork.subnets_list_ids[network_interface.value].self_link
access_config {}
}
}
Expand Down
7 changes: 5 additions & 2 deletions modules/deploy_weka/workflows.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ resource "google_project_service" "workflows" {
data "google_project" "project" {
}

resource "google_project_iam_binding" "project" {
resource "google_project_iam_binding" "cloudscheduler-binding" {
count = var.create_cloudscheduler_sa ? 1 : 0
project = var.project
role = "roles/cloudscheduler.serviceAgent"

members = [
"serviceAccount:service-${data.google_project.project.number}@gcp-sa-cloudscheduler.iam.gserviceaccount.com"
]

lifecycle {
ignore_changes = [members]
}
}

resource "google_workflows_workflow" "scale_down" {
Expand Down
10 changes: 9 additions & 1 deletion modules/shared_vpcs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ resource "google_compute_network_peering" "peering-service" {
export_custom_routes = true
import_custom_routes = true
import_subnet_routes_with_public_ip = true
depends_on = [google_compute_shared_vpc_service_project.service, google_project_iam_binding.iam-binding]
depends_on = [google_compute_shared_vpc_service_project.service, google_project_iam_binding.iam-binding]
}

resource "google_compute_network_peering" "host-peering" {
Expand Down Expand Up @@ -69,6 +69,10 @@ resource "google_compute_firewall" "sg_private" {
protocol = "all"
}
source_tags = ["all"]

lifecycle {
ignore_changes = [network]
}
}


Expand All @@ -83,4 +87,8 @@ resource "google_compute_firewall" "sg_private_egress" {
allow {
protocol = "all"
}

lifecycle {
ignore_changes = [network]
}
}

0 comments on commit ab398e6

Please sign in to comment.