8000 GitHub - diego1277/terraform-module-s3
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

diego1277/terraform-module-s3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform S3 module

Requirements

Binary version v1.3.2

Providers

Name Version
aws 4.33.0

How to

Set default configuration

module "s3" {
   source = "github.com/diego1277/terraform-module-s3"
   bucket_name = "s3-dso-terraform"
}

Enable CORS

module "s3" {
   source = "github.com/diego1277/terraform-module-s3"
   bucket_name = "s3-dso-terraform"
   cors_rules = {
     rule1 = {
       allowed_headers=["*"],
       allowed_methods=["GET"],
       allowed_origins=["https://mycustomdomain.com.br"]
     }
  }
}

Enable bucket lifecycle

module "s3" {
   source = "github.com/diego1277/terraform-module-s3"
   bucket_name = "s3-dso-terraform"
   bucket_object = {
     tmp = {
       name = "tmp"
       acl = "private"
     }
   }
   lifecycle_config = {
     rule1 = {
       id = "tmp",
       prefix = "tmp/",
       status = "Enabled"
       expiration_days = 120
    }
  }
}

Enable bucket lifecycle with transition

module "s3" {
   source = "github.com/diego1277/terraform-module-s3"
   bucket_name = "s3-dso-terraform"
   bucket_object = {
     tmp = {
       name = "tmp"
       acl = "private"
     }
   }
   lifecycle_config = {
     rule1 = {
       id = "tmp",
       prefix = "tmp/",
       status = "Enabled"
       expiration_days = 120
       transition = [{storage_class="STANDARD_IA",days=40},{storage_class="GLACIER",days=80}]
    }
  }
}

Inputs

Name Description Type Default Required
additional_tags additional tags map(any) {} no
bucket_name bucket name string n/a yes
bucket_object bucket objects map(object({name=string,acl=string})) {} no
cors_rules core rules configs map(object({allowed_headers=list(string),allowed_methods=list(string),allowed_origins=list(string)})) {} no
enable_cors_rules enable cors rules bool false no
lifecycle_config bucket lifecycle configs
map(object({id=string,prefix=string,status=string,expiration_days=optional(number,90)
transition=optional(list(object({days=number,storage_class=string})),[])}))
{} no
security default de secutiry string "private" no
versioning bucket versioning bool false no

Outputs

No output.

Author:

  • Diego Oliveira

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

0