terraform:start
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| terraform:start [06/10/2025 14:28] – [State files and Lock files] andrew | terraform:start [07/10/2025 10:03] (current) – [State files and Lock files] andrew | ||
|---|---|---|---|
| Line 119: | Line 119: | ||
| Code to create bucket with Terraform and then remove it from the state file with a tf cli command, this means that Terraform won't try to destroy the state file bucket | Code to create bucket with Terraform and then remove it from the state file with a tf cli command, this means that Terraform won't try to destroy the state file bucket | ||
| - | < | + | < |
| resource " | resource " | ||
| | | ||
| Line 134: | Line 134: | ||
| Then, we can add the state file bucket to the AWS provider code:- | Then, we can add the state file bucket to the AWS provider code:- | ||
| - | <code terraform> | + | <file yaml terraform.tf> |
| terraform { | terraform { | ||
| required_version = ">= 1.2" | required_version = ">= 1.2" | ||
| Line 151: | Line 151: | ||
| } | } | ||
| - | </code> | + | </file> |
| + | |||
| + | **Updates to lockfile** - previously DynamoDb was used frequently for lock files, this can be stored in S3 along with the state:- | ||
| + | |||
| + | <file yaml terraform.tf> | ||
| + | terraform { | ||
| + | required_version = ">= 1.12" | ||
| + | required_providers { | ||
| + | aws = { | ||
| + | source | ||
| + | version = "~> 5.92" | ||
| + | } | ||
| + | } | ||
| + | |||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | } | ||
| + | </file> | ||
| ===== AWS Provisioner code ===== | ===== AWS Provisioner code ===== | ||
terraform/start.1759760931.txt.gz · Last modified: by andrew
