-
Notifications
You must be signed in to change notification settings - Fork 0
chore: AWS S3 공개 버킷 추가 #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e4a23bb
feat(infra): add public S3 bucket and upload commands for static assets
SinnoLn f722923
docs: document public static assets S3 bucket
SinnoLn 3326988
chore: remove unused region field from onboarding S3 test config
SinnoLn ee6d107
chore(infra): increase EC2 root volume to 30GB and switch to gp3
SinnoLn 26a36ae
fix: address review feedback on public assets bucket
SinnoLn 474bd4b
fix(infra): scope down public bucket permissions and fix access log d…
SinnoLn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| resource "aws_s3_bucket" "public" { | ||
| bucket = "${var.name_prefix}-public-${data.aws_caller_identity.current.account_id}" | ||
| } | ||
|
|
||
| resource "aws_s3_bucket_logging" "public" { | ||
| bucket = aws_s3_bucket.public.id | ||
| target_bucket = aws_s3_bucket.s3_access_logs.id | ||
| target_prefix = "public/" | ||
| } | ||
|
SinnoLn marked this conversation as resolved.
|
||
|
|
||
| resource "aws_s3_bucket_public_access_block" "public" { # NOSONAR | ||
| bucket = aws_s3_bucket.public.id | ||
|
|
||
| # public read-only bucket for static assets (logos, profile images); write access is IAM-gated | ||
| block_public_acls = true | ||
| block_public_policy = false | ||
| ignore_public_acls = true | ||
| restrict_public_buckets = false | ||
| } | ||
|
|
||
| resource "aws_s3_bucket_policy" "public" { | ||
| bucket = aws_s3_bucket.public.id | ||
| policy = jsonencode({ | ||
| Version = "2012-10-17" | ||
| Statement = [ | ||
| { | ||
| Sid = "PublicReadGetObject" | ||
| Effect = "Allow" | ||
| Principal = "*" | ||
| Action = "s3:GetObject" | ||
| Resource = "${aws_s3_bucket.public.arn}/*" | ||
| }, | ||
| { | ||
| Sid = "DenyInsecureTransport" | ||
| Effect = "Deny" | ||
| Principal = "*" | ||
| Action = "s3:*" | ||
| Resource = [ | ||
| aws_s3_bucket.public.arn, | ||
| "${aws_s3_bucket.public.arn}/*", | ||
| ] | ||
| Condition = { | ||
| Bool = { "aws:SecureTransport" = "false" } | ||
| } | ||
| }, | ||
| ] | ||
| }) | ||
|
|
||
| depends_on = [aws_s3_bucket_public_access_block.public] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,5 +64,4 @@ app: | |
| onboarding: | ||
| s3: | ||
| bucket: test-onboarding-bucket | ||
| region: ap-northeast-2 | ||
| presign-ttl: PT5M | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.