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
Update README with instructions to match terraform's automatic state copy behavior (#11)
* Update README with instructions to match terraform's automatic state copy behavior.
* Move doc updates into README.yaml.
This moves updates that had been made by hand in README.md into README.yaml
and applies the output of `make readme`.
* Expand init instructions into a step-by-step list.
* Run make readme.
Terraform module to provision an S3 bucket to store `terraform.tfstate` file and a DynamoDB table to lock the state file
9
+
Terraform module to provision an S3 bucket to store `terraform.tfstate` file and a DynamoDB table to lock the state file
10
10
to prevent concurrent modifications and state corruption.
11
11
12
12
The module supports the following:
@@ -26,7 +26,7 @@ __NOTE:__ This module cannot be used to apply changes to the `mfa_delete` featur
26
26
27
27
---
28
28
29
-
This project is part of our comprehensive ["SweetOps"](https://cpco.io/sweetops) approach towards DevOps.
29
+
This project is part of our comprehensive ["SweetOps"](https://cpco.io/sweetops) approach towards DevOps.
30
30
[<imgalign="right"title="Share via Email"src="https://docs.cloudposse.com/images/ionicons/ios-email-outline-2.0.1-16x16-999999.svg"/>][share_email]
31
31
[<imgalign="right"title="Share on Google+"src="https://docs.cloudposse.com/images/ionicons/social-googleplus-outline-2.0.1-16x16-999999.svg" />][share_googleplus]
32
32
[<imgalign="right"title="Share on Facebook"src="https://docs.cloudposse.com/images/ionicons/social-facebook-outline-2.0.1-16x16-999999.svg" />][share_facebook]
@@ -47,7 +47,7 @@ It's 100% Open Source and licensed under the [APACHE2](LICENSE).
47
47
48
48
49
49
50
-
We literally have [*hundreds of terraform modules*][terraform_modules] that are Open Source and well-maintained. Check them out!
50
+
We literally have [*hundreds of terraform modules*][terraform_modules] that are Open Source and well-maintained. Check them out!
51
51
52
52
53
53
@@ -57,48 +57,46 @@ We literally have [*hundreds of terraform modules*][terraform_modules] that are
__NOTE:__ First create the bucket and table without any state enabled (Terraform will use the local file system to store state).
76
-
You can then import the bucket and table by using [`terraform import`](https://www.terraform.io/docs/import/index.html) and store the state file into the bucket.
77
-
78
-
Once the bucket and table have been created, configure the [backend](https://www.terraform.io/docs/backends/types/s3.html)
79
-
80
-
```hcl
81
-
terraform {
82
-
required_version = ">= 0.11.3"
83
-
84
-
backend "s3" {
85
-
region = "us-east-1"
86
-
bucket = "< the name of the S3 bucket >"
87
-
key = "terraform.tfstate"
88
-
dynamodb_table = "< the name of the DynamoDB table >"
89
-
encrypt = true
90
-
}
91
-
}
92
-
93
-
module "another_module" {
94
-
source = "....."
95
-
}
96
-
```
97
-
98
-
Initialize the backend with `terraform init`.
99
-
100
-
After `terraform apply`, `terraform.tfstate` file will be stored in the bucket,
101
-
and the DynamoDB table will be used to lock the state to prevent concurrent modifications.
60
+
1. Define the module in your `.tf` file using local state:
1.`terraform apply`. This will create the state bucket and locking table.
79
+
80
+
1. Then add a `backend` that uses the new bucket and table:
81
+
```hcl
82
+
terraform {
83
+
required_version = ">= 0.11.3"
84
+
85
+
backend "s3" {
86
+
region = "us-east-1"
87
+
bucket = "< the name of the S3 bucket >"
88
+
key = "terraform.tfstate"
89
+
dynamodb_table = "< the name of the DynamoDB table >"
90
+
encrypt = true
91
+
}
92
+
}
93
+
94
+
module "another_module" {
95
+
source = "....."
96
+
}
97
+
```
98
+
99
+
1.`terraform init`. Terraform will detect that you're trying to move your state into S3 and ask, "Do you want to copy existing state to the new backend?" Enter "yes". Now state is stored in the bucket and the DynamoDB table will be used to lock the state to prevent concurrent modifications.
102
100
103
101
<br/>
104
102
@@ -155,9 +153,9 @@ Available targets:
155
153
156
154
157
155
158
-
## Share the Love
156
+
## Share the Love
159
157
160
-
Like this project? Please give it a ★ on [our GitHub](https://github.com/cloudposse/terraform-aws-tfstate-backend)! (it helps us **a lot**)
158
+
Like this project? Please give it a ★ on [our GitHub](https://github.com/cloudposse/terraform-aws-tfstate-backend)! (it helps us **a lot**)
161
159
162
160
Are you using this project or any of our other projects? Consider [leaving a testimonial][testimonial]. =)
163
161
@@ -181,9 +179,9 @@ File a GitHub [issue](https://github.com/cloudposse/terraform-aws-tfstate-backen
181
179
182
180
## Commercial Support
183
181
184
-
Work directly with our team of DevOps experts via email, slack, and video conferencing.
182
+
Work directly with our team of DevOps experts via email, slack, and video conferencing.
185
183
186
-
We provide [*commercial support*][commercial_support] for all of our [Open Source][github] projects. As a *Dedicated Support* customer, you have access to our team of subject matter experts at a fraction of the cost of a full-time engineer.
184
+
We provide [*commercial support*][commercial_support] for all of our [Open Source][github] projects. As a *Dedicated Support* customer, you have access to our team of subject matter experts at a fraction of the cost of a full-time engineer.
@@ -193,7 +191,7 @@ We provide [*commercial support*][commercial_support] for all of our [Open Sourc
193
191
-**Bug Fixes.** We'll rapidly work to fix any bugs in our projects.
194
192
-**Build New Terraform Modules.** We'll [develop original modules][module_development] to provision infrastructure.
195
193
-**Cloud Architecture.** We'll assist with your cloud strategy and design.
196
-
-**Implementation.** We'll provide hands-on support to implement our reference architectures.
194
+
-**Implementation.** We'll provide hands-on support to implement our reference architectures.
197
195
198
196
199
197
@@ -208,7 +206,7 @@ Join our [Open Source Community][slack] on Slack. It's **FREE** for everyone! Ou
208
206
209
207
## Newsletter
210
208
211
-
Signup for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover.
209
+
Signup for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover.
212
210
213
211
## Contributing
214
212
@@ -233,13 +231,13 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
__NOTE:__ First create the bucket and table without any state enabled (Terraform will use the local file system to store state).
76
-
You can then import the bucket and table by using [`terraform import`](https://www.terraform.io/docs/import/index.html) and store the state file into the bucket.
77
-
78
-
Once the bucket and table have been created, configure the [backend](https://www.terraform.io/docs/backends/types/s3.html)
79
-
80
-
```hcl
81
-
terraform {
82
-
required_version = ">= 0.11.3"
83
-
84
-
backend "s3" {
85
-
region = "us-east-1"
86
-
bucket = "< the name of the S3 bucket >"
87
-
key = "terraform.tfstate"
88
-
dynamodb_table = "< the name of the DynamoDB table >"
89
-
encrypt = true
90
-
}
91
-
}
92
-
93
-
module "another_module" {
94
-
source = "....."
95
-
}
96
-
```
97
-
98
-
Initialize the backend with `terraform init`.
99
-
100
-
After `terraform apply`, `terraform.tfstate` file will be stored in the bucket,
101
-
and the DynamoDB table will be used to lock the state to prevent concurrent modifications.
60
+
1. Define the module in your `.tf` file using local state:
1. `terraform apply`. This will create the state bucket and locking table.
79
+
80
+
1. Then add a `backend` that uses the new bucket and table:
81
+
```hcl
82
+
terraform {
83
+
required_version = ">= 0.11.3"
84
+
85
+
backend "s3" {
86
+
region = "us-east-1"
87
+
bucket = "< the name of the S3 bucket >"
88
+
key = "terraform.tfstate"
89
+
dynamodb_table = "< the name of the DynamoDB table >"
90
+
encrypt = true
91
+
}
92
+
}
93
+
94
+
module "another_module" {
95
+
source = "....."
96
+
}
97
+
```
98
+
99
+
1. `terraform init`. Terraform will detect that you're trying to move your state into S3 and ask, "Do you want to copy existing state to the new backend?" Enter "yes". Now state is stored in the bucket and the DynamoDB table will be used to lock the state to prevent concurrent modifications.
0 commit comments