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

Support list/map type for environment argument #110

Open
dung-leviethoang-mox opened this issue Jun 3, 2022 · 2 comments
Open

Support list/map type for environment argument #110

dung-leviethoang-mox opened this issue Jun 3, 2022 · 2 comments

Comments

@dung-leviethoang-mox
Copy link

dung-leviethoang-mox commented Jun 3, 2022

There is a case we need a list of value as environment variable and pass in the script to do the loop.
It would be great if the environment argument support more than just string.

For example

data "shell_script" "example" {
  lifecycle_commands {
    read = <<-EOF
          bash main.sh
        EOF
  }

  environment = {
    TF_SUPPORTED_VERSION = ["1.0", "1.1", "1.2"]
  }

  working_directory = "./sources"
}
@pauldraper
Copy link

Environments variables are strings.

@stevehipwell
Copy link

It's relatively straightforward to do this currently. I either use jsonencode(local.list) if the value is complex or want to process it with jq or for a simple structure like a list of strings I use join(" ", local.list).

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

No branches or pull requests

3 participants