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

Sections "Run Terraform locally" refer to CLOUD_BUILD_PROJECT_ID which does not exist #1168

Closed
mromascanu123 opened this issue Mar 18, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@mromascanu123
Copy link

TL;DR

When running locally w/o CB, Jenkins, TFC, etc there is no cloudbuild project. We have just a seed project and a "dummy" ci-cd project, unused but created anyway to avoid fixing broken code assuming it should exist even when deploying locally

Expected behavior

The command, if required and if the result pertinent, should succeed. Otherwise remove it from the readme's or change it providing an existing project id

Observed behavior

Subdjacent command fails:
gcloud beta terraform vet "${tf_file}.json" --policy-library="${policy_file_path}" --project="${project_id}"

./tf-wrapper.sh validate production $(pwd)/../policy-library ${CLOUD_BUILD_PROJECT_ID}

ERROR: (gcloud.beta.terraform.vet) The project property is set to the empty string, which is invalid.

Terraform Configuration

in 0-bootstrap : terraform.tf
locals {
  cicd_project_id = module.local_cicd.project_id
}

module "local_cicd" {
  source  = "terraform-google-modules/project-factory/google"

  name              = "${var.project_prefix}-b-cicd-local"
  random_project_id = true
  org_id            = var.org_id
  folder_id         = google_folder.bootstrap.id
  billing_account   = var.billing_account
  activate_apis = [
    "compute.googleapis.com",
    "admin.googleapis.com",
    "iam.googleapis.com",
    "billingbudgets.googleapis.com",
    "cloudbilling.googleapis.com",
    "serviceusage.googleapis.com",
    "cloudresourcemanager.googleapis.com",
    "iamcredentials.googleapis.com",
  ]
}

Terraform Version

Terraform v1.6.0
on linux_amd64

Your version of Terraform is out of date! The latest version
is 1.7.5. You can update by downloading from https://www.terraform.io/downloads.html

Additional information

No response

@fmichaelobrien
Copy link
Contributor

@eeaton
Copy link
Collaborator

eeaton commented May 23, 2024

Agree that this is a poor experience, there are a few issues open already to track improving/merging/aligning the directions for each of the deployment methods so I'll close this issue, but it's on the backlog to improve.

@eeaton eeaton closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants