DevOps Articles

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

Using Terraform for Managing Infrastructure

4 years ago dzone.com

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

by Using the configuration file you describe to Terraform what components are needed.

We will start by creating a very simple Terraform file that will pull down the image from Docker Hub and start the container.

To start with we need to set up the environment: Now, we need to create variable file: With the following content: Then we need to create a Terraform script in order to download the latest Ghost image and run container using described variables: With the following content: Next step would be to initialize new Terraform configuration: And validate main.tf file: Then we need to generate and see dev execution plan: Here are some useful flags for plan:-out=path: Writes a plan file to the given path. This can be used as input to the apply command.-var foo=bar: This sets a variable in the Terraform configuration.

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