Terraform : terraform console

1.evaluating expressions

The terraform console command provides an interactive console for evaluating expressions.

For example:

1
2
3
4
5
6
7
8
9
10
11
# interactive console
➜ terraform console
> element(list("one","two","three"),1)
two

# non-interactive scripts
echo "list("1","2")" | terraform console
[
1,
2,
]

or

1
2
3
➜ terraform console
> aws_instance_demo.public_ip
54.152.62.34
2.test Terraform built-in functions locally

test Terraform built-in functions locally


More ref:
https://www.terraform.io/docs/commands/console.html
http://artemstar.com/2018/03/03/terraform-test-functions/

Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2019-2024 John Doe
  • Visitors: | Views:

请我喝杯咖啡吧~