cloudfoundry / bosh-bootloader

Command line utility for standing up a BOSH director on an IAAS of your choice.
Apache License 2.0
181 stars 180 forks source link

Document that GCP service account key has to be an absolute path #250

Closed sunjayBhatia closed 6 years ago

sunjayBhatia commented 6 years ago

Ran the following bbl command to destroy an environment:

bbl destroy --gcp-service-account-key ./service-account.key.json  --debug

And the error was as follows:

Are you sure you want to delete infrastructure for "pesto"? This operation cannot be undone! (y/N): y
step: generating terraform template
step: generating terraform variables

Initializing provider plugins...

The following providers do not have any version constraints in configuration,
so the latest version was installed.

To prevent automatic upgrades to new major versions that may contain breaking
changes, it is recommended to add version = "..." constraints to the
corresponding provider blocks in configuration, with the constraint strings
suggested below.

* provider.google: version = "~> 1.5"

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
step: terraform destroy

Error: Error asking for user input: 1 error(s) occurred:

* provider.google: file: open ./service-account.key.json: no such file or directory in:

${file("${var.credentials}")}

Executor destroy: exit status 1

When I switched to using an absolute path instead of a relative one, my bbl destroy succeeded as expected.

My bbl version is: bbl 5.11.5 (linux/amd64) and my terraform version is Terraform v0.11.3

This seems like terraform is not able to use relative paths

bbl could either explicitly document that the --gcp-service-account-key should be an absolute path or convert relative paths to absolute ones for terraform

cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/155002923

The labels on this github issue will be updated when the story is started.

cwlbraa commented 6 years ago

we're on it! there was already another ticket for this here: https://www.pivotaltracker.com/story/show/154943294