Simple Storage Service (S3) Terraform Module
Terraform module to provision Simple Storage Service Service
on AWS.
Usage
Simple setup
Create a simple S3 bucket with default configurations.
module "s3" {
source = "app.terraform.io/ncodelibrary/s3-bucket/aws"
version = "0.1.2"
identifier = "example"
tags = {
Owner = "sysops"
env = "dev"
Cost_Center = "XYZ"
}
}
For more details on a working example, please visit examples/simple
Advanced Setup
If you want to create S3 bucket with enhanced configuration e.g ACLs , force_destory etc. and also objects inside, you can use the module like this:
module "s3" {
source = "app.terraform.io/ncodelibrary/s3-bucket/aws"
version = "0.1.2"
identifier = "example"
tags = {
Owner = "sysops"
env = "dev"
Cost_Center = "XYZ"
}
force_destroy = "true"
acl = "public-read"
}
module "file" {
source = "app.terraform.io/ncodelibrary/s3-bucket/aws//modules/s3-object?ref=v0.1.1"
version = "0.1.2"
file_source = "utils/file.txt"
bucket = module.s3.output.bucket.id
tags = {
Owner = "sysops"
env = "dev"
Cost_Center = "XYZ"
}
key = "file.txt"
}
For more options refer to a working example at examples/advanced
Examples
Here are some working examples of using this module:
Requirements
Name | Version |
---|---|
terraform | >= 0.12 |
Providers
Name | Version |
---|---|
aws | n/a |
Modules
No Modules.
Resources
Name |
---|
aws_s3_bucket |
Inputs
Name | Description | Type | Default | Required |
---|---|---|---|---|
acl | The canned ACL to apply | string |
"private" |
no |
append_workspace | Appends the terraform workspace at the end of resource names, |
bool |
true |
no |
force_destroy | A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error | bool |
false |
no |
identifier | The name of the security group | string |
n/a | yes |
tags | Tags to be applied to the resource | map |
{} |
no |
Outputs
Name | Description |
---|---|
output | n/a |
Contributing
If you want to contribute to this repository check all the guidelines specified here before submitting a new PR.