Update website/docs/intro (#179)

Signed-off-by: Marcin Białoń <mbialon@spacelift.io>
This commit is contained in:
Marcin Białoń 2023-08-30 00:19:59 +02:00 committed by GitHub
parent 932c32008c
commit fb8d960e1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 107 additions and 334 deletions

View File

@ -1,11 +1,11 @@
--- ---
page_title: The Core Terraform Workflow - Guides page_title: The Core OpenTF Workflow - Guides
description: 'An overview of how individuals, teams, and organizations can use Terraform. ' description: 'An overview of how individuals, teams, and organizations can use OpenTF. '
--- ---
# The Core Terraform Workflow # The Core OpenTF Workflow
The core Terraform workflow has three steps: The core OpenTF workflow has three steps:
1. **Write** - Author infrastructure as code. 1. **Write** - Author infrastructure as code.
1. **Plan** - Preview changes before applying. 1. **Plan** - Preview changes before applying.
@ -13,7 +13,7 @@ The core Terraform workflow has three steps:
This guide walks through how each of these three steps plays out in the context This guide walks through how each of these three steps plays out in the context
of working as an individual practitioner, how they evolve when a team is of working as an individual practitioner, how they evolve when a team is
collaborating on infrastructure, and how Terraform Cloud enables this collaborating on infrastructure, and how a cloud backend enables this
workflow to run smoothly for entire organizations. workflow to run smoothly for entire organizations.
## Working as an Individual Practitioner ## Working as an Individual Practitioner
@ -23,7 +23,7 @@ on infrastructure as code.
### Write ### Write
You write Terraform configuration just like you write code: in your editor of You write OpenTF configuration just like you write code: in your editor of
choice. It's common practice to store your work in a version controlled choice. It's common practice to store your work in a version controlled
repository even when you're just operating as an individual. repository even when you're just operating as an individual.
@ -36,12 +36,12 @@ Initialized empty Git repository in /.../my-infra/.git/
# Write initial config # Write initial config
$ vim main.tf $ vim main.tf
# Initialize Terraform # Initialize OpenTF
$ terraform init $ opentf init
Initializing provider plugins... Initializing provider plugins...
# ... # ...
Terraform has been successfully initialized! OpenTF has been successfully initialized!
``` ```
As you make progress on authoring your config, repeatedly running plans can help As you make progress on authoring your config, repeatedly running plans can help
@ -53,7 +53,7 @@ expect.
$ vim main.tf $ vim main.tf
# Review plan # Review plan
$ terraform plan $ opentf plan
# Make additional edits, and repeat # Make additional edits, and repeat
$ vim main.tf $ vim main.tf
@ -75,12 +75,12 @@ $ git commit -m 'Managing infrastructure as code!'
1 file changed, 1 insertion(+) 1 file changed, 1 insertion(+)
``` ```
Because `terraform apply` will display a plan for confirmation before Because `opentf apply` will display a plan for confirmation before
proceeding to change any infrastructure, that's the command you run for final proceeding to change any infrastructure, that's the command you run for final
review. review.
```sh ```sh
$ terraform apply $ opentf apply
An execution plan has been generated and is shown below. An execution plan has been generated and is shown below.
# ... # ...
@ -88,13 +88,13 @@ An execution plan has been generated and is shown below.
### Apply ### Apply
After one last check, you are ready to tell Terraform to provision real After one last check, you are ready to tell OpenTF to provision real
infrastructure. infrastructure.
```sh ```sh
Do you want to perform these actions? Do you want to perform these actions?
Terraform will perform the actions described above. OpenTF will perform the actions described above.
Only 'yes' will be accepted to approve. Only 'yes' will be accepted to approve.
Enter a value: yes Enter a value: yes
@ -116,11 +116,11 @@ the process over from the beginning.
Notice how closely this workflow parallels the process of writing application Notice how closely this workflow parallels the process of writing application
code or scripts as an individual? This is what we mean when we talk about code or scripts as an individual? This is what we mean when we talk about
Terraform enabling infrastructure as code. OpenTF enabling infrastructure as code.
## Working as a Team ## Working as a Team
Once multiple people are collaborating on Terraform configuration, new steps Once multiple people are collaborating on OpenTF configuration, new steps
must be added to each part of the core workflow to ensure everyone is working must be added to each part of the core workflow to ensure everyone is working
together smoothly. You'll see that many of these steps parallel the workflow together smoothly. You'll see that many of these steps parallel the workflow
changes we make when we work on application code as teams rather than as changes we make when we work on application code as teams rather than as
@ -128,7 +128,7 @@ individuals.
### Write ### Write
While each individual on a team still makes changes to Terraform configuration While each individual on a team still makes changes to OpenTF configuration
in their editor of choice, they save their changes to version control _branches_ in their editor of choice, they save their changes to version control _branches_
to avoid colliding with each other's work. Working in branches enables team to avoid colliding with each other's work. Working in branches enables team
members to resolve mutually incompatible infrastructure changes using their members to resolve mutually incompatible infrastructure changes using their
@ -148,23 +148,20 @@ required to run a plan.
To avoid the burden and the security risk of each team member arranging all To avoid the burden and the security risk of each team member arranging all
sensitive inputs locally, it's common for teams to migrate to a model in which sensitive inputs locally, it's common for teams to migrate to a model in which
Terraform operations are executed in a shared Continuous Integration (CI) OpenTF operations are executed in a shared Continuous Integration (CI)
environment. The work needed to create such a CI environment is nontrivial, and environment. The work needed to create such a CI environment is nontrivial, and
is outside the scope of this core workflow overview, but a full deep dive on is outside the scope of this core workflow overview.
this topic can be found in our
[Running Terraform in Automation](/terraform/tutorials/automation/automate-terraform?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS)
guide.
This longer iteration cycle of committing changes to version control and then This longer iteration cycle of committing changes to version control and then
waiting for the CI pipeline to execute is often lengthy enough to prohibit using waiting for the CI pipeline to execute is often lengthy enough to prohibit using
speculative plans as a feedback loop while authoring individual Terraform speculative plans as a feedback loop while authoring individual OpenTF
configuration changes. Speculative plans are still useful before new Terraform configuration changes. Speculative plans are still useful before new OpenTF
changes are applied or even merged to the main development branch, however, as changes are applied or even merged to the main development branch, however, as
we'll see in a minute. we'll see in a minute.
### Plan ### Plan
For teams collaborating on infrastructure, Terraform's plan output creates an For teams collaborating on infrastructure, OpenTF's plan output creates an
opportunity for team members to review each other's work. This allows the team opportunity for team members to review each other's work. This allows the team
to ask questions, evaluate risks, and catch mistakes before any potentially to ask questions, evaluate risks, and catch mistakes before any potentially
harmful changes are made. harmful changes are made.
@ -176,13 +173,11 @@ config changes alongside speculative plan output, they can evaluate whether the
intent of the change is being achieved by the plan. intent of the change is being achieved by the plan.
The problem becomes producing that speculative plan output for the team to The problem becomes producing that speculative plan output for the team to
review. Some teams that still run Terraform locally make a practice that pull review. Some teams that still run OpenTF locally make a practice that pull
requests should include an attached copy of speculative plan output generated requests should include an attached copy of speculative plan output generated
by the change author. Others arrange for their CI system to post speculative by the change author. Others arrange for their CI system to post speculative
plan output to pull requests automatically. plan output to pull requests automatically.
![Screenshot of Pull Request with manually posted Terraform plan output](/img/docs/manually-pasted-plan-output.png)
In addition to reviewing the plan for the proper expression of its author's In addition to reviewing the plan for the proper expression of its author's
intent, the team can also make an evaluation whether they want this change to intent, the team can also make an evaluation whether they want this change to
happen now. For example, if a team notices that a certain change could result happen now. For example, if a team notices that a certain change could result
@ -207,125 +202,19 @@ anything in our system that we should be watching as we apply this? Is there
anyone we need to notify that this change is happening? anyone we need to notify that this change is happening?
Depending on the change, sometimes team members will want to watch the apply Depending on the change, sometimes team members will want to watch the apply
output as it is happening. For teams that are running Terraform locally, this output as it is happening. For teams that are running OpenTF locally, this
may involve a screen share with the team. For teams running Terraform in CI, may involve a screen share with the team. For teams running OpenTF in CI,
this may involve gathering around the build log. this may involve gathering around the build log.
Just like the workflow for individuals, the core workflow for teams is a loop Just like the workflow for individuals, the core workflow for teams is a loop
that plays out for each change. For some teams this loop happens a few times a that plays out for each change. For some teams this loop happens a few times a
week, for others, many times a day. week, for others, many times a day.
## The Core Workflow Enhanced by Terraform Cloud
While the above described workflows enable the safe, predictable, and
reproducible creating or changing of infrastructure, there are multiple
collaboration points that can be streamlined, especially as teams and
organizations scale. We designed Terraform Cloud to support and enhance
the core Terraform workflow for anyone collaborating on infrastructure, from
small teams to large organizations. Let's look at how Terraform Cloud makes
for a better experience at each step.
### Write
Terraform Cloud provides a centralized and secure location for storing
input variables and state while also bringing back a tight feedback loop for
speculative plans for config authors. Terraform configuration can interact with
Terraform Cloud through the [CLI integration](/terraform/cli/cloud).
```
terraform {
cloud {
organization = "my-org"
hostname = "app.terraform.io" # Optional; defaults to app.terraform.io
workspaces {
tags = ["networking", "source:cli"]
}
}
}
```
After you configure the integration, a Terraform Cloud API key is all your team members need to edit config and run speculative plans
against the latest version of the state file using all the remotely stored
input variables.
```sh
$ terraform workspace select my-app-dev
Switched to workspace "my-app-dev".
$ terraform plan
Running plan remotely in Terraform Enterprise.
Output will stream here. To view this plan in a browser, visit:
https://app.terraform.io/my-org/my-app-dev/.../
Refreshing Terraform state in-memory prior to plan...
# ...
Plan: 1 to add, 0 to change, 0 to destroy.
```
With the assistance of this plan output, team members can each work on
authoring config until it is ready to propose as a change via a pull request.
### Plan
Once a pull request is ready for review, Terraform Cloud makes the process
of reviewing a speculative plan easier for team members. First, the plan is
automatically run when the pull request is created. Status updates to the pull
request indicate while the plan is in progress.
Once the plan is complete, the status update indicates whether there were any
changes in the speculative plan, right from the pull request view.
![Screenshot of Pull Request with resource changes in the status update](/img/docs/pull-request.png)
For certain types of changes, this information is all that's needed for a team
member to be able to approve the pull request. When a teammate needs to do a
full review of the plan, clicking the link to Terraform Cloud brings up a
view that allows them to quickly analyze the full plan details.
![Screenshot of Pull Request run in Terraform Cloud](/img/docs/pr-plan.png)
This page allows the reviewer to quickly determine if the plan is matching the
config author's intent and evaluate the risk of the change.
### Apply
After merge, Terraform Cloud presents the concrete plan to the team for
review and approval.
![Screenshot of concrete plan](/img/docs/concrete-plan.png)
The team can discuss any outstanding questions about the plan before the change
is made.
![Screenshot of back-and-forth in Terraform Cloud comments](/img/docs/plan-comments.png)
Once the Apply is confirmed, Terraform Cloud displays the progress live
to anyone who'd like to watch.
![Screenshot of in-progress Apply](/img/docs/in-progress-apply.png)
<!--
TODO: Add this back in w/ screenshot of notification
And after the change completes, the team can be notified of its outcome.
[ Multi-screenshot of Slack alert indicating Apply completed successfully and
with error; except it's not gonna be Slack anymore? ]
-->
## Conclusion ## Conclusion
There are many different ways to use Terraform: as an individual user, a single There are many different ways to use OpenTF: as an individual user, a single
team, or an entire organization at scale. Choosing the best approach for the team, or an entire organization at scale. Choosing the best approach for the
density of collaboration needed will provide the most return on your investment density of collaboration needed will provide the most return on your investment
in the core Terraform workflow. For organizations using Terraform at scale, in the core OpenTF workflow. For organizations using OpenTF at scale,
Terraform Cloud introduces new layers that build on this core workflow to TACOS (TF Automation and Collaboration Software) introduces new layers that build on this core workflow to
solve problems unique to teams and organizations. solve problems unique to teams and organizations.

View File

@ -1,65 +1,58 @@
--- ---
layout: "intro" layout: "intro"
page_title: "What is Terraform" page_title: "What is OpenTF"
sidebar_current: "what" sidebar_current: "what"
description: |- description: |-
Terraform is an infrastructure as code tool that lets you build, change, and version cloud and on-prem resources safely and efficiently. OpenTF is an infrastructure as code tool that lets you build, change, and version cloud and on-prem resources safely and efficiently.
--- ---
# What is Terraform? # What is OpenTF?
HashiCorp Terraform is an infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share. You can then use a consistent workflow to provision and manage all of your infrastructure throughout its lifecycle. Terraform can manage low-level components like compute, storage, and networking resources, as well as high-level components like DNS entries and SaaS features. OpenTF is an infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share. You can then use a consistent workflow to provision and manage all of your infrastructure throughout its lifecycle. OpenTF can manage low-level components like compute, storage, and networking resources, as well as high-level components like DNS entries and SaaS features.
> **Hands On:** Try the Get Started tutorials to start managing infrastructure on popular cloud providers: [Amazon Web Services](/terraform/tutorials/aws-get-started), [Azure](/terraform/tutorials/azure-get-started), [Google Cloud Platform](/terraform/tutorials/gcp-get-started), [Oracle Cloud Infrastructure](/terraform/tutorials/oci-get-started), and [Docker](/terraform/tutorials/docker-get-started). ## How does OpenTF work?
## How does Terraform work? OpenTF creates and manages resources on cloud platforms and other services through their application programming interfaces (APIs). Providers enable OpenTF to work with virtually any platform or service with an accessible API.
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.
![Terraform creates and manages cloud platforms and services through their APIs](/img/docs/intro-terraform-apis.png) ![OpenTF creates and manages cloud platforms and services through their APIs](/img/docs/intro-opentf-apis.png)
HashiCorp and the Terraform community have already written **thousands of providers** to manage many different types of resources and services. You can find all publicly available providers on the [Terraform Registry](https://registry.terraform.io/), including Amazon Web Services (AWS), Azure, Google Cloud Platform (GCP), Kubernetes, Helm, GitHub, Splunk, DataDog, and many more. The OpenTF community have already written **thousands of providers** to manage many different types of resources and services. You can find all publicly available providers on the [Public Terraform Registry](https://registry.terraform.io/), 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: The core OpenTF 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. - **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. - **Plan:** OpenTF 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. - **Apply:** On approval, OpenTF 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, OpenTF will recreate the VPC before scaling the virtual machines.
![The Terraform workflow has three steps: Write, Plan, and Apply](/img/docs/intro-terraform-workflow.png) ![The OpenTF workflow has three steps: Write, Plan, and Apply](/img/docs/intro-opentf-workflow.png)
## Why Terraform?
HashiCorp co-founder and CTO Armon Dadgar explains how Terraform solves infrastructure challenges.
<iframe src="https://www.youtube.com/embed/h970ZBgKINg" frameborder="0" allowfullscreen="true" width="560" height="315" ></iframe>
## Why OpenTF?
### Manage any infrastructure ### Manage any infrastructure
Find providers for many of the platforms and services you already use in the [Terraform Registry](https://registry.terraform.io/). You can also [write your own](/terraform/plugin). Terraform takes an [immutable approach to infrastructure](https://www.hashicorp.com/resources/what-is-mutable-vs-immutable-infrastructure), reducing the complexity of upgrading or modifying your services and infrastructure. Find providers for many of the platforms and services you already use in the [Public Terraform Registry](https://registry.terraform.io/). You can also [write your own](/opentf/plugin). OpenTF takes an [immutable approach to infrastructure](https://www.hashicorp.com/resources/what-is-mutable-vs-immutable-infrastructure), reducing the complexity of upgrading or modifying your services and infrastructure.
### Track your infrastructure ### Track your infrastructure
Terraform generates a plan and prompts you for your approval before modifying your infrastructure. It also keeps track of your real infrastructure in a [state file](/terraform/language/state), which acts as a source of truth for your environment. Terraform uses the state file to determine the changes to make to your infrastructure so that it will match your configuration. OpenTF generates a plan and prompts you for your approval before modifying your infrastructure. It also keeps track of your real infrastructure in a [state file](/opentf/language/state), which acts as a source of truth for your environment. OpenTF uses the state file to determine the changes to make to your infrastructure so that it will match your configuration.
### Automate changes ### Automate changes
Terraform configuration files are declarative, meaning that they describe the end state of your infrastructure. You do not need to write step-by-step instructions to create resources because Terraform handles the underlying logic. Terraform builds a resource graph to determine resource dependencies and creates or modifies non-dependent resources in parallel. This allows Terraform to provision resources efficiently. OpenTF configuration files are declarative, meaning that they describe the end state of your infrastructure. You do not need to write step-by-step instructions to create resources because OpenTF handles the underlying logic. OpenTF builds a resource graph to determine resource dependencies and creates or modifies non-dependent resources in parallel. This allows OpenTF to provision resources efficiently.
### Standardize configurations ### Standardize configurations
Terraform supports reusable configuration components called [modules](/terraform/language/modules) that define configurable collections of infrastructure, saving time and encouraging best practices. You can use publicly available modules from the Terraform Registry, or write your own. OpenTF supports reusable configuration components called [modules](/opentf/language/modules) that define configurable collections of infrastructure, saving time and encouraging best practices. You can use publicly available modules from the Terraform Registry, or write your own.
### Collaborate ### Collaborate
Since your configuration is written in a file, you can commit it to a Version Control System (VCS) and use [Terraform Cloud](/terraform/intro/terraform-editions#terraform-cloud) to efficiently manage Terraform workflows across teams. Terraform Cloud runs Terraform in a consistent, reliable environment and provides secure access to shared state and secret data, role-based access controls, a private registry for sharing both modules and providers, and more. Since your configuration is written in a file, you can commit it to a Version Control System (VCS) and use a cloud backend to efficiently manage OpenTF workflows across teams. A cloud backend runs OpenTF in a consistent, reliable environment and provides secure access to shared state and secret data, role-based access controls, a private registry for sharing both modules and providers, and more.
-> **Tip:** Learn more about [Terraform use cases](/terraform/intro/use-cases) and [how Terraform compares to alternatives](/terraform/intro/vs). -> **Tip:** Learn more about [OpenTF use cases](/opentf/intro/use-cases) and [how OpenTF compares to alternatives](/opentf/intro/vs).
## Community ## Community
We welcome questions, suggestions, and contributions from the community. We welcome questions, suggestions, and contributions from the community.
- Ask questions in [HashiCorp Discuss](https://discuss.hashicorp.com/c/terraform-core/27). - Ask questions in [OpenTF Discuss](https://github.com/placeholderplaceholderplaceholder/opentf/discussions).
- Read our [contributing guide](https://github.com/placeholderplaceholderplaceholder/opentf/blob/main/.github/CONTRIBUTING.md). - Read our [contributing guide](https://github.com/placeholderplaceholderplaceholder/opentf/blob/main/.github/CONTRIBUTING.md).
- [Submit an issue](https://github.com/placeholderplaceholderplaceholder/opentf/issues/new/choose) for bugs and feature requests. - [Submit an issue](https://github.com/placeholderplaceholderplaceholder/opentf/issues/new/choose) for bugs and feature requests.

View File

@ -1,70 +0,0 @@
---
layout: "intro"
page_title: "Terraform Editions"
sidebar_current: "what"
description: |-
Terraform Open Source, Terraform Cloud, and Terraform Enterprise solve increasingly complex infrastructure and collaboration challenges.
---
# Terraform Editions
As your organization adopts infrastructure as code (IaC), you will encounter increasingly complex technical and collaboration challenges. We offer three Terraform editions designed to help you solve them.
## Terraform Open Source
Terraform open source is a free, downloadable tool that you interact with on the command line. It lets you provision infrastructure on any cloud provider and manages configuration, plugins, infrastructure, and state.
### Why Terraform Open Source?
Terraform open source lets you:
- Adopt infrastructure as code and use a common configuration language to provision thousands of different types of resources and services.
- Codify your infrastructure so that you can check configuration files into a version control system (VCS) to safely manage contributions. Manually pull the most up-to-date version to perform Terraform operations.
- Use and publish public infrastructure templates called modules to implement industry and organization best practices, group your infrastructure into logically-related components, and deploy infrastructure more quickly.
### Resources
- Get Started tutorials for popular providers: [Amazon Web Services](/terraform/tutorials/aws-get-started), [Azure](/terraform/tutorials/azure-get-started), [Google Cloud Platform](/terraform/tutorials/gcp-get-started), [Oracle Cloud Infrastructure](/terraform/tutorials/oci-get-started), and [Docker](/terraform/tutorials/docker-get-started)
- [What is Terraform?](/terraform/intro)
- [Configuration Language Documentation](/terraform/language)
- [CLI Documentation](/terraform/cli)
## Terraform Cloud
Terraform Cloud is a SaaS application that runs Terraform in a stable, remote environment and securely stores state and secrets. It includes a rich user interface that helps you better understand your Terraform operations and resources, allows you to define role-based access controls, and offers a private registry for sharing modules and providers. Terraform Cloud also integrates with the Terraform CLI and connects to common version control systems (VCS) like GitHub, GitLab, and Bitbucket. When you connect a Terraform Cloud workspace to a VCS repository, new commits and changes can automatically trigger Terraform plans. Terraform Cloud also offers an API, allowing you to integrate it into existing workflows.
Many Terraform Cloud features are free for small teams; we offer paid plans for larger organizations with additional collaboration and governance features.
### Why Terraform Cloud?
Terraform Cloud lets you:
- Run Terraform from the local CLI or in a remote environment, trigger operations through your version control system, or use an API to integrate Terraform Cloud into your existing workflows.
- Ensure that only approved teams can access, edit, and provision infrastructure with Terraform Cloud workspaces, single sign-on, and role-based access controls.
- Securely store and version Terraform state remotely, with encryption at rest. Versioned state files allow you to access state file history.
- Publish configuration modules in the Terraform Cloud private registry that define approved infrastructure patterns. For example, a module may allow users to choose the cloud provider on which to deploy their Java application. This allows consumers to implement your organizations best practices without becoming infrastructure or cloud experts.
- Enforce best practices and security rules with the Sentinel embedded policy as code framework. For example, policies may restrict regions for production deployments.
### Resources
- [Create a Terraform Cloud Account](https://app.terraform.io/public/signup/account)
- [Terraform Cloud Documentation](/terraform/cloud-docs)
- [Sentinel Documentation](/terraform/cloud-docs/policy-enforcement)
- [Get Started - Terraform Cloud](/terraform/tutorials/cloud-get-started) tutorials show you how to manage infrastructure using Terraform Cloud's VCS integration
## Terraform Enterprise
Terraform Enterprise allows you to set up a self-hosted distribution of Terraform Cloud. It offers customizable resource limits and is ideal for organizations with strict security and compliance requirements.
### Why Terraform Enterprise?
Terraform Enterprise lets you:
- Set up a private instance of Terraform Cloud with dedicated support from HashiCorp.
- Accommodate advanced security and compliance requirements. Terraform Enterprise supports several types of installations, including air gapped and active/active architecture, and allows private networking and job scaling for better performance.
### Resources
- [Terraform Pricing](https://www.hashicorp.com/products/terraform/pricing)
- [Terraform Enterprise Documentation](/terraform/enterprise)
- [Recommended Enterprise Patterns](/terraform/tutorials/recommended-patterns) guides

View File

@ -3,90 +3,51 @@ layout: "intro"
page_title: "Use Cases" page_title: "Use Cases"
sidebar_current: "use-cases" sidebar_current: "use-cases"
description: |- description: |-
Learn how Terraform enables multi-cloud deployments, application management, policy compliance, and self-service infrastructure. Learn how OpenTF enables multi-cloud deployments, application management, policy compliance, and self-service infrastructure.
--- ---
# Use Cases # Use Cases
[HashiCorp Terraform](/terraform/intro) is an infrastructure as code tool that lets you define infrastructure resources in human-readable configuration files that you can version, reuse, and share. You can then use a consistent workflow to safely and efficiently provision and manage your infrastructure throughout its lifecycle. [OpenTF](/opentf/intro) is an infrastructure as code tool that lets you define infrastructure resources in human-readable configuration files that you can version, reuse, and share. You can then use a consistent workflow to safely and efficiently provision and manage your infrastructure throughout its lifecycle.
This page describes popular Terraform use cases and provides related resources that you can use to create Terraform configurations and workflows. This page describes popular OpenTF use cases and provides related resources that you can use to create OpenTF configurations and workflows.
## Multi-Cloud Deployment ## Multi-Cloud Deployment
Provisioning infrastructure across multiple clouds increases fault-tolerance, allowing for more graceful recovery from cloud provider outages. However, multi-cloud deployments add complexity because each provider has its own interfaces, tools, and workflows. Terraform lets you use the same workflow to manage multiple providers and handle cross-cloud dependencies. This simplifies management and orchestration for large-scale, multi-cloud infrastructures.
Provisioning infrastructure across multiple clouds increases fault-tolerance, allowing for more graceful recovery from cloud provider outages. However, multi-cloud deployments add complexity because each provider has its own interfaces, tools, and workflows. OpenTF lets you use the same workflow to manage multiple providers and handle cross-cloud dependencies. This simplifies management and orchestration for large-scale, multi-cloud infrastructures.
### Resources ### Resources
- Try our [Deploy Federated Multi-Cloud Kubernetes Clusters](/terraform/tutorials/networking/multicloud-kubernetes) tutorial to provision Kubernetes clusters in both Azure and AWS environments, configure Consul federation with mesh gateways across the two clusters, and deploy microservices across the two clusters to verify federation. - Browse the [Public Terraform Registry](https://registry.terraform.io/browse/providers) to find thousands of publicly available providers.
- Browse the [Terraform Registry](https://registry.terraform.io/browse/providers) to find thousands of publicly available providers.
## Application Infrastructure Deployment, Scaling, and Monitoring Tools ## Application Infrastructure Deployment, Scaling, and Monitoring Tools
You can use Terraform to efficiently deploy, release, scale, and monitor infrastructure for multi-tier applications. N-tier application architecture lets you scale application components independently and provides a separation of concerns. An application could consist of a pool of web servers that use a database tier, with additional tiers for API servers, caching servers, and routing meshes. Terraform allows you to manage the resources in each tier together, and automatically handles dependencies between tiers. For example, Terraform will deploy a database tier before provisioning the web servers that depend on it. You can use OpenTF to efficiently deploy, release, scale, and monitor infrastructure for multi-tier applications. N-tier application architecture lets you scale application components independently and provides a separation of concerns. An application could consist of a pool of web servers that use a database tier, with additional tiers for API servers, caching servers, and routing meshes. OpenTF allows you to manage the resources in each tier together, and automatically handles dependencies between tiers. For example, OpenTF will deploy a database tier before provisioning the web servers that depend on it.
### Resources
- Try our [Automate Monitoring with the Terraform Datadog Provider](/terraform/tutorials/applications/datadog-provider) tutorial to deploy a demo Nginx application to a Kubernetes cluster with Helm and install the Datadog agent across the cluster. The Datadog agent reports the cluster health back to your Datadog dashboard.
- Try our [Use Application Load Balancers for Blue-Green and Canary Deployments](/terraform/tutorials/aws/blue-green-canary-tests-deployments) tutorial. You will provision the blue and green environments, add feature toggles to your Terraform configuration to define a list of potential deployment strategies, conduct a canary test, and incrementally promote your green environment.
## Self-Service Clusters ## Self-Service Clusters
At a large organization, your centralized operations team may get many repetitive infrastructure requests. You can use Terraform to build a "self-serve" infrastructure model that lets product teams manage their own infrastructure independently. You can create and use Terraform modules that codify the standards for deploying and managing services in your organization, allowing teams to efficiently deploy services in compliance with your organizations practices. Terraform Cloud can also integrate with ticketing systems like ServiceNow to automatically generate new infrastructure requests. At a large organization, your centralized operations team may get many repetitive infrastructure requests. You can use OpenTF to build a "self-serve" infrastructure model that lets product teams manage their own infrastructure independently. You can create and use OpenTF modules that codify the standards for deploying and managing services in your organization, allowing teams to efficiently deploy services in compliance with your organizations practices. A cloud backend can also integrate with ticketing systems like ServiceNow to automatically generate new infrastructure requests.
### Resources
- Try the [Use Modules from the Registry](/terraform/tutorials/modules/module-use) tutorial to get started using public modules in your Terraform configuration.
Try the [Build and Use a Local Module](/terraform/tutorials/modules/module-create) tutorial to create a module to manage AWS S3 buckets.
- Follow these [ServiceNow Service Catalog Integration Setup Instructions](/terraform/cloud-docs/integrations/service-now) to connect ServiceNow to Terraform Cloud.
## Policy Compliance and Management ## Policy Compliance and Management
Terraform can help you enforce policies on the types of resources teams can provision and use. Ticket-based review processes are a bottleneck that can slow down development. Instead, you can use Sentinel, a policy-as-code framework, to automatically enforce compliance and governance policies before Terraform makes infrastructure changes. Sentinel policies are available in Terraform Enterprise and [Terraform Cloud](https://www.hashicorp.com/products/terraform/pricing). OpenTF can help you enforce policies on the types of resources teams can provision and use. Ticket-based review processes are a bottleneck that can slow down development. Instead, you can use Sentinel, a policy-as-code framework, to automatically enforce compliance and governance policies before OpenTF makes infrastructure changes. Sentinel policies are available in cloud backends.
### Resources
- Try the [Control Costs with Policies](/terraform/tutorials/cloud-get-started/cost-estimation) tutorial to estimate the cost of infrastructure changes and define policy to limit it.
- The [Sentinel documentation](/terraform/cloud-docs/policy-enforcement) provides more in-depth information and a list of example policies that you can adapt for your use cases.
## PaaS Application Setup ## PaaS Application Setup
Platform as a Service (PaaS) vendors like Heroku allow you to create web applications and attach add-ons, such as databases or email providers. Heroku can elastically scale the number of dynos or workers, but most non-trivial applications need many add-ons and external services. You can use Terraform to codify the setup required for a Heroku application, configure a DNSimple to set a CNAME, and set up Cloudflare as a Content Delivery Network (CDN) for the app. Terraform can quickly and consistently do all of this without a web interface.
### Resources
Try the [Deploy, Manage, and Scale an Application on Heroku](/terraform/tutorials/applications/heroku-provider) tutorial to manage an applications lifecycle with Terraform.
Platform as a Service (PaaS) vendors like Heroku allow you to create web applications and attach add-ons, such as databases or email providers. Heroku can elastically scale the number of dynos or workers, but most non-trivial applications need many add-ons and external services. You can use OpenTF to codify the setup required for a Heroku application, configure a DNSimple to set a CNAME, and set up Cloudflare as a Content Delivery Network (CDN) for the app. OpenTF can quickly and consistently do all of this without a web interface.
## Software Defined Networking ## Software Defined Networking
Terraform can interact with Software Defined Networks (SDNs) to automatically configure the network according to the needs of the applications running in it. This lets you move from a ticket-based workflow to an automated one, reducing deployment times. OpenTF can interact with Software Defined Networks (SDNs) to automatically configure the network according to the needs of the applications running in it. This lets you move from a ticket-based workflow to an automated one, reducing deployment times.
For example, when a service registers with [HashiCorp Consul](https://www.consul.io/), [Consul-Terraform-Sync](/consul/docs/nia) can automatically generate Terraform configuration to expose appropriate ports and adjust network settings for any SDN that has an associated Terraform provider. Network Infrastructure Automation (NIA) allows you to safely approve the changes that your applications require without having to manually translate tickets from developers into the changes you think their applications need.
### Resources
- Try the [Network Infrastructure Automation with Consul-Terraform-Sync Intro](/consul/tutorials/network-infrastructure-automation/consul-terraform-sync-intro) tutorial to install Consul-Terraform-Sync on a node. You will then configure it to communicate with a Consul datacenter, react to service changes, and execute an example task.
- Try the [Consul-Terraform-Sync and Terraform Enterprise/Cloud Integration](/consul/tutorials/network-infrastructure-automation/consul-terraform-sync-terraform-enterprise) tutorial to configure Consul-Terraform-Sync to interact with Terraform Enterprise and Terraform Cloud.
## Kubernetes ## Kubernetes
Kubernetes is an open-source workload scheduler for containerized applications. Terraform lets you both deploy a Kubernetes cluster and manage its resources (e.g., pods, deployments, services, etc.). You can also use the [Kubernetes Operator for Terraform](https://github.com/hashicorp/terraform-k8s) to manage cloud and on-prem infrastructure through a Kubernetes Custom Resource Definition (CRD) and Terraform Cloud. Kubernetes is an open-source workload scheduler for containerized applications. OpenTF lets you both deploy a Kubernetes cluster and manage its resources (e.g., pods, deployments, services, etc.).
### Resources
- Try the [Manage Kubernetes Resources via Terraform](/terraform/tutorials/kubernetes/kubernetes-provider) tutorial. You will use Terraform to schedule and expose a NGINX deployment on a Kubernetes cluster.
- Try the [Deploy Infrastructure with the Terraform Cloud Operator for Kubernetes](/terraform/tutorials/kubernetes/kubernetes-operator) tutorial. You will configure and deploy the Operator to a Kubernetes cluster and use it to create a Terraform Cloud workspace and provision a message queue for an example application.
## Parallel Environments ## Parallel Environments
You may have staging or QA environments that you use to test new applications before releasing them in production. As the production environment grows larger and more complex, it can be increasingly difficult to maintain an up-to-date environment for each stage of the development process. Terraform lets you rapidly spin up and decommission infrastructure for development, test, QA, and production. Using Terraform to create disposable environments as needed is more cost-efficient than maintaining each one indefinitely. You may have staging or QA environments that you use to test new applications before releasing them in production. As the production environment grows larger and more complex, it can be increasingly difficult to maintain an up-to-date environment for each stage of the development process. OpenTF lets you rapidly spin up and decommission infrastructure for development, test, QA, and production. Using OpenTF to create disposable environments as needed is more cost-efficient than maintaining each one indefinitely.
## Software Demos ## Software Demos
You can use Terraform to create, provision, and bootstrap a demo on various cloud providers. This lets end users easily try the software on their own infrastructure and even enables them to adjust parameters like cluster size to more rigorously test tools at any scale.
You can use OpenTF to create, provision, and bootstrap a demo on various cloud providers. This lets end users easily try the software on their own infrastructure and even enables them to adjust parameters like cluster size to more rigorously test tools at any scale.

View File

@ -1,9 +1,9 @@
--- ---
page_title: 'Terraform vs. Boto, Fog, etc.' page_title: 'OpenTF vs. Boto, Fog, etc.'
description: 'How Terraform compares to cloud provider client libraries like Boto and Fog. ' description: 'How OpenTF compares to cloud provider client libraries like Boto and Fog. '
--- ---
# Terraform vs. Boto, Fog, etc. # OpenTF vs. Boto, Fog, etc.
Libraries like Boto, Fog, etc. are used to provide native access Libraries like Boto, Fog, etc. are used to provide native access
to cloud providers and services by using their APIs. Some to cloud providers and services by using their APIs. Some
@ -12,9 +12,9 @@ to bridge them all and mask the semantic differences. Using a client
library only provides low-level access to APIs, requiring application library only provides low-level access to APIs, requiring application
developers to create their own tooling to build and manage their infrastructure. developers to create their own tooling to build and manage their infrastructure.
Terraform is not intended to give low-level programmatic access to OpenTF is not intended to give low-level programmatic access to
providers, but instead provides a high level syntax for describing providers, but instead provides a high level syntax for describing
how cloud resources and services should be created, provisioned, and how cloud resources and services should be created, provisioned, and
combined. Terraform is very flexible, using a plugin-based model to combined. OpenTF is very flexible, using a plugin-based model to
support providers and provisioners, giving it the ability to support support providers and provisioners, giving it the ability to support
almost any service that exposes APIs. almost any service that exposes APIs.

View File

@ -1,23 +1,23 @@
--- ---
page_title: 'Terraform vs. Chef, Puppet, etc.' page_title: 'OpenTF vs. Chef, Puppet, etc.'
description: >- description: >-
How Terraform compares to configuration management tools like Chef and How OpenTF compares to configuration management tools like Chef and
Puppet. Puppet.
--- ---
# Terraform vs. Chef, Puppet, etc. # OpenTF vs. Chef, Puppet, etc.
Configuration management tools install and manage software on a machine Configuration management tools install and manage software on a machine
that already exists. Terraform is not a configuration management tool, that already exists. OpenTF is not a configuration management tool,
and it allows existing tooling to focus on their strengths: bootstrapping and it allows existing tooling to focus on their strengths: bootstrapping
and initializing resources. and initializing resources.
Terraform focuses on the higher-level abstraction of the datacenter and OpenTF focuses on the higher-level abstraction of the datacenter and
associated services, while allowing you to use configuration management associated services, while allowing you to use configuration management
tools on individual systems. It also aims to bring the same benefits of tools on individual systems. It also aims to bring the same benefits of
codification of your system configuration to infrastructure management. codification of your system configuration to infrastructure management.
If you are using traditional configuration management within your compute If you are using traditional configuration management within your compute
instances, you can use Terraform to configure bootstrapping software like instances, you can use OpenTF to configure bootstrapping software like
cloud-init to activate your configuration management software on first cloud-init to activate your configuration management software on first
system boot. system boot.

View File

@ -1,39 +1,39 @@
--- ---
page_title: 'Terraform vs. CloudFormation, Heat, etc.' page_title: 'OpenTF vs. CloudFormation, Heat, etc.'
description: >- description: >-
How Terraform compares to other infrastructure as code tools like How OpenTF compares to other infrastructure as code tools like
CloudFormation and Heat. Terraform can simultaneously manage multiple cloud CloudFormation and Heat. OpenTF can simultaneously manage multiple cloud
providers (AWS, OpenStack, etc.) and services (Cloudflare, DNSimple, etc.). providers (AWS, OpenStack, etc.) and services (Cloudflare, DNSimple, etc.).
--- ---
# Terraform vs. CloudFormation, Heat, etc. # OpenTF vs. CloudFormation, Heat, etc.
Tools like CloudFormation, Heat, etc. allow the details of an infrastructure Tools like CloudFormation, Heat, etc. allow the details of an infrastructure
to be codified into a configuration file. The configuration files allow to be codified into a configuration file. The configuration files allow
the infrastructure to be elastically created, modified and destroyed. Terraform the infrastructure to be elastically created, modified and destroyed. OpenTF
is inspired by the problems they solve. is inspired by the problems they solve.
Terraform similarly uses configuration files to detail the infrastructure OpenTF similarly uses configuration files to detail the infrastructure
setup, but it goes further by being both cloud-agnostic and enabling setup, but it goes further by being both cloud-agnostic and enabling
multiple providers and services to be combined and composed. For example, multiple providers and services to be combined and composed. For example,
Terraform can be used to orchestrate an AWS and OpenStack cluster simultaneously, OpenTF can be used to orchestrate an AWS and OpenStack cluster simultaneously,
while enabling 3rd-party providers like Cloudflare and DNSimple to be integrated while enabling 3rd-party providers like Cloudflare and DNSimple to be integrated
to provide CDN and DNS services. This enables Terraform to represent and to provide CDN and DNS services. This enables OpenTF to represent and
manage the entire infrastructure with its supporting services, instead of manage the entire infrastructure with its supporting services, instead of
only the subset that exists within a single provider. It provides a single only the subset that exists within a single provider. It provides a single
unified syntax, instead of requiring operators to use independent and unified syntax, instead of requiring operators to use independent and
non-interoperable tools for each platform and service. non-interoperable tools for each platform and service.
Terraform also separates the planning phase from the execution phase, OpenTF also separates the planning phase from the execution phase,
by using the concept of an execution plan. By running `terraform plan`, by using the concept of an execution plan. By running `opentf plan`,
the current state is refreshed and the configuration is consulted to the current state is refreshed and the configuration is consulted to
generate an action plan. The plan includes all actions to be taken: generate an action plan. The plan includes all actions to be taken:
which resources will be created, destroyed or modified. It can be which resources will be created, destroyed or modified. It can be
inspected by operators to ensure it is exactly what is expected. Using inspected by operators to ensure it is exactly what is expected. Using
`terraform graph`, the plan can be visualized to show dependent ordering. `opentf graph`, the plan can be visualized to show dependent ordering.
Once the plan is captured, the execution phase can be limited to only Once the plan is captured, the execution phase can be limited to only
the actions in the plan. Other tools combine the planning and execution the actions in the plan. Other tools combine the planning and execution
phases, meaning operators are forced to mentally reason about the effects phases, meaning operators are forced to mentally reason about the effects
of a change, which quickly becomes intractable in large infrastructures. of a change, which quickly becomes intractable in large infrastructures.
Terraform lets operators apply changes with confidence, as they know exactly OpenTF lets operators apply changes with confidence, as they know exactly
what will happen beforehand. what will happen beforehand.

View File

@ -1,11 +1,11 @@
--- ---
page_title: Terraform vs. Custom Solutions page_title: OpenTF vs. Custom Solutions
description: >- description: >-
Why Terraform is easier to use and maintain than custom, internal Why OpenTF is easier to use and maintain than custom, internal
infrastructure solutions. infrastructure solutions.
--- ---
# Terraform vs. Custom Solutions # OpenTF vs. Custom Solutions
Most organizations start by manually managing infrastructure through Most organizations start by manually managing infrastructure through
simple scripts or web-based interfaces. As the infrastructure grows, simple scripts or web-based interfaces. As the infrastructure grows,
@ -22,7 +22,7 @@ updated in lockstep with any new features or infrastructure,
it becomes the limiting factor for how quickly the infrastructure it becomes the limiting factor for how quickly the infrastructure
can evolve. can evolve.
Terraform is designed to tackle these challenges. It provides a simple, OpenTF is designed to tackle these challenges. It provides a simple,
unified syntax, allowing almost any resource to be managed without unified syntax, allowing almost any resource to be managed without
learning new tooling. By capturing all the resources required, the learning new tooling. By capturing all the resources required, the
dependencies between them can be resolved automatically so that operators dependencies between them can be resolved automatically so that operators
@ -30,9 +30,9 @@ do not need to remember and reason about them. Removing the burden
of building the tool allows operators to focus on their infrastructure of building the tool allows operators to focus on their infrastructure
and not the tooling. and not the tooling.
Furthermore, Terraform is an open source tool. In addition to Furthermore, OpenTF is an open source tool. The community around OpenTF
HashiCorp, the community around Terraform helps to extend its features, helps to extend its features, fix bugs and document new use cases.
fix bugs and document new use cases. Terraform helps solve a problem OpenTF helps solve a problem that exists in every organization and provides
that exists in every organization and provides a standard that can a standard that can be adopted to avoid reinventing the wheel between
be adopted to avoid reinventing the wheel between and within organizations. and within organizations.
Its open source nature ensures it will be around in the long term. Its open source nature ensures it will be around in the long term.

View File

@ -1,22 +1,22 @@
--- ---
page_title: Terraform vs. Alternatives page_title: OpenTF vs. Alternatives
description: An overview of how Terraform compares to alternative software and tools. description: An overview of how OpenTF compares to alternative software and tools.
--- ---
# Terraform vs. Alternatives # OpenTF vs. Alternatives
Terraform provides a flexible abstraction of resources and providers. This model OpenTF provides a flexible abstraction of resources and providers. This model
allows for representing everything from physical hardware, virtual machines, and allows for representing everything from physical hardware, virtual machines, and
containers, to email and DNS providers. Because of this flexibility, Terraform containers, to email and DNS providers. Because of this flexibility, OpenTF
can be used to solve many different problems. This means there are a number of can be used to solve many different problems. This means there are a number of
existing tools that overlap with the capabilities of Terraform. We compare Terraform existing tools that overlap with the capabilities of OpenTF. We compare OpenTF
to a number of these tools, but it should be noted that Terraform is not mutually to a number of these tools, but it should be noted that OpenTF is not mutually
exclusive with other systems. It can be used to manage a single application, or the exclusive with other systems. It can be used to manage a single application, or the
entire datacenter. entire datacenter.
Learn how Terraform compares to: Learn how OpenTF compares to:
- [Chef, Puppet, etc.](/terraform/intro/vs/chef-puppet) - [Chef, Puppet, etc.](/opentf/intro/vs/chef-puppet)
- [CloudFormation, Heat, etc.](/terraform/intro/vs/cloudformation) - [CloudFormation, Heat, etc.](/opentf/intro/vs/cloudformation)
- [Boto, Fog, etc.](/terraform/intro/vs/boto) - [Boto, Fog, etc.](/opentf/intro/vs/boto)
- [Custom Solutions](/terraform/intro/vs/custom) - [Custom Solutions](/opentf/intro/vs/custom)