Skip to content

devopswhizz/terraform-aws-s3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform module to create S3 bucket on AWS

Software License Donate

Example of Bucket with only private access

module "s3_bucket" {
    source         = "[email protected]:devopswhizz/terraform-aws-s3.git"
    s3_name        = "${var.s3_name}"
    aws_account_id = "${var.aws_account_id}"
    aws_username   = "${var.aws_username}"
    versioning     = "${var.versioning}"

    tags = {
        ManagedBy   = "Terraform"
        Environment = "stage"
        Project     = "DevOpsWhizz"
    }
}

Example of Bucket with read public access

module "s3_bucket" {
    source         = "[email protected]:devopswhizz/terraform-aws-s3.git"
    s3_name        = "${var.s3_name}"
    aws_account_id = "${var.aws_account_id}"
    aws_username   = "${var.aws_username}"
    versioning     = "${var.versioning}"
    allow_public   = "true"

    tags = {
        ManagedBy   = "Terraform"
        Environment = "stage"
        Project     = "DevOpsWhizz"
    }
}

Inputs

Name Description Type Default Required
allow_public Allow public read access to bucket string false no
aws_account_id AWS Account Id string - yes
aws_username AWS Username string - yes
create_bucket Conditionally create S3 bucket string true no
loggingBucket The bucket you want to log S3 access to. string `` no
s3_name Name for s3 bucket string - yes
tags A mapping of tags to assign to bucket map <map> no
versioning Enable Versioning of S3 string false no

👬 Contribution

  • Open pull request with improvements

  • Discuss ideas in issues

  • Reach out with any feedback Twitter URL