Skip to content

Commit ff18388

Browse files
committed
add replication_configuration
1 parent a396891 commit ff18388

File tree

2 files changed

+49
-5
lines changed

2 files changed

+49
-5
lines changed

main.tf

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,24 @@ resource "aws_s3_bucket" "s3_default" {
6565
}
6666
}
6767

68-
tags = module.labels.tags
68+
replication_configuration {
69+
role = var.replication-role
6970

70-
}
71+
rules {
72+
id = var.replication-id
73+
priority = var.replication-priority
74+
status = var.replication-status
75+
76+
destination {
77+
bucket = var.replication-bucket
78+
}
79+
80+
filter {}
7181

82+
}
83+
84+
}
85+
}
7286
# Module : S3 BUCKET POLICY
7387
# Description : Terraform module which creates policy for S3 bucket on AWS
7488
resource "aws_s3_bucket_policy" "s3_default" {

variables.tf

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ variable "environment" {
1919
}
2020

2121
variable "label_order" {
22-
type = list
22+
type = list(any)
2323
default = []
2424
description = "Label order, e.g. `name`,`application`."
2525
}
@@ -31,7 +31,7 @@ variable "managedby" {
3131
}
3232

3333
variable "attributes" {
34-
type = list
34+
type = list(any)
3535
default = []
3636
description = "Additional attributes (e.g. `1`)."
3737
}
@@ -43,7 +43,7 @@ variable "delimiter" {
4343
}
4444

4545
variable "tags" {
46-
type = map
46+
type = map(any)
4747
default = {}
4848
description = "Additional tags (e.g. map(`BusinessUnit`,`XYZ`)."
4949
}
@@ -207,3 +207,33 @@ variable "force_destroy" {
207207
default = false
208208
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."
209209
}
210+
211+
variable "replication-role" {
212+
type = string
213+
default = ""
214+
description = ""
215+
}
216+
217+
variable "replication-id" {
218+
type = string
219+
default = ""
220+
description = "A replication id for s3"
221+
}
222+
223+
variable "replication-priority" {
224+
type = number
225+
default = ""
226+
description = "replication-priority number exp. 0,1,2 etc"
227+
}
228+
229+
variable "replication-status" {
230+
type = string
231+
default = ""
232+
description = ""
233+
}
234+
235+
variable "replication-bucket" {
236+
type = string
237+
default = ""
238+
description = "s3 bucket arn for replication bucket "
239+
}

0 commit comments

Comments
 (0)