terraform-example-foundation
terraform-example-foundation copied to clipboard
Bootstrap process does not work on Windows platform
Running the bootstrap terraform code gives the below error on Windows.
module.cloudbuild_bootstrap.null_resource.cloudbuild_terraform_builder (local-exec): Executing: ["cmd" "/C" " gcloud builds submit .terraform/modules/cloudbuild_bootstrap/modules/cloudbuild/cloudbuild_builder/ \\\r\n --project prj-b-cicd-xxxx \\\r\n --config=.terraform/modules/cloudbuild_bootstrap/modules/cloudbuild/cloudbuild_builder/cloudbuild.yaml \\\r\n --substitutions=_TERRAFORM_VERSION=0.13.7,_TERRAFORM_VERSION_SHA256SUM=4a52886e019b4fdad2439da5ff43388bbcc6cce9784fde32c53dcd0e28ca9957,_TERRAFORM_VALIDATOR_RELEASE=v0.4.0,_REGION=us-central1,_REPOSITORY=prj-tf-runners\r\n"]
module.cloudbuild_bootstrap.null_resource.cloudbuild_terraform_builder (local-exec): ERROR: (gcloud.builds.submit) unrecognized arguments: \
Is this a mis-formatted command line due to the \\\r\n
?
Running the same bootstrap terraform does work on Linux and OSX.
Thanks for the report @pharveybattelle Could you open an issue on https://github.com/terraform-google-modules/terraform-google-bootstrap. Note that Windows support is best effort but happy to review a PR for this if you know the fix.
I did not manage to get this working on Windows, I worked around the issue by installing WSL2 and running the Terraform from that.
Reopening to track bumping https://github.com/terraform-google-modules/terraform-example-foundation/blob/0ee39ceff2dce8c3a3b61d59bb1d45a4d0687e74/0-bootstrap/main.tf#L105 to latest which should support WIndows.
@bharathkkb,
I think that those last pr that we merged fixed this issue
a note should be added in the README regarding automatic line ending substitution on Windows https://github.com/terraform-google-modules/terraform-example-foundation/issues/694#issuecomment-1089104752
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days