Skip to content

Unbound variable access breaks deployment #49

Description

@alovett-kainos

https://github.com/tfutils/tfscaffold/blame/d782a759c369d4aaab564338b5338cad3ede4e9a/bin/terraform.sh#L8

The enforcing of set -u in the terraform.sh script causes the script to fail, in the event that no additional parameters are passed to terraform.
Line 284: declare extra_args="${@} ${no_color}"; # All arguments supplied after "--" returns the following error:

bin/terraform.sh: line 284: @: unbound variable

This is because once all of our provided parameters are parsed, ${@} returns empty, in violation of the unbound variable setting.

The script does however pass if I include some dummy config, e.g. bin/terraform.sh --project myproj --region eu-west-2 --bootstrap --action plan -- -var="test=test"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions