-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
45 lines (37 loc) · 848 Bytes
/
main.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
terraform {
required_version = ">= v1.5.5"
}
module "bucket" {
source = "terraform-aws-modules/s3-bucket/aws"
version = "4.6.0"
bucket = var.name
block_public_acls = false
block_public_policy = false
ignore_public_acls = false
restrict_public_buckets = false
control_object_ownership = true
object_ownership = "ObjectWriter"
versioning = {
status = "Disabled"
}
website = {
index_document = "index.html"
}
attach_policy = true
policy = jsonencode({
Version = "2012-10-17",
Statement = [
{
Sid = "PublicReadForGetBucketObjects",
Effect = "Allow",
Principal = {
AWS = "*"
},
Action = "s3:GetObject",
Resource = "arn:aws:s3:::${var.name}/*"
}
]
})
grant = var.grant
owner = var.owner
}