Skip to content

Commit fa1defc

Browse files
authoredNov 7, 2021
feat: Added Replication Time Control for Bucket Replication (terraform-aws-modules#114)
1 parent 209fd2f commit fa1defc

File tree

11 files changed

+45
-17
lines changed

11 files changed

+45
-17
lines changed
 

‎.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ repos:
1616
# entry: /Users/Bob/Sites/terraform-aws-modules/scripts/generate-terraform-wrappers.sh --module-dir modules/notification --overwrite
1717
# language: system
1818
# pass_filenames: false
19-
- repo: git://github.com/antonbabenko/pre-commit-terraform
20-
rev: v1.50.0
19+
- repo: https://github.com/antonbabenko/pre-commit-terraform
20+
rev: v1.55.0
2121
hooks:
2222
- id: terraform_fmt
2323
- id: terraform_validate
@@ -37,7 +37,7 @@ repos:
3737
- '--args=--only=terraform_required_providers'
3838
- '--args=--only=terraform_standard_module_structure'
3939
- '--args=--only=terraform_workspace_remote'
40-
- repo: git://github.com/pre-commit/pre-commit-hooks
41-
rev: v3.4.0
40+
- repo: https://github.com/pre-commit/pre-commit-hooks
41+
rev: v4.0.1
4242
hooks:
4343
- id: check-merge-conflict

‎README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ inputs = {
108108
| Name | Version |
109109
|------|---------|
110110
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
111-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.50 |
111+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.64 |
112112

113113
## Providers
114114

115115
| Name | Version |
116116
|------|---------|
117-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.50 |
117+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.64 |
118118

119119
## Modules
120120

‎examples/s3-replication/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ Note that this example may create resources which cost money. Run `terraform des
2222
| Name | Version |
2323
|------|---------|
2424
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
25-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.50 |
25+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.64 |
2626
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
2727

2828
## Providers
2929

3030
| Name | Version |
3131
|------|---------|
32-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.50 |
33-
| <a name="provider_aws.replica"></a> [aws.replica](#provider\_aws.replica) | >= 3.50 |
32+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.64 |
33+
| <a name="provider_aws.replica"></a> [aws.replica](#provider\_aws.replica) | >= 3.64 |
3434
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
3535

3636
## Modules

‎examples/s3-replication/main.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ module "s3_bucket" {
8383
access_control_translation = {
8484
owner = "Destination"
8585
}
86+
replication_time = {
87+
status = "Enabled"
88+
minutes = 15
89+
}
90+
metrics = {
91+
status = "Enabled"
92+
minutes = 15
93+
}
8694
}
8795
},
8896
{
@@ -128,4 +136,4 @@ module "s3_bucket" {
128136
]
129137
}
130138

131-
}
139+
}

‎examples/s3-replication/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_version = ">= 0.13.1"
33

44
required_providers {
5-
aws = ">= 3.50"
5+
aws = ">= 3.64"
66
random = ">= 2.0"
77
}
88
}

‎main.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,24 @@ resource "aws_s3_bucket" "this" {
154154
owner = access_control_translation.value.owner
155155
}
156156
}
157+
158+
dynamic "replication_time" {
159+
for_each = length(keys(lookup(destination.value, "replication_time", {}))) == 0 ? [] : [lookup(destination.value, "replication_time", {})]
160+
161+
content {
162+
status = replication_time.value.status
163+
minutes = replication_time.value.minutes
164+
}
165+
}
166+
167+
dynamic "metrics" {
168+
for_each = length(keys(lookup(destination.value, "metrics", {}))) == 0 ? [] : [lookup(destination.value, "metrics", {})]
169+
170+
content {
171+
status = metrics.value.status
172+
minutes = metrics.value.minutes
173+
}
174+
}
157175
}
158176
}
159177

‎versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ terraform {
22
required_version = ">= 0.13.1"
33

44
required_providers {
5-
aws = ">= 3.50"
5+
aws = ">= 3.64"
66
}
77
}

‎wrappers/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ inputs = {
2828
}
2929
```
3030

31-
## Usage with Terraform:
31+
## Usage with Terraform
3232

3333
```hcl
3434
module "wrapper" {

‎wrappers/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ module "wrapper" {
3030
block_public_policy = lookup(each.value, "block_public_policy", false)
3131
ignore_public_acls = lookup(each.value, "ignore_public_acls", false)
3232
restrict_public_buckets = lookup(each.value, "restrict_public_buckets", false)
33+
control_object_ownership = lookup(each.value, "control_object_ownership", false)
34+
object_ownership = lookup(each.value, "object_ownership", "ObjectWriter")
3335
}

‎wrappers/notification/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You may want to use a single Terragrunt configuration file to manage multiple re
66

77
This wrapper does not implement any extra functionality.
88

9-
# Usage with Terragrunt
9+
## Usage with Terragrunt
1010

1111
`terragrunt.hcl`:
1212

@@ -28,7 +28,7 @@ inputs = {
2828
}
2929
```
3030

31-
## Usage with Terraform:
31+
## Usage with Terraform
3232

3333
```hcl
3434
module "wrapper" {

‎wrappers/object/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You may want to use a single Terragrunt configuration file to manage multiple re
66

77
This wrapper does not implement any extra functionality.
88

9-
# Usage with Terragrunt
9+
## Usage with Terragrunt
1010

1111
`terragrunt.hcl`:
1212

@@ -28,7 +28,7 @@ inputs = {
2828
}
2929
```
3030

31-
## Usage with Terraform:
31+
## Usage with Terraform
3232

3333
```hcl
3434
module "wrapper" {

0 commit comments

Comments
 (0)
Please sign in to comment.