mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
Reviewed By: a8m Differential Revision: D16709221 fbshipit-source-id: fb946974eb13319c1c30597ecadc93d76056761e
38 lines
669 B
HCL
38 lines
669 B
HCL
resource "aws_s3_bucket" "website" {
|
|
bucket = "entgo.io"
|
|
acl = "public-read"
|
|
|
|
server_side_encryption_configuration {
|
|
rule {
|
|
apply_server_side_encryption_by_default {
|
|
sse_algorithm = "AES256"
|
|
}
|
|
}
|
|
}
|
|
|
|
versioning {
|
|
enabled = true
|
|
}
|
|
}
|
|
|
|
data "aws_iam_policy_document" "website" {
|
|
statement {
|
|
actions = [
|
|
"s3:GetObject",
|
|
]
|
|
|
|
resources = [
|
|
format("%s/*", aws_s3_bucket.website.arn)
|
|
]
|
|
|
|
principals {
|
|
identifiers = ["*"]
|
|
type = "AWS"
|
|
}
|
|
}
|
|
}
|
|
|
|
resource "aws_s3_bucket_policy" "website" {
|
|
bucket = aws_s3_bucket.website.id
|
|
policy = data.aws_iam_policy_document.website.json
|
|
} |