Coder Social home page Coder Social logo

aws_s3's Introduction

aws_s3

Terraform module that creates an AWS S3.

Inputs

module "aws_s3" {
  source = "../modules/aws_s3"
  
  bucket = #Name of the bucket. If omitted, Terraform will assign a random, unique name
  acl    = #Canned ACL to apply to the bucket.

  index_document = {
    suffix = # Suffix that is appended to a request that is for a directory on the website endpoint.
  }

  error_document = {
    key = # Object key name to use when a 4XX class error occurs.
  }

  rule = {
    bucket_key_enabled = # Whether or not to use Amazon S3 Bucket Keys for SSE-KMS
    apply_server_side_encryption_by_default = {
      sse_algorithm = # Server-side encryption algorithm to use. Valid values are AES256 and aws:kms
    }
  }
}

Example

module "aws_s3" {
  source = "../modules/aws_s3"
  
  bucket = "bucket-example"
  acl    = "public-read"

  index_document = {
    suffix = "index.html"
  }

  error_document = {
    key = "error.html"
  }

  rule = {
    bucket_key_enabled = "sni-only"
    apply_server_side_encryption_by_default = {
      sse_algorithm = "TLSv1.2_2021"
    }
  }
}

Outputs

output "bucket_id" {
  value = aws_s3_bucket.bucket.id # Name of the bucket
}

output "bucket_domain_name" {
  value = aws_s3_bucket.bucket.bucket_domain_name # Bucket domain name. Will be of format bucketname.s3.amazonaws.com
}

aws_s3's People

Watchers

Marcus Mesquita avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.