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

In windows not working properly #116

Open
EmmaWrong opened this issue Sep 23, 2022 · 0 comments
Open

In windows not working properly #116

EmmaWrong opened this issue Sep 23, 2022 · 0 comments

Comments

@EmmaWrong
Copy link

EmmaWrong commented Sep 23, 2022

so I am testing with this example code, which is working in Linux but not in Windows:

`provider shell {
interpreter = ["C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe", "-c"]
#interpreter = ["/bin/bash", "-c"]
enable_parallelism = false
}

terraform {
required_providers {
shell = {
source = "scottwinkler/shell"
version = "~> 1.7.10"
}
}
}

data "shell_script" "user" {
lifecycle_commands {
read = <<-EOF
echo '{"user" : "bla"}'
EOF
}
}

output "user" {
value = data.shell_script.user.output["user"]
}

resource "shell_script" "github_repository" {
lifecycle_commands {
read = <<-EOF
set -e
echo "{"user": "user1"}"
exit 0
EOF
create = <<-EOF
set -e
echo "{"user": "user2"}"
exit 0
EOF
delete = <<-EOF
set -e
echo '{"user": "user3"}'
exit 0
EOF
update = <<-EOF
set -e
echo '{"user": "user4"}'
exit 0
EOF
}
}

output "userresource" {
value = shell_script.github_repository.output["user"]
}`

In Windows there is always an error:
Error: Attempt to index null value │ │ on main.tf line 56, in output "userresource": │ 56: value = shell_script.github_repository.output["user"] │ ├──────────────── │ │ shell_script.github_repository.output is null │ │ This value is null, so it does not have any indices.

Any suggestions?

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

1 participant