terraform-aws-s3-artifacts

AWS S3 Terraform State Output

Terraform module for an tiered storage S3 bucket with eventual object expiration. Primary use key is for a build artifacts storage.

These types of resources are supported:

Usage

module "build_artifacts" {
  source = "git::https://gitlab.com/infraprints/modules/aws/s3-artifacts"

  bucket                   = "infraprints-s3-artifacts"
  standard_transition_days = 10
  glacier_transition_days  = 30
  expiration_days          = 365

  tags = {
    Longevity  = "Yearly"
    Expiration = "True"
  }
}

Examples

Notes

  • With the default configuration, all objects in the S3 bucket will expire in 90 days.
  • The S3 bucket uses tiered storage with eventual expiration. This bucket is not designed for long term persistence.

Inputs

NameDescriptionTypeDefaultRequired
bucketThe name of the bucket.stringn/ayes
expiration_daysNumber of days until objects are expunged.string"90"no
force_destroyA boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable.string"false"no
glacier_transition_daysNumber of days until objects are transitioned to the GLACIER storage class.string"60"no
regionIf specified, the AWS region this bucket should reside in. Otherwise, the region used by the callee.string""no
standard_transition_daysNumber of days until objects are transitioned to the STANDARD_IA storage class.string"30"no
tagsA mapping of tags to assign to the bucket.map<map>no

Outputs

NameDescription
arnThe ARN of the bucket. Will be of format arn:aws:s3:::bucketname.
bucketThe name of the bucket.
bucket_domain_nameThe bucket domain name. Will be of format bucketname.s3.amazonaws.com.
idThe name of the bucket.
regionThe AWS region this bucket resides in.