diff --git a/.tflint.hcl b/.tflint.hcl index 1111a80..00d3dbc 100644 --- a/.tflint.hcl +++ b/.tflint.hcl @@ -1,5 +1,5 @@ plugin "google" { enabled = true - version = "0.18.0" + version = "0.20.0" source = "github.com/terraform-linters/tflint-ruleset-google" } diff --git a/main.tf b/main.tf index a42dd1e..63d0bb6 100644 --- a/main.tf +++ b/main.tf @@ -31,9 +31,8 @@ locals { # For GCS pipeline spec "rest_of_path" = GCS object name pipeline_spec_path = regex("^(?P(?Phttps\\:\\/\\/)|(?Pgs\\:\\/\\/))?(?P[\\w.-]*)?(?P(?P\\/)(?P.*))*", var.pipeline_spec_path) - pipeline_spec_path_is_gcs_path = local.pipeline_spec_path.scheme == "gs://" - pipeline_spec_path_is_ar_path = local.pipeline_spec_path.scheme == "https://" - pipeline_spec_path_is_local_path = local.pipeline_spec_path.scheme == null + pipeline_spec_path_is_gcs_path = local.pipeline_spec_path.scheme == "gs://" + pipeline_spec_path_is_ar_path = local.pipeline_spec_path.scheme == "https://" # Load the pipeline spec from YAML/JSON # If it's a GCS path, load it from the GCS object content @@ -93,7 +92,6 @@ data "http" "pipeline_spec" { # If a service account is not specified for Cloud Scheduler, use the default compute service account data "google_compute_default_service_account" "default" { - count = (var.cloud_scheduler_sa_email == null) ? 1 : 0 project = var.project } @@ -116,7 +114,7 @@ resource "google_cloud_scheduler_job" "job" { body = base64encode(jsonencode(local.pipeline_job)) oauth_token { - service_account_email = (var.cloud_scheduler_sa_email == null) ? data.google_compute_default_service_account.default[0].email : var.cloud_scheduler_sa_email + service_account_email = (var.cloud_scheduler_sa_email == null) ? data.google_compute_default_service_account.default.email : var.cloud_scheduler_sa_email } }