Editing Terraform S3 backend
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | [[Terraform]] [[S3]] | + | [[Terraform]] [[S3]] backend. |
* https://www.terraform.io/docs/language/settings/backends/s3.html | * https://www.terraform.io/docs/language/settings/backends/s3.html | ||
− | == Basic S3 | + | == Basic S3 example == |
terraform { | terraform { | ||
backend "s3" { | backend "s3" { | ||
− | [[bucket]] = " | + | [[bucket]] = "your-terraform-states" |
− | [[ | + | [[key]]<ref>https://www.terraform.io/docs/language/settings/backends/s3.html#key</ref> = "[[terraform.tfstate]]" |
− | [[ | + | region = "[[us-west-2]]" |
+ | [[profile]] = "your-profile" | ||
} | } | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | == Example including DynamoDB table == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == Example including | ||
terraform { | terraform { | ||
backend "s3" { | backend "s3" { | ||
Line 40: | Line 26: | ||
* <code>[[profile]]</code>: https://www.terraform.io/docs/language/settings/backends/s3.html#profile | * <code>[[profile]]</code>: https://www.terraform.io/docs/language/settings/backends/s3.html#profile | ||
− | * <code> | + | * <code>key</code>: path to the [[state file]] inside the [[S3 Bucket]]. https://www.terraform.io/docs/language/settings/backends/s3.html#key |
Successfully configured the backend "s3"! Terraform will automatically | Successfully configured the backend "s3"! Terraform will automatically | ||
Line 47: | Line 33: | ||
== S3 backend errors == | == S3 backend errors == | ||
− | * | + | * [[Error: Backend configuration changed]] |
− | * | + | * [[Error: Failed to get existing workspaces: S3 bucket does not exist.]]: <code>[[aws s3 mb]]</code> |
− | |||
− | |||
− | |||
− | |||
== Related terms == | == Related terms == | ||
Line 60: | Line 42: | ||
* <code>[[terraform_remote_state]]</code> [[data source]] | * <code>[[terraform_remote_state]]</code> [[data source]] | ||
* <code>[[aws s3api create-bucket]]</code> and <code>[[aws s3 mb]]</code> | * <code>[[aws s3api create-bucket]]</code> and <code>[[aws s3 mb]]</code> | ||
− | |||
− | |||
− | |||
== See also == | == See also == |
Advertising: