vmware-archive / terraforming-gcp

use terraform, deploy yourself a pcf
Apache License 2.0
71 stars 86 forks source link

external_databases is broken after module refactor #105

Closed matthewfischer closed 6 years ago

matthewfischer commented 6 years ago

After the module refactor terraform is having issues calculating count across the modules, when running plan with this setting on, the following error occurs:

✔ ~/code/terraforming-gcp/terraforming-pas [doc-fixes L|…2]
19:59 $ terraform plan -out=plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

------------------------------------------------------------------------

Error: Error running plan: 4 error(s) occurred:

* module.pas.random_id.pas_db_username: random_id.pas_db_username: value of 'count' cannot be computed
* module.ops_manager.random_id.opsman_db_password: random_id.opsman_db_password: value of 'count' cannot be computed
* module.pas.random_id.pas_db_password: random_id.pas_db_password: value of 'count' cannot be computed
* module.ops_manager.random_id.opsman_db_username: random_id.opsman_db_username: value of 'count' cannot be computed

Disabling this setting allows it to work.

cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

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

cdutra commented 6 years ago

Hi @matthewfischer! Thanks for bringing this up. This commit should fix that. It's on master. Let us know if the issue persists.

matthewfischer commented 6 years ago

Confirmed fixed.

jasonbisson commented 6 years ago

I tried using true for value, but it failed. However, passing 1 works as expected. Should the documentation be updated to show the value should be 1 instead of true.

terraform plan -var external_database="true"

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

${var.external_database > 0 ? 1 : 0}

cdutra commented 6 years ago

Does it work without the quotes around true?

cdutra commented 6 years ago

@jasonbisson Try terraform plan -var external_database=true, it should work.

jasonbisson commented 6 years ago

Thanks for the quick response.

That worked. Also, can we update the readme since other variables quotes.

cdutra commented 6 years ago

@jasonbisson Thanks for mentioning the issue, updated documentation here: https://github.com/pivotal-cf/terraforming-gcp/commit/3d66ce6b2bff3408914307ab1246f2d54ece6e5c