From f141bd46395b79de1131f20c412c31c7b27a57c5 Mon Sep 17 00:00:00 2001 From: Awais Malik Date: Wed, 20 Sep 2023 09:39:21 -0700 Subject: [PATCH] fixed lint issues --- modules/compute_disk_snapshot/outputs.tf | 2 +- modules/compute_disk_snapshot/versions.tf | 10 ++++++++-- modules/compute_instance/outputs.tf | 6 +++--- modules/compute_instance/versions.tf | 5 ++++- modules/instance_template/versions.tf | 5 ++++- modules/mig/main.tf | 6 +++--- modules/mig/versions.tf | 11 +++++++++-- modules/mig_with_percent/main.tf | 6 +++--- modules/mig_with_percent/versions.tf | 11 +++++++++-- modules/umig/main.tf | 4 ++-- modules/umig/outputs.tf | 6 +++--- modules/umig/versions.tf | 5 ++++- 12 files changed, 53 insertions(+), 24 deletions(-) diff --git a/modules/compute_disk_snapshot/outputs.tf b/modules/compute_disk_snapshot/outputs.tf index 736b35bb..b40e408c 100644 --- a/modules/compute_disk_snapshot/outputs.tf +++ b/modules/compute_disk_snapshot/outputs.tf @@ -21,5 +21,5 @@ output "policy" { output "attachments" { description = "Disk attachments to the resource policy" - value = google_compute_disk_resource_policy_attachment.attachment.* + value = google_compute_disk_resource_policy_attachment.attachment[*] } diff --git a/modules/compute_disk_snapshot/versions.tf b/modules/compute_disk_snapshot/versions.tf index cc3302aa..98827f92 100644 --- a/modules/compute_disk_snapshot/versions.tf +++ b/modules/compute_disk_snapshot/versions.tf @@ -17,8 +17,14 @@ terraform { required_version = ">=0.13.0" required_providers { - google = ">= 3.71, < 5.0" - null = ">= 2.1" + google = { + source = "hashicorp/google" + version = ">= 3.71, < 5.0" + } + null = { + source = "hashicorp/null" + version = ">= 2.1" + } } provider_meta "google" { module_name = "blueprints/terraform/terraform-google-vm:compute_instance/v9.0.0" diff --git a/modules/compute_instance/outputs.tf b/modules/compute_instance/outputs.tf index 1f4c2fdb..d7f86fbf 100644 --- a/modules/compute_instance/outputs.tf +++ b/modules/compute_instance/outputs.tf @@ -16,13 +16,13 @@ output "instances_self_links" { description = "List of self-links for compute instances" - value = google_compute_instance_from_template.compute_instance.*.self_link + value = google_compute_instance_from_template.compute_instance[*].self_link } output "instances_details" { description = "List of all details for compute instances" - sensitive = true - value = google_compute_instance_from_template.compute_instance.* + sensitive = true + value = google_compute_instance_from_template.compute_instance[*] } output "available_zones" { diff --git a/modules/compute_instance/versions.tf b/modules/compute_instance/versions.tf index 16a2787a..781a8dbe 100644 --- a/modules/compute_instance/versions.tf +++ b/modules/compute_instance/versions.tf @@ -17,7 +17,10 @@ terraform { required_version = ">=0.13.0" required_providers { - google = ">= 3.88, < 5.0" + google = { + source = "hashicorp/google" + version = ">= 3.88, < 5.0" + } } provider_meta "google" { module_name = "blueprints/terraform/terraform-google-vm:compute_instance/v9.0.0" diff --git a/modules/instance_template/versions.tf b/modules/instance_template/versions.tf index 654c6b2f..250d4e56 100644 --- a/modules/instance_template/versions.tf +++ b/modules/instance_template/versions.tf @@ -17,7 +17,10 @@ terraform { required_version = ">=0.13.0" required_providers { - google = ">= 4.67, < 5.0" + google = { + source = "hashicorp/google" + version = ">= 4.67, < 5.0" + } } provider_meta "google" { module_name = "blueprints/terraform/terraform-google-vm:instance_template/v9.0.0" diff --git a/modules/mig/main.tf b/modules/mig/main.tf index 8bb7223b..f2515068 100644 --- a/modules/mig/main.tf +++ b/modules/mig/main.tf @@ -18,9 +18,9 @@ locals { healthchecks = concat( - google_compute_health_check.https.*.self_link, - google_compute_health_check.http.*.self_link, - google_compute_health_check.tcp.*.self_link, + google_compute_health_check.https[*].self_link, + google_compute_health_check.http[*].self_link, + google_compute_health_check.tcp[*].self_link, ) distribution_policy_zones = coalescelist(var.distribution_policy_zones, data.google_compute_zones.available.names) autoscaling_scale_in_enabled = var.autoscaling_scale_in_control.fixed_replicas != null || var.autoscaling_scale_in_control.percent_replicas != null diff --git a/modules/mig/versions.tf b/modules/mig/versions.tf index 1e71e1b4..168bada9 100644 --- a/modules/mig/versions.tf +++ b/modules/mig/versions.tf @@ -17,8 +17,15 @@ terraform { required_version = ">=0.13.0" required_providers { - google = ">= 4.48, < 5.0" - google-beta = ">= 4.48, < 5.0" + google = { + source = "hashicorp/google" + version = ">= 4.48, < 5.0" + } + + google-beta = { + source = "hashicorp/google-beta" + version = ">= 4.48, < 5.0" + } } provider_meta "google" { module_name = "blueprints/terraform/terraform-google-vm:mig/v9.0.0" diff --git a/modules/mig_with_percent/main.tf b/modules/mig_with_percent/main.tf index 2f16e631..bd0a4490 100644 --- a/modules/mig_with_percent/main.tf +++ b/modules/mig_with_percent/main.tf @@ -18,9 +18,9 @@ locals { healthchecks = concat( - google_compute_health_check.https.*.self_link, - google_compute_health_check.http.*.self_link, - google_compute_health_check.tcp.*.self_link, + google_compute_health_check.https[*].self_link, + google_compute_health_check.http[*].self_link, + google_compute_health_check.tcp[*].self_link, ) distribution_policy_zones = coalescelist(var.distribution_policy_zones, data.google_compute_zones.available.names) autoscaling_scale_in_enabled = var.autoscaling_scale_in_control.fixed_replicas != null || var.autoscaling_scale_in_control.percent_replicas != null diff --git a/modules/mig_with_percent/versions.tf b/modules/mig_with_percent/versions.tf index c228f64f..fc612701 100644 --- a/modules/mig_with_percent/versions.tf +++ b/modules/mig_with_percent/versions.tf @@ -17,8 +17,15 @@ terraform { required_version = ">=0.13.0" required_providers { - google = ">= 4.48, < 5.0" - google-beta = ">= 4.48, < 5.0" + google = { + source = "hashicorp/google" + version = ">= 4.48, < 5.0" + } + + google-beta = { + source = "hashicorp/google-beta" + version = ">= 4.48, < 5.0" + } } provider_meta "google" { module_name = "blueprints/terraform/terraform-google-vm:mig_with_percent/v9.0.0" diff --git a/modules/umig/main.tf b/modules/umig/main.tf index 545edc91..20265c74 100644 --- a/modules/umig/main.tf +++ b/modules/umig/main.tf @@ -109,8 +109,8 @@ resource "google_compute_instance_group" "instance_group" { project = var.project_id zone = element(local.zones, count.index) instances = matchkeys( - google_compute_instance_from_template.compute_instance.*.self_link, - google_compute_instance_from_template.compute_instance.*.zone, + google_compute_instance_from_template.compute_instance[*].self_link, + google_compute_instance_from_template.compute_instance[*].zone, [local.zones[count.index]], ) diff --git a/modules/umig/outputs.tf b/modules/umig/outputs.tf index 8b925f55..f2833825 100644 --- a/modules/umig/outputs.tf +++ b/modules/umig/outputs.tf @@ -16,12 +16,12 @@ output "self_links" { description = "List of self-links for unmanaged instance groups" - value = google_compute_instance_group.instance_group.*.self_link + value = google_compute_instance_group.instance_group[*].self_link } output "umig_details" { description = "List of all details for unmanaged instance groups" - value = google_compute_instance_group.instance_group.* + value = google_compute_instance_group.instance_group[*] } output "instances_self_links" { @@ -31,7 +31,7 @@ output "instances_self_links" { output "instances_details" { description = "List of all details for compute instances" - value = google_compute_instance_from_template.compute_instance.* + value = google_compute_instance_from_template.compute_instance[*] } output "available_zones" { diff --git a/modules/umig/versions.tf b/modules/umig/versions.tf index efb8071f..c1ca3b87 100644 --- a/modules/umig/versions.tf +++ b/modules/umig/versions.tf @@ -17,7 +17,10 @@ terraform { required_version = ">=0.13.0" required_providers { - google = ">= 3.88, < 5.0" + google = { + source = "hashicorp/google" + version = ">= 3.88, < 5.0" + } } provider_meta "google" { module_name = "blueprints/terraform/terraform-google-vm:umig/v9.0.0"