Giter Club home page Giter Club logo

terraform-cheat-sheet's Introduction

Terraform cheat sheet

Generate cheat sheet PDF

$ ./bin/asciidoctorjs-pdf terraform-cheat-sheet.adoc --template-require ../examples/cheat-sheet/template/template.js

WIP

Other useful commands

Inspect what is currently in the TF state (useful after an apply)

$ terraform show

Set the log to DEBUG level and save the log in an output external file

$ TF_LOG_PATH=mylogfile.txt TF_LOG=debug terraform apply

Refresh information. Compare the current real remote information and put it in the TF state

$ terraform refresh

Get an element from a slice (convert a set to a list and then get the first element in the list)

https://developer.hashicorp.com/terraform/language/functions/tolist

output "iam" {
    value = data.ovh_iam_policies.my_policies.policies
}

Outputs:

iam = toset([
  "1a016c5f-bb43-4069-803d-daab0f22319b",
  "d7daf48e-ba7e-4373-aa4b-b6a9dcace1f3",
])

data "ovh_iam_policy" "my_policy" {
  id = tolist(data.ovh_iam_policies.my_policies.policies)[0]
}

Display all the available resources in your TF state

terraform state list

Output:

data.ovh_iam_policies.my_policies
data.ovh_iam_policy.my_policy
data.ovh_iam_reference_actions.vps_actions

terraform-cheat-sheet's People

Contributors

donrenando avatar francois-poidevin avatar nzalo avatar scraly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-cheat-sheet's Issues

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.