Skip to content

Commit 849a55c

Browse files
authored
Use minimum versions for provider pinning and support 3.0 s3 resources (#63)
1 parent 41a9aa5 commit 849a55c

File tree

6 files changed

+24
-31
lines changed

6 files changed

+24
-31
lines changed

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -196,19 +196,19 @@ Available targets:
196196

197197
| Name | Version |
198198
|------|---------|
199-
| terraform | >= 0.12.0, < 0.14.0 |
200-
| aws | ~> 2.0 |
201-
| local | ~> 1.2 |
202-
| null | ~> 2.0 |
203-
| template | ~> 2.0 |
199+
| terraform | >= 0.12.0 |
200+
| aws | >= 2.0 |
201+
| local | >= 1.2 |
202+
| null | >= 2.0 |
203+
| template | >= 2.0 |
204204

205205
## Providers
206206

207207
| Name | Version |
208208
|------|---------|
209-
| aws | ~> 2.0 |
210-
| local | ~> 1.2 |
211-
| template | ~> 2.0 |
209+
| aws | >= 2.0 |
210+
| local | >= 1.2 |
211+
| template | >= 2.0 |
212212

213213
## Inputs
214214

@@ -238,7 +238,6 @@ Available targets:
238238
| profile | AWS profile name as set in the shared credentials file | `string` | `""` | no |
239239
| read\_capacity | DynamoDB read capacity units | `number` | `5` | no |
240240
| 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 |
241-
| region | AWS Region the S3 bucket should reside in | `string` | n/a | yes |
242241
| restrict\_public\_buckets | Whether Amazon S3 should restrict public bucket policies for this bucket | `bool` | `true` | no |
243242
| role\_arn | The role to be assumed | `string` | `""` | no |
244243
| 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 |

docs/terraform.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33

44
| Name | Version |
55
|------|---------|
6-
| terraform | >= 0.12.0, < 0.14.0 |
7-
| aws | ~> 2.0 |
8-
| local | ~> 1.2 |
9-
| null | ~> 2.0 |
10-
| template | ~> 2.0 |
6+
| terraform | >= 0.12.0 |
7+
| aws | >= 2.0 |
8+
| local | >= 1.2 |
9+
| null | >= 2.0 |
10+
| template | >= 2.0 |
1111

1212
## Providers
1313

1414
| Name | Version |
1515
|------|---------|
16-
| aws | ~> 2.0 |
17-
| local | ~> 1.2 |
18-
| template | ~> 2.0 |
16+
| aws | >= 2.0 |
17+
| local | >= 1.2 |
18+
| template | >= 2.0 |
1919

2020
## Inputs
2121

@@ -45,7 +45,6 @@
4545
| profile | AWS profile name as set in the shared credentials file | `string` | `""` | no |
4646
| read\_capacity | DynamoDB read capacity units | `number` | `5` | no |
4747
| 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 |
48-
| region | AWS Region the S3 bucket should reside in | `string` | n/a | yes |
4948
| restrict\_public\_buckets | Whether Amazon S3 should restrict public bucket policies for this bucket | `bool` | `true` | no |
5049
| role\_arn | The role to be assumed | `string` | `""` | no |
5150
| 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 |

examples/complete/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ provider "aws" {
55
module "tfstate_backend" {
66
source = "../../"
77

8-
region = var.region
98
namespace = var.namespace
109
stage = var.stage
1110
name = var.name

main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ data "aws_iam_policy_document" "prevent_unencrypted_uploads" {
125125
resource "aws_s3_bucket" "default" {
126126
bucket = substr(local.bucket_name, 0, 63)
127127
acl = var.acl
128-
region = var.region
129128
force_destroy = var.force_destroy
130129
policy = local.policy
131130

@@ -225,11 +224,13 @@ resource "aws_dynamodb_table" "without_server_side_encryption" {
225224
tags = module.dynamodb_table_label.tags
226225
}
227226

227+
data "aws_region" "current" {}
228+
228229
data "template_file" "terraform_backend_config" {
229230
template = file(local.terraform_backend_config_template_file)
230231

231232
vars = {
232-
region = var.region
233+
region = data.aws_region.current.name
233234
bucket = aws_s3_bucket.default.id
234235

235236
dynamodb_table = element(

variables.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ variable "label_order" {
8282
description = "The naming order of the id output and Name tag"
8383
}
8484

85-
variable "region" {
86-
type = string
87-
description = "AWS Region the S3 bucket should reside in"
88-
}
89-
9085
variable "arn_format" {
9186
type = string
9287
default = "arn:aws"

versions.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 0.12.0, < 0.14.0"
2+
required_version = ">= 0.12.0"
33

44
required_providers {
5-
aws = "~> 2.0"
6-
template = "~> 2.0"
7-
local = "~> 1.2"
8-
null = "~> 2.0"
5+
aws = ">= 2.0"
6+
template = ">= 2.0"
7+
local = ">= 1.2"
8+
null = ">= 2.0"
99
}
1010
}

0 commit comments

Comments
 (0)