You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `backends.s3` section specifies the settings for a TF backend that uses S3 for storage. This uses the [S3 native locking feature](https://opentofu.org/docs/language/settings/backends/s3/) in current versions of OpenTofu and Terraform. It does not use DynamoDB. The tooling will use this backend by default.
210
+
211
+
To use Amazon S3 with DynamoDB for locking, specify an `s3ddb` backend:
The `backends.s3` section specifies the settings for a TF backend that uses S3 for storage. This uses the [S3 native locking feature](https://opentofu.org/docs/language/settings/backends/s3/) in current versions of Terraform and OpenTofu. It does not use DynamoDB. The tooling will use this backend by default.
231
+
> The tooling automatically enables encryption for S3 backends.
232
+
233
+
This tooling also supports [Cloudflare R2](https://developers.cloudflare.com/r2/) for remote state storage. To use Cloudflare R2, specify the backend as `r2` in the `context.json` file:
The `backends.s3ddb` section specifies the settings for a legacy TF backend that uses S3 for storage and DynamoDB for locking. Only use this type of backend if you need to use an older version of Terraform or OpenTofu.
254
+
Cloudflare R2 implements the S3 API, so you use the same `backend "s3"` block in your TF module with R2 as you would with Amazon S3.
219
255
220
-
> The tooling automatically enables encryption for both types of S3 backend.
256
+
This also means that you need to specify an Access Key ID and a Secret Access Key for TF to connect to the R2 bucket. Each API token for R2 has an Access Key ID and a Secret Access Key for compatibility with S3, but other types of Cloudflare API tokens do not. The Cloudflare documentation explains [how to get S3 credentials for an R2 API token](https://developers.cloudflare.com/r2/api/tokens/). Set these S3 credentials as environment variables: `ACCESS_KEY_ID` and `SECRET_ACCESS_KEY`.
221
257
222
258
### Setting the tfvars for a Context
223
259
@@ -400,7 +436,7 @@ Set these variables to override the defaults:
400
436
| tft:units| List the units. |
401
437
| tft:validate|_terraform validate_ for a unit\*|
402
438
403
-
\*: These tasks require that you first [initialise](https://opentofu.org/docs/cli/commands/init/) the unit.
439
+
\*: These tasks require that you first [initialize](https://opentofu.org/docs/cli/commands/init/) the unit.
404
440
405
441
### The `tft:context` Tasks
406
442
@@ -424,6 +460,7 @@ Set these variables to override the defaults:
| tft:init|_terraform init_ for a unit. An alias for `tft:init:s3`. |
426
462
| tft:init:local|_terraform init_ for a unit, with local state. |
463
+
| tft:init:r2|_terraform init_ for a unit, with Cloudflare R2 remote state. |
427
464
| tft:init:s3|_terraform init_ for a unit, with S3 remote state and native S3 locking. |
428
465
| tft:init:s3ddb|_terraform init_ for a unit, with S3 remote state and DynamoDB locking. |
429
466
@@ -437,7 +474,7 @@ Similarly, there are no restrictions on how you run tasks on multiple units. You
437
474
438
475
### Migrating to Terraform
439
476
440
-
By default, this tooling currently uses OpenTofu. Set `TFT_CLI_EXE` as an environment variable to specify the path to the tool that you wish to use. To use [OpenTofu](https://opentofu.org/), set `TFT_CLI_EXE` with the value `terraform`:
477
+
By default, this tooling currently uses OpenTofu. Set `TFT_CLI_EXE` as an environment variable to specify the path to the tool that you wish to use. To use [Terraform](https://developer.hashicorp.com/terraform), set `TFT_CLI_EXE` with the value `terraform`:
To specify which version of Terraform to use, create a `.terraform-version` file. This file should contain the version of Terraform and nothing else, like this:
449
486
450
487
```shell
451
-
1.12.0
488
+
1.15.3
452
489
```
453
490
454
491
The `tenv` tool reads this file when installing or running Terraform.
455
492
456
-
> Remember that if you switch between Terraform and OpenTofu, you will need to initialize your unit again, and when you run `apply` it will migrate the TF state. The OpenTofu Website provides [migration guides](https://opentofu.org/docs/intro/migration/), which includes information about code changes that you may need to make.
493
+
> Remember that if you switch between Terraform and OpenTofu, the state may not be compatible. You will need to initialize your unit again, and when you run `apply` it will attempt to migrate the TF state.
0 commit comments