Giter Site home page Giter Site logo

Comments (1)

Xide avatar Xide commented on May 22, 2024 3

Hello !

Running rover --help explain how to use the tfVar and tfVarsFile, among others.

In order to use a .tfvars file, you an use this command: rover -tfVarsFile /path/to/test.tfvars
Be sure to use the key-value (i.e: name=value) format fot your tfvars file, JSON is not yet parsed corrctly by rover.

In order to convert a JSON into a tfvars, you can use the following snippet:

# Input file
ofile="/path/to/test.tfvars.json"
# Output file
vfile=$(mktemp)

# JSON -> KV variables
cat ${ofile} | \
  jq -r '. as $in | keys[] | [.]+["=\""]+[$in[.]]+["\""] | map(tostring) | add' > \
  ${vfile}

If you are running Rover in Docker, you'll also need to mount the variables file into the container:

vfile="/path/to/test.tfvars"
TERRAFORM_FILES_DIR="/path/to/terraform_files"

docker run \
  --rm \
  -it \
  -p 9000:9000 \
  -v "${vfile}:/vars:ro" \
  -v ${TERRAFORM_FILES_DIR}:/src \
  im2nguyen/rover \
  -tfVarsFile /vars"

from rover.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.