Skip to content

Commit

Permalink
add replication_configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolnagpal committed Sep 1, 2021
1 parent a396891 commit ff18388
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 5 deletions.
18 changes: 16 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,24 @@ resource "aws_s3_bucket" "s3_default" {
}
}

tags = module.labels.tags
replication_configuration {
role = var.replication-role

}
rules {
id = var.replication-id
priority = var.replication-priority
status = var.replication-status

destination {
bucket = var.replication-bucket
}

filter {}

}

}
}
# Module : S3 BUCKET POLICY
# Description : Terraform module which creates policy for S3 bucket on AWS
resource "aws_s3_bucket_policy" "s3_default" {
Expand Down
36 changes: 33 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ variable "environment" {
}

variable "label_order" {
type = list
type = list(any)
default = []
description = "Label order, e.g. `name`,`application`."
}
Expand All @@ -31,7 +31,7 @@ variable "managedby" {
}

variable "attributes" {
type = list
type = list(any)
default = []
description = "Additional attributes (e.g. `1`)."
}
Expand All @@ -43,7 +43,7 @@ variable "delimiter" {
}

variable "tags" {
type = map
type = map(any)
default = {}
description = "Additional tags (e.g. map(`BusinessUnit`,`XYZ`)."
}
Expand Down Expand Up @@ -207,3 +207,33 @@ variable "force_destroy" {
default = false
description = "A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable."
}

variable "replication-role" {
type = string
default = ""
description = ""
}

variable "replication-id" {
type = string
default = ""
description = "A replication id for s3"
}

variable "replication-priority" {
type = number
default = ""
description = "replication-priority number exp. 0,1,2 etc"
}

variable "replication-status" {
type = string
default = ""
description = ""
}

variable "replication-bucket" {
type = string
default = ""
description = "s3 bucket arn for replication bucket "
}

0 comments on commit ff18388

Please sign in to comment.