terraform-example-foundation icon indicating copy to clipboard operation
terraform-example-foundation copied to clipboard

Bootstrap process does not work on Windows platform

Open philip-harvey opened this issue 3 years ago • 5 comments

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.

philip-harvey avatar Aug 18 '21 23:08 philip-harvey

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.

bharathkkb avatar Aug 19 '21 21:08 bharathkkb

I did not manage to get this working on Windows, I worked around the issue by installing WSL2 and running the Terraform from that.

philip-harvey avatar Aug 19 '21 22:08 philip-harvey

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 avatar Jan 18 '22 21:01 bharathkkb

@bharathkkb,

I think that those last pr that we merged fixed this issue

LuizSDCit avatar Apr 01 '22 13:04 LuizSDCit

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

daniel-cit avatar Jun 13 '22 15:06 daniel-cit

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

github-actions[bot] avatar Sep 12 '22 23:09 github-actions[bot]