Commit fa1defc0 authored by schniber's avatar schniber Committed by GitHub

feat: Added Replication Time Control for Bucket Replication (#114)

parent 209fd2f3
......@@ -16,8 +16,8 @@ repos:
# entry: /Users/Bob/Sites/terraform-aws-modules/scripts/generate-terraform-wrappers.sh --module-dir modules/notification --overwrite
# language: system
# pass_filenames: false
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.50.0
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.55.0
hooks:
- id: terraform_fmt
- id: terraform_validate
......@@ -37,7 +37,7 @@ repos:
- '--args=--only=terraform_required_providers'
- '--args=--only=terraform_standard_module_structure'
- '--args=--only=terraform_workspace_remote'
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-merge-conflict
......@@ -108,13 +108,13 @@ inputs = {
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.50 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.64 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.50 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.64 |
## Modules
......
......@@ -22,15 +22,15 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.50 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.64 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.50 |
| <a name="provider_aws.replica"></a> [aws.replica](#provider\_aws.replica) | >= 3.50 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.64 |
| <a name="provider_aws.replica"></a> [aws.replica](#provider\_aws.replica) | >= 3.64 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
## Modules
......
......@@ -83,6 +83,14 @@ module "s3_bucket" {
access_control_translation = {
owner = "Destination"
}
replication_time = {
status = "Enabled"
minutes = 15
}
metrics = {
status = "Enabled"
minutes = 15
}
}
},
{
......@@ -128,4 +136,4 @@ module "s3_bucket" {
]
}
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@ terraform {
required_version = ">= 0.13.1"
required_providers {
aws = ">= 3.50"
aws = ">= 3.64"
random = ">= 2.0"
}
}
......@@ -154,6 +154,24 @@ resource "aws_s3_bucket" "this" {
owner = access_control_translation.value.owner
}
}
dynamic "replication_time" {
for_each = length(keys(lookup(destination.value, "replication_time", {}))) == 0 ? [] : [lookup(destination.value, "replication_time", {})]
content {
status = replication_time.value.status
minutes = replication_time.value.minutes
}
}
dynamic "metrics" {
for_each = length(keys(lookup(destination.value, "metrics", {}))) == 0 ? [] : [lookup(destination.value, "metrics", {})]
content {
status = metrics.value.status
minutes = metrics.value.minutes
}
}
}
}
......
......@@ -2,6 +2,6 @@ terraform {
required_version = ">= 0.13.1"
required_providers {
aws = ">= 3.50"
aws = ">= 3.64"
}
}
......@@ -28,7 +28,7 @@ inputs = {
}
```
## Usage with Terraform:
## Usage with Terraform
```hcl
module "wrapper" {
......
......@@ -30,4 +30,6 @@ module "wrapper" {
block_public_policy = lookup(each.value, "block_public_policy", false)
ignore_public_acls = lookup(each.value, "ignore_public_acls", false)
restrict_public_buckets = lookup(each.value, "restrict_public_buckets", false)
control_object_ownership = lookup(each.value, "control_object_ownership", false)
object_ownership = lookup(each.value, "object_ownership", "ObjectWriter")
}
......@@ -6,7 +6,7 @@ You may want to use a single Terragrunt configuration file to manage multiple re
This wrapper does not implement any extra functionality.
# Usage with Terragrunt
## Usage with Terragrunt
`terragrunt.hcl`:
......@@ -28,7 +28,7 @@ inputs = {
}
```
## Usage with Terraform:
## Usage with Terraform
```hcl
module "wrapper" {
......
......@@ -6,7 +6,7 @@ You may want to use a single Terragrunt configuration file to manage multiple re
This wrapper does not implement any extra functionality.
# Usage with Terragrunt
## Usage with Terragrunt
`terragrunt.hcl`:
......@@ -28,7 +28,7 @@ inputs = {
}
```
## Usage with Terraform:
## Usage with Terraform
```hcl
module "wrapper" {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment