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
__NOTE:__ The operators of the module (IAM Users) must have permissions to create S3 buckets and DynamoDB tables when performing `terraform plan` and `terraform apply`
17
22
18
23
24
+
---
25
+
26
+
This project is part of our comprehensive ["SweetOps"](https://docs.cloudposse.com) approach towards DevOps.
27
+
28
+
29
+
It's 100% Open Source and licensed under the [APACHE2](LICENSE).
30
+
31
+
32
+
33
+
34
+
19
35
## Usage
20
36
21
37
```hcl
@@ -66,42 +82,86 @@ and the DynamoDB table will be used to lock the state to prevent concurrent modi
|`region`| `` | AWS Region the S3 bucket should reside in | Yes |
76
-
|`name`|`terraform`| Name (_e.g._`app`, `cluster`, or `terraform`) | No |
77
-
|`attributes`|`["state"]`| Additional attributes (_e.g._`state`) | No |
78
-
|`tags`|`{}`| Additional tags (_e.g._`map("BusinessUnit","XYZ")`| No |
79
-
|`delimiter`|`-`| Delimiter to be used between `namespace`, `stage`, `name`, and `attributes`| No |
80
-
|`acl`|`private`| The canned ACL to apply to the S3 bucket | No |
81
-
|`read_capacity`|`5`| DynamoDB read capacity units | No |
82
-
|`write_capacity`|`5`| DynamoDB write capacity units | No |
83
-
|`force_destroy`|`false`| A boolean that indicates the S3 bucket can be destroyed even if it contains objects. These objects are not recoverable | No |
84
-
|`enable_server_side_encryption`|`true`| Enable DynamoDB server-side encryption | No |
85
86
86
87
88
+
89
+
## Makefile Targets
90
+
```
91
+
Available targets:
92
+
93
+
help This help screen
94
+
help/all Display help for all targets
95
+
lint Lint terraform code
96
+
97
+
```
98
+
99
+
## Inputs
100
+
101
+
| Name | Description | Type | Default | Required |
102
+
|------|-------------|:----:|:-----:|:-----:|
103
+
| acl | The canned ACL to apply to the S3 bucket | string |`private`| no |
104
+
| attributes | Additional attributes (e.g. `state`) | list |`<list>`| no |
105
+
| delimiter | Delimiter to be used between `namespace`, `stage`, `name`, and `attributes`| string |`-`| no |
| force_destroy | A boolean that indicates the S3 bucket can be destroyed even if it contains objects. These objects are not recoverable | string |`false`| no |
108
+
| name | Name (e.g. `app` or `cluster`) | string |`terraform`| no |
-[terraform-aws-dynamodb](https://github.com/cloudposse/terraform-aws-dynamodb) - Terraform module that implements AWS DynamoDB with support for AutoScaling
135
+
-[terraform-aws-dynamodb-autoscaler](https://github.com/cloudposse/terraform-aws-dynamodb-autoscaler) - Terraform module to provision DynamoDB autoscaler
136
+
97
137
98
138
99
139
## Help
100
140
101
141
**Got a question?**
102
142
103
-
File a GitHub [issue](https://github.com/cloudposse/terraform-aws-tfstate-backend/issues), send us an [email](mailto:hello@cloudposse.com) or reach out to us on [Gitter](https://gitter.im/cloudposse/).
143
+
File a GitHub [issue](https://github.com/cloudposse/terraform-aws-tfstate-backend/issues), send us an [email][email] or join our [Slack Community][slack].
144
+
145
+
## Commerical Support
146
+
147
+
Work directly with our team of DevOps experts via email, slack, and video conferencing.
148
+
149
+
We provide *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 fulltime engineer.
-**Questions.** We'll use a Shared Slack channel between your team and ours.
154
+
-**Troubleshooting.** We'll help you triage why things aren't working.
155
+
-**Code Reviews.** We'll review your Pull Requests and provide constructive feedback.
156
+
-**Bug Fixes.** We'll rapidly work to fix any bugs in our projects.
157
+
-**Build New Terraform Modules.** We'll develop original modules to provision infrastructure.
158
+
-**Cloud Architecture.** We'll assist with your cloud strategy and design.
159
+
-**Implementation.** We'll provide hands on support to implement our reference architectures.
160
+
104
161
162
+
## Community Forum
163
+
164
+
Get access to our [Open Source Community Forum][slack] on Slack. It's **FREE** to join for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build *sweet* infrastructure.
105
165
106
166
## Contributing
107
167
@@ -111,22 +171,28 @@ Please use the [issue tracker](https://github.com/cloudposse/terraform-aws-tfsta
111
171
112
172
### Developing
113
173
114
-
If you are interested in being a contributor and want to get involved in developing `terraform-aws-tfstate-backend`, we would love to hear from you! Shoot us an [email](mailto:hello@cloudposse.com).
174
+
If you are interested in being a contributor and want to get involved in developing this project or [help out](https://github.com/orgs/cloudposse/projects/3) with our other projects, we would love to hear from you! Shoot us an [email](mailto:hello@cloudposse.com).
115
175
116
176
In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
117
177
118
178
1.**Fork** the repo on GitHub
119
179
2.**Clone** the project to your own machine
120
180
3.**Commit** changes to your own branch
121
181
4.**Push** your work back up to your fork
122
-
5. Submit a **Pull request** so that we can review your changes
182
+
5. Submit a **Pull Request** so that we can review your changes
183
+
184
+
**NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request!
__NOTE:__ The operators of the module (IAM Users) must have permissions to create S3 buckets and DynamoDB tables when performing `terraform plan` and `terraform apply`
__NOTE:__ First create the bucket and table without any state enabled (Terraform will use the local file system to store state).
74
+
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.
75
+
76
+
Once the bucket and table have been created, configure the [backend](https://www.terraform.io/docs/backends/types/s3.html)
77
+
78
+
```hcl
79
+
terraform {
80
+
required_version = ">= 0.11.3"
81
+
82
+
backend "s3" {
83
+
region = "us-east-1"
84
+
bucket = "< the name of the S3 bucket >"
85
+
key = "terraform.tfstate"
86
+
dynamodb_table = "< the name of the DynamoDB table >"
87
+
encrypt = true
88
+
}
89
+
}
90
+
91
+
module "another_module" {
92
+
source = "....."
93
+
}
94
+
```
95
+
96
+
Initialize the backend with `terraform init`.
97
+
98
+
After `terraform apply`, `terraform.tfstate` file will be stored in the bucket,
99
+
and the DynamoDB table will be used to lock the state to prevent concurrent modifications.
0 commit comments