forked from likelion-KLover/backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
40 lines (31 loc) · 989 Bytes
/
Copy pathmain.tf
File metadata and controls
40 lines (31 loc) · 989 Bytes
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
# S3 설정 시작
resource "aws_s3_bucket" "bucket_1" {
bucket = "${var.prefix}-bucket-${var.nickname}-1"
tags = {
Name = "${var.prefix}-bucket-${var.nickname}-1"
}
}
data "aws_iam_policy_document" "bucket_1_policy_1_statement" {
statement {
sid = "PublicReadGetObject"
effect = "Allow"
principals {
type = "AWS"
identifiers = ["*"]
}
actions = ["s3:GetObject"]
resources = ["${aws_s3_bucket.bucket_1.arn}/*"]
}
}
resource "aws_s3_bucket_policy" "bucket_1_policy_1" {
bucket = aws_s3_bucket.bucket_1.id
policy = data.aws_iam_policy_document.bucket_1_policy_1_statement.json
depends_on = [aws_s3_bucket_public_access_block.bucket_1_public_access_block_1]
}
resource "aws_s3_bucket_public_access_block" "bucket_1_public_access_block_1" {
bucket = aws_s3_bucket.bucket_1.id
block_public_acls = false
block_public_policy = false
ignore_public_acls = false
restrict_public_buckets = false
}