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

Service plans are not parsed correctly if the name contains "." #7

Closed
chrismathias opened this issue Dec 13, 2017 · 3 comments
Closed
Labels

Comments

@chrismathias
Copy link

chrismathias commented Dec 13, 2017

Hi,
We have come accross the following problem. In our environment we are using a database service with two service plans:
"v3.0-dev"
"v3.0-dev-small"

When reading the service plans into terraform via

data "cf_service" "sv_database" {
  name = "somedatabase"
}

Then I would expect that data.cf_service.sv_database.service_plans looks like this:

{ 
v3.0-dev = "some guid A"
v3.0-dev-small = "some guid B"
}

However, what is actually parsed (verifiable with the output command) is this:

{   v3 = {
       0-dev = "some guid A"
       0-dev-small = "some guid B" }
}

Which is obviously incorrect. The parser seems to get confused by the "." in the service plan name.

I am using https://github.com/mevansam/terraform-provider-cf/releases/tag/0.9.5 and Terraform 0.11.0

@mevansam mevansam added the bug label Jan 2, 2018
@mevansam
Copy link
Member

mevansam commented Jan 9, 2018

This parsing issue occurs because Terraform interprets the "." as a delimiter for child elements within the output map. Would translating "." in the plan name to "_" be acceptable?

@chrismathias
Copy link
Author

You mean the data.cf_service.sv_database.service_plans would then be

{
  v3_0-dev = "some guid A"
  v3_0-dev-small = "some guid B"
}

Yes, that would be okay. Then we could take this into account when accessing the map keys.

@chrismathias
Copy link
Author

chrismathias commented Jan 29, 2018

Hi,

I finally got around to testing this - works beautifully. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants