Automate cloud infrastructure on any Cloud environment with Terraform

Needs help with Terraform or any cloud infrastructure deployment, automation, security, and cloud management? Web and Cloud can help! Login or create a new account at https://my.webandcloud.com and order our Pre-Terraform consulting service for only $50 and let's discuss your Terraform needs to be challenged. You can also order your cloud servers directly or request a free quote from your Web and Cloud account.

Web and Cloud LLC - talk to us and let's discuss your needs.

What is Terraform Cloud?

Terraform is an infrastructure as code tool that lets you define and manage infrastructure resources through human-readable configuration files. Terraform allows you to use a consistent workflow over your infrastructure lifecycle, regardless of the resource provider. The infrastructure as code workflow lets your declaratively manage a variety of services and automate your changes to them, reducing the risk of human error through manual operations.

Needs help with Terraform or any cloud infrastructure deployment, automation, security, and cloud management? Web and Cloud can help! Login or create a new account at https://my.webandcloud.com and order our Pre-Terraform consulting service for only $50 and let's discuss your Terraform needs to be challenged. You can also order your cloud servers directly or request a free quote from your Web and Cloud account.

How does Terraform work?

Terraform creates and manages resources on cloud platforms and other services through their application programming interfaces (APIs). Providers enable Terraform to work with virtually any platform or service with an accessible API.

HashiCorp and the Terraform community have already written more than 1700 providers to manage thousands of different types of resources and services, and this number continues to grow. You can find all publicly available providers on the Terraform Registry, including Amazon Web Services (AWS), Azure, Google Cloud Platform (GCP), Kubernetes, Helm, GitHub, Splunk, DataDog, and many more.

The core Terraform workflow consists of three stages:

  • Write: You define resources, which may be across multiple cloud providers and services. For example, you might create a configuration to deploy an application on virtual machines in a Virtual Private Cloud (VPC) network with security groups and a load balancer.
  • Plan: Terraform creates an execution plan describing the infrastructure it will create, update, or destroy based on the existing infrastructure and your configuration.
  • Apply: On approval, Terraform performs the proposed operations in the correct order, respecting any resource dependencies. For example, if you update the properties of a VPC and change the number of virtual machines in that VPC, Terraform will recreate the VPC before scaling the virtual machines.

Deliver infrastructure as code with Terraform codifies

Terraform codifies cloud APIs into declarative configuration files

  • Adopt

    Compose infrastructure as code in a Terraform file using HCL to provision resources from any infrastructure provider.

  • Build

    Infrastructure automation workflow used to compose, collaborate, reuse, and provision infrastructure as code across IT operations and teams of developers.

  • Standardize

    Infrastructure automation workflow featuring security, compliance, and cost management capabilities while using access controls, policy enforcement, and audit.

  • Innovate

    Infrastructure automation workflow extending to all teams in the organization with self-service infrastructure as code and integrates with VCS, ITSM, CI/CD.

Terraform Cloud builds on these features by managing Terraform runs in a consistent and reliable environment instead of on your local machine. It securely stores state and secret data, and can connect to version control systems so that you can develop your infrastructure using a workflow similar to application development. The Terraform Cloud UI provides a detailed view into the resources managed by a Terraform project and gives enhanced visibility into each Terraform operation.

Terraform Cloud also has a private registry for sharing your organization's Terraform modules and providers. Paid features include access controls for approving changes to infrastructure, detailed policy controls for governing the contents of Terraform configurations, cost estimates for runs, and more.

Terraform Cloud helps you collaborate on each step of your infrastructure development process. For example, each time you plan a new change, your team can review and approve the plan before you apply it.

Workflows

In Terraform Cloud, your resources are organized by workspaces, which contain your resource definitions, environment and input variables, and state files. A Terraform operation occurs within a workspace, and Terraform uses the configuration and state for that workspace to modify your infrastructure.

Terraform Cloud supports three workflows for your Terraform runs:

  • The CLI-driven workflow, which uses Terraform's standard CLI tools to execute runs in Terraform Cloud.
  • The UI/Version Control System(VCS)-driven workflow, in which changes pushed to version control repositories trigger runs in the associated workspace.
  • The API-driven workflow, which allows you to create tooling to interact with the Terraform Cloud API programmatically.

The tutorials in this collection will introduce the CLI and VCS-driven workflows. To learn more about the API-driven workflow, refer to Terraform Cloud's API Documentation.

»The CLI-driven workflow

In the CLI-driven workflow, you initiate Terraform operations in your Terminal, and use Terraform Cloud's ephemeral remote execution environments for your operations. Terraform Cloud securely stores any input and environment variables needed by your configuration, as well as your current and previous state files. The CLI-driven workflow enables collaboration and allows you to leverage the stability, security, and enhanced visiblity of Terraform Cloud while still using the same familiar Terraform workflow, with minimal additional configuration.

»The VCS-driven workflow

For the VCS-driven workflow, you must configure VCS access and create your workspace, then associate it with a repository containing your Terraform configuration. You can then configure your workspace to create speculative plans for any Pull Requests, which allows your team to review how the changes would modify infrastructure. Any merges to your main branch then trigger Terraform runs to implement your changes.