DevOps Articles

Curated articles, resources, tips and trends from the DevOps World.

Terraform basics: Variables

3 years ago lambdafunc.medium.com
Terraform basics: Variables

Summary: This is a summary of an article originally published by the source. Read the full original article here →

There are multiple ways to use variables in TF. Variables are like passing arguments to programme.

Define a variable as shown in line 9: and then call it in line 20: Now, you have 2 options to pass values: Or better, we can pass value as below: Third option is preferred way to do this.

A more glorified example would for variables where you can use environment variable to define multiple environments.

Since we hav e changed file name from default, we need to pass on custom file name as var-file.

Made with pure grit © 2024 Jetpack Labs Inc. All rights reserved. www.jetpacklabs.com