|
42 | 42 |
|
43 | 43 | [![Cloud Posse][logo]](https://cpco.io/homepage) |
44 | 44 |
|
45 | | -# terraform-aws-tfstate-backend [](https://g.codefresh.io/public/accounts/cloudposse/pipelines/5d0d3d11c841e6807afe8d2a) [](https://github.com/cloudposse/terraform-aws-tfstate-backend/releases/latest) [](https://slack.cloudposse.com) |
| 45 | +# terraform-aws-tfstate-backend [](https://github.com/cloudposse/terraform-aws-tfstate-backend/releases/latest) [](https://slack.cloudposse.com) |
46 | 46 |
|
47 | 47 |
|
48 | 48 | Terraform module to provision an S3 bucket to store `terraform.tfstate` file and a DynamoDB table to lock the state file |
@@ -154,56 +154,74 @@ Available targets: |
154 | 154 | lint Lint terraform code |
155 | 155 |
|
156 | 156 | ``` |
| 157 | +## Requirements |
| 158 | + |
| 159 | +| Name | Version | |
| 160 | +|------|---------| |
| 161 | +| terraform | ~> 0.12.0 | |
| 162 | +| aws | ~> 2.0 | |
| 163 | +| local | ~> 1.2 | |
| 164 | +| null | ~> 2.0 | |
| 165 | +| template | ~> 2.0 | |
| 166 | + |
| 167 | +## Providers |
| 168 | + |
| 169 | +| Name | Version | |
| 170 | +|------|---------| |
| 171 | +| aws | ~> 2.0 | |
| 172 | +| local | ~> 1.2 | |
| 173 | +| template | ~> 2.0 | |
| 174 | + |
157 | 175 | ## Inputs |
158 | 176 |
|
159 | 177 | | Name | Description | Type | Default | Required | |
160 | | -|------|-------------|:----:|:-----:|:-----:| |
161 | | -| acl | The canned ACL to apply to the S3 bucket | string | `private` | no | |
162 | | -| additional_tag_map | Additional tags for appending to each tag map | map(string) | `<map>` | no | |
163 | | -| arn_format | ARN format to be used. May be changed to support deployment in GovCloud/China regions. | string | `arn:aws` | no | |
164 | | -| attributes | Additional attributes (e.g. `state`) | list(string) | `<list>` | no | |
165 | | -| billing_mode | DynamoDB billing mode | string | `PROVISIONED` | no | |
166 | | -| block_public_acls | Whether Amazon S3 should block public ACLs for this bucket | bool | `true` | no | |
167 | | -| block_public_policy | Whether Amazon S3 should block public bucket policies for this bucket | string | `true` | no | |
168 | | -| context | Default context to use for passing state between label invocations | object | `<map>` | no | |
169 | | -| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes` | string | `-` | no | |
170 | | -| enable_point_in_time_recovery | Enable DynamoDB point-in-time recovery | bool | `false` | no | |
171 | | -| enable_server_side_encryption | Enable DynamoDB server-side encryption | bool | `true` | no | |
172 | | -| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | string | `` | no | |
173 | | -| force_destroy | A boolean that indicates the S3 bucket can be destroyed even if it contains objects. These objects are not recoverable | bool | `false` | no | |
174 | | -| ignore_public_acls | Whether Amazon S3 should ignore public ACLs for this bucket | bool | `true` | no | |
175 | | -| label_order | The naming order of the id output and Name tag | list(string) | `<list>` | no | |
176 | | -| mfa_delete | A boolean that indicates that versions of S3 objects can only be deleted with MFA. ( Terraform cannot apply changes of this value; https://github.com/terraform-providers/terraform-provider-aws/issues/629 ) | bool | `false` | no | |
177 | | -| name | Solution name, e.g. 'app' or 'jenkins' | string | `terraform` | no | |
178 | | -| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | string | `` | no | |
179 | | -| prevent_unencrypted_uploads | Prevent uploads of unencrypted objects to S3 | bool | `true` | no | |
180 | | -| profile | AWS profile name as set in the shared credentials file | string | `` | no | |
181 | | -| read_capacity | DynamoDB read capacity units | string | `5` | no | |
182 | | -| regex_replace_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`. By default only hyphens, letters and digits are allowed, all other chars are removed | string | `/[^a-zA-Z0-9-]/` | no | |
183 | | -| region | AWS Region the S3 bucket should reside in | string | - | yes | |
184 | | -| restrict_public_buckets | Whether Amazon S3 should restrict public bucket policies for this bucket | bool | `true` | no | |
185 | | -| role_arn | The role to be assumed | string | `` | no | |
186 | | -| s3_bucket_name | S3 bucket name. If not provided, the name will be generated by the label module in the format namespace-stage-name | string | `` | no | |
187 | | -| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | string | `` | no | |
188 | | -| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | map(string) | `<map>` | no | |
189 | | -| terraform_backend_config_file_name | Name of terraform backend config file | string | `terraform.tf` | no | |
190 | | -| terraform_backend_config_file_path | The path to terrafrom project directory | string | `` | no | |
191 | | -| terraform_backend_config_template_file | The path to the template used to generate the config file | string | `` | no | |
192 | | -| terraform_state_file | The path to the state file inside the bucket | string | `terraform.tfstate` | no | |
193 | | -| terraform_version | The minimum required terraform version | string | `0.12.2` | no | |
194 | | -| write_capacity | DynamoDB write capacity units | string | `5` | no | |
| 178 | +|------|-------------|------|---------|:--------:| |
| 179 | +| acl | The canned ACL to apply to the S3 bucket | `string` | `"private"` | no | |
| 180 | +| additional\_tag\_map | Additional tags for appending to each tag map | `map(string)` | `{}` | no | |
| 181 | +| arn\_format | ARN format to be used. May be changed to support deployment in GovCloud/China regions. | `string` | `"arn:aws"` | no | |
| 182 | +| attributes | Additional attributes (e.g. `state`) | `list(string)` | <pre>[<br> "state"<br>]</pre> | no | |
| 183 | +| billing\_mode | DynamoDB billing mode | `string` | `"PROVISIONED"` | no | |
| 184 | +| block\_public\_acls | Whether Amazon S3 should block public ACLs for this bucket | `bool` | `true` | no | |
| 185 | +| block\_public\_policy | Whether Amazon S3 should block public bucket policies for this bucket | `bool` | `true` | no | |
| 186 | +| context | Default context to use for passing state between label invocations | <pre>object({<br> namespace = string<br> environment = string<br> stage = string<br> name = string<br> enabled = bool<br> delimiter = string<br> attributes = list(string)<br> label_order = list(string)<br> tags = map(string)<br> additional_tag_map = map(string)<br> regex_replace_chars = string<br> })</pre> | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": "",<br> "enabled": true,<br> "environment": "",<br> "label_order": [],<br> "name": "",<br> "namespace": "",<br> "regex_replace_chars": "",<br> "stage": "",<br> "tags": {}<br>}</pre> | no | |
| 187 | +| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes` | `string` | `"-"` | no | |
| 188 | +| enable\_point\_in\_time\_recovery | Enable DynamoDB point-in-time recovery | `bool` | `false` | no | |
| 189 | +| enable\_server\_side\_encryption | Enable DynamoDB server-side encryption | `bool` | `true` | no | |
| 190 | +| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | `string` | `""` | no | |
| 191 | +| force\_destroy | A boolean that indicates the S3 bucket can be destroyed even if it contains objects. These objects are not recoverable | `bool` | `false` | no | |
| 192 | +| ignore\_public\_acls | Whether Amazon S3 should ignore public ACLs for this bucket | `bool` | `true` | no | |
| 193 | +| label\_order | The naming order of the id output and Name tag | `list(string)` | `[]` | no | |
| 194 | +| mfa\_delete | A boolean that indicates that versions of S3 objects can only be deleted with MFA. ( Terraform cannot apply changes of this value; https://github.com/terraform-providers/terraform-provider-aws/issues/629 ) | `bool` | `false` | no | |
| 195 | +| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `"terraform"` | no | |
| 196 | +| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `""` | no | |
| 197 | +| prevent\_unencrypted\_uploads | Prevent uploads of unencrypted objects to S3 | `bool` | `true` | no | |
| 198 | +| profile | AWS profile name as set in the shared credentials file | `string` | `""` | no | |
| 199 | +| read\_capacity | DynamoDB read capacity units | `number` | `5` | no | |
| 200 | +| regex\_replace\_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`. By default only hyphens, letters and digits are allowed, all other chars are removed | `string` | `"/[^a-zA-Z0-9-]/"` | no | |
| 201 | +| region | AWS Region the S3 bucket should reside in | `string` | n/a | yes | |
| 202 | +| restrict\_public\_buckets | Whether Amazon S3 should restrict public bucket policies for this bucket | `bool` | `true` | no | |
| 203 | +| role\_arn | The role to be assumed | `string` | `""` | no | |
| 204 | +| s3\_bucket\_name | S3 bucket name. If not provided, the name will be generated by the label module in the format namespace-stage-name | `string` | `""` | no | |
| 205 | +| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | `string` | `""` | no | |
| 206 | +| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | `map(string)` | `{}` | no | |
| 207 | +| terraform\_backend\_config\_file\_name | Name of terraform backend config file | `string` | `"terraform.tf"` | no | |
| 208 | +| terraform\_backend\_config\_file\_path | The path to terrafrom project directory | `string` | `""` | no | |
| 209 | +| terraform\_backend\_config\_template\_file | The path to the template used to generate the config file | `string` | `""` | no | |
| 210 | +| terraform\_state\_file | The path to the state file inside the bucket | `string` | `"terraform.tfstate"` | no | |
| 211 | +| terraform\_version | The minimum required terraform version | `string` | `"0.12.2"` | no | |
| 212 | +| write\_capacity | DynamoDB write capacity units | `number` | `5` | no | |
195 | 213 |
|
196 | 214 | ## Outputs |
197 | 215 |
|
198 | 216 | | Name | Description | |
199 | 217 | |------|-------------| |
200 | | -| dynamodb_table_arn | DynamoDB table ARN | |
201 | | -| dynamodb_table_id | DynamoDB table ID | |
202 | | -| dynamodb_table_name | DynamoDB table name | |
203 | | -| s3_bucket_arn | S3 bucket ARN | |
204 | | -| s3_bucket_domain_name | S3 bucket domain name | |
205 | | -| s3_bucket_id | S3 bucket ID | |
206 | | -| terraform_backend_config | Rendered Terraform backend config file | |
| 218 | +| dynamodb\_table\_arn | DynamoDB table ARN | |
| 219 | +| dynamodb\_table\_id | DynamoDB table ID | |
| 220 | +| dynamodb\_table\_name | DynamoDB table name | |
| 221 | +| s3\_bucket\_arn | S3 bucket ARN | |
| 222 | +| s3\_bucket\_domain\_name | S3 bucket domain name | |
| 223 | +| s3\_bucket\_id | S3 bucket ID | |
| 224 | +| terraform\_backend\_config | Rendered Terraform backend config file | |
207 | 225 |
|
208 | 226 |
|
209 | 227 |
|
|
0 commit comments