# Provider Configuration provider "aws" { region = "ap-northeast-2" } # Locals for Constants (replace values as needed) locals { prefix = "bumpsoo-menu" image_bucket_name = "${local.prefix}-img-bucket" lambda_role_name = "${local.prefix}-lambda-role" lambda_function_name = "${local.prefix}-lambda" lambda_filename = "artifacts.zip" # Zip file containing Lambda code lambda_handler = "main.lambda_handler" # Replace with your handler weekday_rule_name = "${local.prefix}-weekday-image-upload" schedule_role_name = "${local.prefix}-schedule-role" } # S3 Bucket (Publicly Accessible) resource "aws_s3_bucket" "image_bucket" { bucket = local.image_bucket_name } # S3 Bucket Public Access Block (disabled for objects) resource "aws_s3_bucket_public_access_block" "image_bucket_public_access_block" { bucket = aws_s3_bucket.image_bucket.id block_public_acls = false # Block public ACLs block_public_policy = false # Block public bucket policies ignore_public_acls = false # Ignore public ACLs on existing objects restrict_public_buckets = false # Restrict public bucket policies on existing buckets } resource "aws_s3_bucket_policy" "image_bucket_policy" { depends_on = [ aws_s3_bucket.image_bucket, aws_s3_bucket_public_access_block.image_bucket_public_access_block ] bucket = aws_s3_bucket.image_bucket.id policy = <