- # cloud-env.json is a file containing credentials which is pulled in via
- # CLOUDENV variable so skip it here.
- if [[ "$varfile" == *"cloud-env.json"* ]]; then
+ # cloud-env.{json,pkrvars.hcl} is a file containing credentials which is
+ # pulled in via CLOUDENV variable so skip it here. Also handle case
+ # where a project does not vars/*.{json,pkrvars.hcl} file.
+ if [[ "$varfile" == *"cloud-env.json"* ]] || \
+ [[ "$varfile" == "vars/*.json" ]] || \
+ [[ "$varfile" == *"cloud-env.pkrvars.hcl"* ]] || \
+ [[ "$varfile" == *"cloud-env-aws.pkrvars.hcl"* ]] || \
+ [[ "$varfile" == "vars/*.pkrvars.hcl" ]]; then