-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy paths3.tf
54 lines (49 loc) · 1.15 KB
/
s3.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
resource "aws_s3_bucket" "iaac" {
bucket="${var.bucket_name}-${var.env}"
acl = "private"
tags = var.tags
versioning {
enabled = true
}
lifecycle {
prevent_destroy = true
}
server_side_encryption_configuration {
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
}
object_lock_configuration {
object_lock_enabled = "Enabled"
}
# policy = <<POLICY
# {
# "Id": "Policy1600979153189",
# "Version": "2012-10-17",
# "Statement": [
# {
# "Sid": "Stmt1600979084653",
# "Action": [
# "s3:ListBucket"
# ],
# "Effect": "Deny",
# "Resource": "arn:aws:s3:::${var.bucket_name}-${var.env}/*",
# "Principal": "*"
# },
# {
# "Sid": "Stmt1600979150930",
# "Action": [
# "s3:DeleteObject",
# "s3:GetObject",
# "s3:PutObject"
# ],
# "Effect": "Allow",
# "Resource": "arn:aws:s3:::${var.bucket_name}-${var.env}/*",
# "Principal": "*"
# }
# ]
# }
# POLICY
}