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: ...@@ -16,8 +16,8 @@ repos:
# entry: /Users/Bob/Sites/terraform-aws-modules/scripts/generate-terraform-wrappers.sh --module-dir modules/notification --overwrite # entry: /Users/Bob/Sites/terraform-aws-modules/scripts/generate-terraform-wrappers.sh --module-dir modules/notification --overwrite
# language: system # language: system
# pass_filenames: false # pass_filenames: false
- repo: git://github.com/antonbabenko/pre-commit-terraform - repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.50.0 rev: v1.55.0
hooks: hooks:
- id: terraform_fmt - id: terraform_fmt
- id: terraform_validate - id: terraform_validate
...@@ -37,7 +37,7 @@ repos: ...@@ -37,7 +37,7 @@ repos:
- '--args=--only=terraform_required_providers' - '--args=--only=terraform_required_providers'
- '--args=--only=terraform_standard_module_structure' - '--args=--only=terraform_standard_module_structure'
- '--args=--only=terraform_workspace_remote' - '--args=--only=terraform_workspace_remote'
- repo: git://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0 rev: v4.0.1
hooks: hooks:
- id: check-merge-conflict - id: check-merge-conflict
...@@ -108,13 +108,13 @@ inputs = { ...@@ -108,13 +108,13 @@ inputs = {
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 | | <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 ## Providers
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.50 | | <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.64 |
## Modules ## Modules
......
...@@ -22,15 +22,15 @@ Note that this example may create resources which cost money. Run `terraform des ...@@ -22,15 +22,15 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 | | <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 | | <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
## Providers ## Providers
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.50 | | <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.64 |
| <a name="provider_aws.replica"></a> [aws.replica](#provider\_aws.replica) | >= 3.50 | | <a name="provider_aws.replica"></a> [aws.replica](#provider\_aws.replica) | >= 3.64 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 | | <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
## Modules ## Modules
......
...@@ -83,6 +83,14 @@ module "s3_bucket" { ...@@ -83,6 +83,14 @@ module "s3_bucket" {
access_control_translation = { access_control_translation = {
owner = "Destination" owner = "Destination"
} }
replication_time = {
status = "Enabled"
minutes = 15
}
metrics = {
status = "Enabled"
minutes = 15
}
} }
}, },
{ {
......
...@@ -2,7 +2,7 @@ terraform { ...@@ -2,7 +2,7 @@ terraform {
required_version = ">= 0.13.1" required_version = ">= 0.13.1"
required_providers { required_providers {
aws = ">= 3.50" aws = ">= 3.64"
random = ">= 2.0" random = ">= 2.0"
} }
} }
...@@ -154,6 +154,24 @@ resource "aws_s3_bucket" "this" { ...@@ -154,6 +154,24 @@ resource "aws_s3_bucket" "this" {
owner = access_control_translation.value.owner 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 { ...@@ -2,6 +2,6 @@ terraform {
required_version = ">= 0.13.1" required_version = ">= 0.13.1"
required_providers { required_providers {
aws = ">= 3.50" aws = ">= 3.64"
} }
} }
...@@ -28,7 +28,7 @@ inputs = { ...@@ -28,7 +28,7 @@ inputs = {
} }
``` ```
## Usage with Terraform: ## Usage with Terraform
```hcl ```hcl
module "wrapper" { module "wrapper" {
......
...@@ -30,4 +30,6 @@ module "wrapper" { ...@@ -30,4 +30,6 @@ module "wrapper" {
block_public_policy = lookup(each.value, "block_public_policy", false) block_public_policy = lookup(each.value, "block_public_policy", false)
ignore_public_acls = lookup(each.value, "ignore_public_acls", false) ignore_public_acls = lookup(each.value, "ignore_public_acls", false)
restrict_public_buckets = lookup(each.value, "restrict_public_buckets", 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 ...@@ -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. This wrapper does not implement any extra functionality.
# Usage with Terragrunt ## Usage with Terragrunt
`terragrunt.hcl`: `terragrunt.hcl`:
...@@ -28,7 +28,7 @@ inputs = { ...@@ -28,7 +28,7 @@ inputs = {
} }
``` ```
## Usage with Terraform: ## Usage with Terraform
```hcl ```hcl
module "wrapper" { module "wrapper" {
......
...@@ -6,7 +6,7 @@ You may want to use a single Terragrunt configuration file to manage multiple re ...@@ -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. This wrapper does not implement any extra functionality.
# Usage with Terragrunt ## Usage with Terragrunt
`terragrunt.hcl`: `terragrunt.hcl`:
...@@ -28,7 +28,7 @@ inputs = { ...@@ -28,7 +28,7 @@ inputs = {
} }
``` ```
## Usage with Terraform: ## Usage with Terraform
```hcl ```hcl
module "wrapper" { 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