Skip to content

In windows not working properly #116

@EmmaWrong

Description

@EmmaWrong

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions