Shared: S3

Module creating 4 shared S3 Buckets for all stages

Shared Moduleshared/modules/s3

Info

Buckets are created once per account, not affected when destroying stage.

Buckets

BucketPurpose
milu2-stageArtifact / stage storage, mount-s3 on EC2
milu2-stage-cdn.milu.jpStatic website origin → CloudFront
milu2-stage-mysql-backupMySQL backup files
milu2stage-upload.milu.jpUser uploads origin → CloudFront

existing Flag

Variable existing_s3 in terraform.tfvars determines skip or create buckets:

  • existing_s3 = trueSkip, don't create
  • existing_s3 = falseCreate new

preflight-check.ps1 automatically checks and updates this flag.

Outputs

NameDescription
bucket_arnsMap of bucket name → ARN
bucket_regional_domain_namesMap of bucket name → regional domain