Skip to content

Commit

Permalink
fix: Reference OpenTofu Everywhere We Can (#3319)
Browse files Browse the repository at this point in the history
* fix: Reference OpenTofu everywhere we can

* fix: Cleaning up local docs server

* fix: Fixing `Gemfile` so that it works without deprecated gems

* fix: Addressing lint errors

* fix: Fixing missed spot

* fix: Updating copy for the tag line
  • Loading branch information
yhakbar authored Aug 5, 2024
1 parent bb1c138 commit de121de
Show file tree
Hide file tree
Showing 33 changed files with 374 additions and 390 deletions.
2 changes: 1 addition & 1 deletion cli/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func NewApp(writer io.Writer, errWriter io.Writer) *App {

app := cli.NewApp()
app.Name = "terragrunt"
app.Usage = "Terragrunt is a thin wrapper for Terraform that provides extra tools for working with multiple\nTerraform modules, remote state, and locking. For documentation, see https://github.com/gruntwork-io/terragrunt/."
app.Usage = "Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale. For documentation, see https://terragrunt.gruntwork.io/."
app.Author = "Gruntwork <www.gruntwork.io>"
app.Version = version.GetVersion()
app.Writer = writer
Expand Down
5 changes: 1 addition & 4 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
FROM ruby:2.6.2-stretch
FROM ruby:3.3-bookworm
MAINTAINER Gruntwork <[email protected]>

# This project requires bundler 2, but the docker image comes with bundler 1 so we need to upgrade
RUN gem install bundler

# Copy the Gemfile and Gemfile.lock into the image and run bundle install in a way that will be cached
WORKDIR /tmp
ADD Gemfile Gemfile
Expand Down
6 changes: 3 additions & 3 deletions docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem 'jekyll-sitemap', '1.4.0'
gem 'therubyracer', '0.12.3'
gem 'less', '2.6.0'
gem 'jekyll-toc'
gem 'jekyll-redirect-from'
end
Expand All @@ -26,4 +24,6 @@ end
gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?

gem "nokogiri", "1.16.3", group: :jekyll_plugins
gem "mini_portile2", "2.8.5", group: :jekyll_plugins
gem "mini_portile2", "2.8.5", group: :jekyll_plugins

gem "webrick", "~> 1.8"
12 changes: 2 additions & 10 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ GEM
execjs
coffee-script-source (1.12.2)
colorator (1.1.0)
commonjs (0.2.7)
commonmarker (0.23.10)
concurrent-ruby (1.3.3)
connection_pool (2.4.1)
Expand Down Expand Up @@ -214,9 +213,6 @@ GEM
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
less (2.6.0)
commonjs (~> 0.2.7)
libv8 (3.16.14.19.1)
liquid (4.0.4)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
Expand Down Expand Up @@ -245,7 +241,6 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
ref (2.0.0)
rexml (3.3.1)
strscan
rouge (3.30.0)
Expand All @@ -263,16 +258,14 @@ GEM
strscan (3.1.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (1.8.0)
uri (0.13.0)
wdm (0.1.1)
webrick (1.8.1)

PLATFORMS
ruby
Expand All @@ -282,11 +275,10 @@ DEPENDENCIES
jekyll-redirect-from
jekyll-sitemap (= 1.4.0)
jekyll-toc
less (= 2.6.0)
mini_portile2 (= 2.8.5)
nokogiri (= 1.16.3)
therubyracer (= 0.12.3)
wdm (~> 0.1.1)
webrick (~> 1.8)

BUNDLED WITH
2.4.22
12 changes: 6 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ title: CLI options # CHANGE THIS
categories:
- getting-started # CHANGE THIS
excerpt: >- # CHANGE THIS
Terragrunt forwards all arguments and options to Terraform. Learn more about CLI options in Terragrunt.
Terragrunt forwards all arguments and options to OpenTofu/Terraform. Learn more about CLI options in Terragrunt.
tags: ["CLI"] # CHANGE THIS
order: 102 # CHANGE THIS
nav_title: Documentation # OPTIONAL
Expand Down Expand Up @@ -223,8 +223,8 @@ To add a new collection based on _Collection browser_, like _Documentation_ coll
---
layout: collection-browser # DO NOT CHANGE THIS
title: Use cases
subtitle: Learn how to integrate Terragrunt with Terraform.
excerpt: Learn how to integrate Terragrunt with Terraform.
subtitle: Learn how to integrate Terragrunt with OpenTofu/Terraform.
excerpt: Learn how to integrate Terragrunt with OpenTofu/Terraform.
permalink: /use-cases/
slug: use-cases
nav_title: Documentation # OPTIONAL
Expand Down Expand Up @@ -270,7 +270,7 @@ The Collection Browser's purpose is to wrap Jekyll collection into:
categories: # <-- [CHANGE THIS] use single category. (Downcase and dashes instead of spaces)
- getting-started
excerpt: >- # <-- [CHANGE THIS] doc's description
Terragrunt forwards all arguments and options to Terraform. Learn more about CLI options in Terragrunt.
Terragrunt forwards all arguments and options to OpenTofu/Terraform. Learn more about CLI options in Terragrunt.
tags: ["CLI", "Another tag"] # <-- [CHANGE THIS] doc's tags
order: 102 # <-- [CHANGE THIS] set different number to each doc to set right order
---
Expand All @@ -283,8 +283,8 @@ The Collection Browser's purpose is to wrap Jekyll collection into:
---
layout: collection-browser # <-- It has to be "collection-browser"
title: Use cases
subtitle: Learn how to integrate Terragrunt with Terraform.
excerpt: Learn how to integrate Terragrunt with Terraform.
subtitle: Learn how to integrate Terragrunt with OpenTofu/Terraform.
excerpt: Learn how to integrate Terragrunt with OpenTofu/Terraform.
permalink: /use-cases/
slug: use-cases
---
Expand Down
6 changes: 2 additions & 4 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
title: Terragrunt
url: "https://terragrunt.gruntwork.io"
email: [email protected]
name: "Terragrunt | Terraform wrapper"
name: "Terragrunt | OpenTofu/Terraform wrapper"
description: >- # this means to ignore newlines until "baseurl:"
Terragrunt is a thin wrapper for Terraform that provides extra tools for
keeping your Terraform configurations DRY, working with multiple Terraform
modules, and managing remote state.
Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.
baseurl: "" # the subpath of your site, e.g. /blog
full_company_name: "Gruntwork, Inc"
thumbnail_path: "/assets/img/terragrunt-thumbnail.png"
Expand Down
4 changes: 2 additions & 2 deletions docs/_docs/01_getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ nav_title_link: /docs/

## Terragrunt configuration file

Terragrunt configuration is defined in a `terragrunt.hcl` file. This uses the same HCL syntax as Terraform itself.
Terragrunt configuration is defined in a `terragrunt.hcl` file. This uses the same HCL syntax as OpenTofu/Terraform itself.

Here’s an example:

Expand Down Expand Up @@ -87,7 +87,7 @@ This allows Terragrunt to avoid resolving `dependency` on modules that haven’t

## Formatting hcl files

You can rewrite the hcl files to a canonical format using the `hclfmt` command built into `terragrunt`. Similar to `terraform fmt`, this command applies a subset of [the Terraform language style conventions](https://www.terraform.io/docs/configuration/style.html), along with other minor adjustments for readability.
You can rewrite the hcl files to a canonical format using the `hclfmt` command built into `terragrunt`. Similar to `terraform fmt`, this command applies a subset of [the OpenTofu/Terraform language style conventions](https://www.terraform.io/docs/configuration/style.html), along with other minor adjustments for readability.

This command will recursively search for hcl files and format all of them under a given directory tree. Consider the following file structure:

Expand Down
10 changes: 5 additions & 5 deletions docs/_docs/01_getting-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ Terragrunt can help you accomplish the following:
- [Key features](#key-features)
- [Keep your backend configuration DRY](#keep-your-backend-configuration-dry)
- [Keep your provider configuration DRY](#keep-your-provider-configuration-dry)
- [Keep your Terraform CLI arguments DRY](#keep-your-terraform-cli-arguments-dry)
- [Keep your OpenTofu/Terraform CLI arguments DRY](#keep-your-opentofuterraform-cli-arguments-dry)
- [Promote immutable, versioned OpenTofu/Terraform modules across environments](#promote-immutable-versioned-opentofuterraform-modules-across-environments)
- [Next steps](#next-steps)

### Keep your backend configuration DRY

_Terraform_ backends allow you to store OpenTofu/Terraform state in a shared location that everyone on your team can access, such as an S3 bucket, and provide locking around your state files to protect against race conditions. To use an OpenTofu/Terraform backend, you add a `backend` configuration to your configurations:
_OpenTofu/Terraform_ backends allow you to store OpenTofu/Terraform state in a shared location that everyone on your team can access, such as an S3 bucket, and provide locking around your state files to protect against race conditions. To use an OpenTofu/Terraform backend, you add a `backend` configuration to your configurations:

``` hcl
# stage/frontend-app/main.tf
Expand Down Expand Up @@ -320,9 +320,9 @@ $ find . -name "provider.tf"
.terragrunt-cache/some-unique-hash/provider.tf
```

### Keep your Terraform CLI arguments DRY
### Keep your OpenTofu/Terraform CLI arguments DRY

CLI flags are another common source of copy/paste in the Terraform world. For example, a typical pattern with Terraform is to define common account-level variables in an `account.tfvars` file:
CLI flags are another common source of copy/paste in the OpenTofu/Terraform world. For example, a typical pattern with OpenTofu/Terraform is to define common account-level variables in an `account.tfvars` file:

``` hcl
# account.tfvars
Expand Down Expand Up @@ -426,7 +426,7 @@ Therefore, you typically want to break up your infrastructure across multiple mo
└── outputs.tf
```

The folder structure above shows how to separate the code for each environment (`prod`, `qa`, `stage`) and for each type of infrastructure (apps, databases, VPCs). However, the downside is that it isn’t DRY. The `.tf` files will contain a LOT of duplication. You can reduce it somewhat by defining all the infrastructure in [reusable Terraform modules](https://blog.gruntwork.io/how-to-create-reusable-infrastructure-with-terraform-modules-25526d65f73d), but even the code to instantiate a module—including configuring the `provider`, `backend`, the module’s input variables, and `output` variables—means you still end up with dozens or hundreds of lines of copy/paste for every module in every environment:
The folder structure above shows how to separate the code for each environment (`prod`, `qa`, `stage`) and for each type of infrastructure (apps, databases, VPCs). However, the downside is that it isn’t DRY. The `.tf` files will contain a LOT of duplication. You can reduce it somewhat by defining all the infrastructure in [reusable OpenTofu/Terraform modules](https://blog.gruntwork.io/how-to-create-reusable-infrastructure-with-terraform-modules-25526d65f73d), but even the code to instantiate a module—including configuring the `provider`, `backend`, the module’s input variables, and `output` variables—means you still end up with dozens or hundreds of lines of copy/paste for every module in every environment:

``` hcl
# prod/app/main.tf
Expand Down
8 changes: 4 additions & 4 deletions docs/_docs/02_features/auto-retry.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: collection-browser-doc
title: Auto-retry
category: features
categories_url: features
excerpt: Auto-Retry is a feature of terragrunt that will automatically address situations where a terraform command needs to be re-run.
excerpt: Auto-Retry is a feature of terragrunt that will automatically address situations where an OpenTofu/Terraform command needs to be re-run.
tags: ["CLI"]
order: 250
nav_title: Documentation
Expand All @@ -12,9 +12,9 @@ nav_title_link: /docs/

## Auto-Retry

*Auto-Retry* is a feature of `terragrunt` that will automatically address situations where a `terraform` command needs to be re-run.
*Auto-Retry* is a feature of `terragrunt` that will automatically address situations where a `tofu`/`terraform` command needs to be re-run.

Terraform can fail with transient errors which can be addressed by simply retrying the command again. In the event `terragrunt` finds one of these errors, the command will be re-run again automatically.
OpenTofu/Terraform can fail with transient errors which can be addressed by simply retrying the command again. In the event `terragrunt` finds one of these errors, the command will be re-run again automatically.

### Example

Expand Down Expand Up @@ -46,7 +46,7 @@ retryable_errors = [
]
```

By default, `auto-retry` tries a maximum of three times to re-run a command, pausing for five seconds between each retry, at which point it will deem the error as not transient, and accept the `terraform` failure.
By default, `auto-retry` tries a maximum of three times to re-run a command, pausing for five seconds between each retry, at which point it will deem the error as not transient, and accept the `tofu`/`terraform` failure.
However, you can override these defaults. For example, the following retries up to five times, with 60 seconds in between each retry:

```hcl
Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/02_features/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ nav_title_link: /docs/

## Clearing the Terragrunt cache

Terragrunt creates a `.terragrunt-cache` folder in the current working directory as its scratch directory. It downloads your remote Terraform configurations into this folder, runs your Terraform commands in this folder, and any modules and providers those commands download also get stored in this folder. You can safely delete this folder any time and Terragrunt will recreate it as necessary.
Terragrunt creates a `.terragrunt-cache` folder in the current working directory as its scratch directory. It downloads your remote OpenTofu/Terraform configurations into this folder, runs your OpenTofu/Terraform commands in this folder, and any modules and providers those commands download also get stored in this folder. You can safely delete this folder any time and Terragrunt will recreate it as necessary.

If you need to clean up a lot of these folders (e.g., after `terragrunt run-all apply`), you can use the following commands on Mac and Linux:

Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/02_features/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ catalog {
}
```

This will recursively search for Terraform modules in the root of the repo and the `modules` directory and show a table with all the modules. You can then:
This will recursively search for OpenTofu/Terraform modules in the root of the repo and the `modules` directory and show a table with all the modules. You can then:

1. Search and filter the table: `/` and start typing.
1. Select a module in the table: use the arrow keys to go up and down and next/previous page.
Expand Down
Loading

0 comments on commit de121de

Please sign in to comment.