From 116a1fd4ab5a3735bf4b5ca02145e48abbc1174e Mon Sep 17 00:00:00 2001 From: Kerim Satirli Date: Mon, 30 Sep 2019 10:41:37 +0200 Subject: [PATCH] Update to HCL 2.0 (#1) * requires TF 0.12, AWS Provider >2.10.0, Template Provier > 1.0.0 * adds examples for `simple`, `complex`, `logging`, `versioning`, `website`, SSE, and Object-lock configurations --- README.md | 121 +++++++++++++++ examples/complex/README.md | 68 +++++++++ examples/complex/main.tf | 39 +++++ examples/logging/README.md | 47 ++++++ examples/logging/main.tf | 18 +++ examples/object-lock-configuration/README.md | 45 ++++++ examples/object-lock-configuration/main.tf | 17 +++ examples/server-side-encryption/README.md | 39 +++++ examples/server-side-encryption/main.tf | 11 ++ examples/simple/README.md | 42 ++++++ examples/simple/main.tf | 14 ++ examples/versioning/README.md | 39 +++++ examples/versioning/main.tf | 11 ++ examples/website/README.md | 58 +++++++ examples/website/main.tf | 30 ++++ files/README.tpl.md | 5 + locals.tf | 18 +++ main.tf | 150 +++++++++++++++++++ outputs.tf | 90 +++++++++++ script/bootstrap | 21 +++ script/setup | 19 +++ script/test | 10 ++ terraform.tf | 8 + variables.tf | 114 ++++++++++++++ 24 files changed, 1034 insertions(+) create mode 100644 README.md create mode 100644 examples/complex/README.md create mode 100644 examples/complex/main.tf create mode 100644 examples/logging/README.md create mode 100644 examples/logging/main.tf create mode 100644 examples/object-lock-configuration/README.md create mode 100644 examples/object-lock-configuration/main.tf create mode 100644 examples/server-side-encryption/README.md create mode 100644 examples/server-side-encryption/main.tf create mode 100644 examples/simple/README.md create mode 100644 examples/simple/main.tf create mode 100644 examples/versioning/README.md create mode 100644 examples/versioning/main.tf create mode 100644 examples/website/README.md create mode 100644 examples/website/main.tf create mode 100644 files/README.tpl.md create mode 100644 locals.tf create mode 100644 main.tf create mode 100644 outputs.tf create mode 100755 script/bootstrap create mode 100755 script/setup create mode 100755 script/test create mode 100644 terraform.tf create mode 100644 variables.tf diff --git a/README.md b/README.md new file mode 100644 index 0000000..ced2d32 --- /dev/null +++ b/README.md @@ -0,0 +1,121 @@ +# Terraform Module: AWS S3 Bucket DNS Records + +> This repository is a [Terraform](https://terraform.io/) Module for managing AWS [S3 Bucket](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) for AWS S3 Buckets. + +## Table of Contents + +- [Terraform Module: AWS S3 Bucket DNS Records](#terraform-module-aws-s3-bucket-dns-records) + - [Table of Contents](#table-of-contents) + - [Requirements](#requirements) + - [Dependencies](#dependencies) + - [Usage](#usage) + - [Module Variables](#module-variables) + - [Module Outputs](#module-outputs) + - [Author Information](#author-information) + - [License](#license) + +## Requirements + +This module requires Terraform version `0.12.0` or newer. + +## Dependencies + +This module depends on a correctly configured [AWS Provider](https://www.terraform.io/docs/providers/aws/index.html) in your Terraform codebase. + +## Usage + +Add the module to your Terraform resources like so: + +```hcl +module "simple-example" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + + name = "oh-demo-simple-example" + + tags = { + Department = "Operations" + } + + force_destroy = true + + create_readme = false +} +``` + +Then, fetch the module from the [Terraform Registry](https://registry.terraform.io/modules/operatehappy/s3-bucket) using `terraform get`. + +Additional usage examples are avaialble in the `examples` directory via [GitHub](https://github.com/operatehappy/terraform-aws-s3-bucket/tree/master/examples). + +### Module Variables + +Available variables are listed below, along with their default values: + +| variable | type | description | default | +|----------------------------------------|---------------|--------------------------------------------------------------------------------------|-----------------| +| `name` | `string` | Name of S3 Bucket | | +| `use_prefix` | `bool` | Toggle to use randomly-generated Prefix for Bucket Name | `false` | +| `acl` | `string` | Canned ACL of S3 Bucket | `"private"` | +| `policy` | `string` | Policy (JSON) Document of S3 Bucket | `null` | +| `use_default_tags` | `bool` | Toggle to enable creation of default tags, containing Terraform Workspace identifier | `true` | +| `tags` | `map` | Mapping of Tags of S3 Bucket | `{}` | +| `force_destroy` | `bool` | Toggle to enable force-destruction of S3 Bucket | `false` | +| `website` | `map(string)` | Map of Website configuration of S3 Bucket | `{}` | +| `cors_rule` | `any` | Map of CORS Rules of S3 Bucket | `{}` | +| `versioning` | `map(string)` | Map of Versionining configuration of S3 Bucket | `{}` | +| `logging` | `map(string)` | Map of Logging configuration of S3 Bucket | `{}` | +| `lifecycle_rule` | `list` | Map of Lifecycle Rule configuration of S3 Bucket | `[]` | +| `acceleration_status` | `string` | Acceleration Status of S3 Bucket | `"Suspended"` | +| `request_payer` | `string` | Identifier for Request Cost-allocation of S3 Bucket | `"BucketOwner"` | +| `region` | `string` | Region of S3 Bucket | `null` | +| `server_side_encryption_configuration` | `map` | Server-side Encryption (SSE) Configuration of S3 Bucket | `{}` | +| `object_lock_configuration` | `any` | Object-lock Configuration of S3 Bucket | `{}` | +| `create_readme` | `bool` | Toggle creation of `README.md` in root of S3 Bucket | `true` | +| `readme_additions` | `string` | Additional content (e.g.: information, instructions) to add to README.md | `""` | + +Additionally, the following variables are generated as [locals](https://www.terraform.io/docs/configuration/locals.html): + +| key | value | +|-----------------|---------------------------------------------------------------------| +| `default_tags` | default tags containing Terraform Workspace identifier | +| `merged_tags` | merged value of `var.tags` and `local.default_tags` _or_ `var.tags` | +| `name` | value of `var.name` or `null` | +| `bucket_prefix` | value of `var.name` or `null` | + +### Module Outputs + +Available outputs are listed below, along with their description + +| output | description | +|-------------------------------|----------------------------------------------| +| `id` | Name of the Bucket | +| `arn` | ARN of the Bucket | +| `bucket_domain_name` | Domain name of the Bucket | +| `bucket_regional_domain_name` | Region-specific domain name of the Bucket | +| `hosted_zone_id` | Hosted Zone ID of the Bucket's Region | +| `region` | Region of the Bucket | +| `website_endpoint` | Website Endpoint of the Bucket | +| `website_domain` | Domain of the Website Endpoint of the Bucket | +| `readme_id` | Key of the README file | +| `readme_etag` | ETag of the README file | +| `readme_version_id` | Version ID of the README file | + +## Author Information + +This module is currently maintained by the individuals listed below. + +- [Kerim Satirli](https://github.com/ksatirli) + +Development of this module was sponsored by [Operate Happy](https://github.com/operatehappy). + +## License + +Copyright 2019 [Kerim Satirli](https://github.com/ksatirli) + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. + +You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an _"AS IS"_ basis, without WARRANTIES or conditions of any kind, either express or implied. + +See the License for the specific language governing permissions and limitations under the License. diff --git a/examples/complex/README.md b/examples/complex/README.md new file mode 100644 index 0000000..185f7c6 --- /dev/null +++ b/examples/complex/README.md @@ -0,0 +1,68 @@ +# Example: `complex` + +> This is an example of a _complex_ configuration of the [terraform-aws-s3-bucket Module](https://registry.terraform.io/modules/operatehappy/s3-bucket/) + +## Table of Contents + +- [Example: `complex`](#example-complex) + - [Table of Contents](#table-of-contents) + - [Installation](#installation) + - [Usage](#usage) + - [Module Variables and Outputs](#module-variables-and-outputs) + +## Installation + +For a list of installation instructions, see the [Readme document](https://registry.terraform.io/modules/operatehappy/s3-bucket/) on the Terraform Registry. + +## Usage + +A _complex_ configuration of the `terraform-aws-s3-bucket` Module could look like this: + +```hcl +// create S3 Bucket to be used as logging target +module "complex-example-target" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + name = "oh-demos-complex-example-target" + acl = "log-delivery-write" + + server_side_encryption_configuration = [{ + kms_master_key_id = "alias/oh-demos" + sse_algorithm = "aws:kms" + }] +} + +module "complex-example" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + + name = "oh-demos-complex-example" + + tags = { + Department = "Operations" + } + + force_destroy = true + + versioning = [{ + enabled = true + mfa_delete = false + }] + + logging = [{ + target_bucket = module.complex-example-target.id + target_prefix = "logs" + }] + + server_side_encryption_configuration = [{ + kms_master_key_id = "alias/oh-demos" + sse_algorithm = "aws:kms" + }] +} +``` + +## Module Variables and Outputs + +For a list of available variables and outputs, see the [Readme document](https://registry.terraform.io/modules/operatehappy/s3-bucket/) on the Terraform Registry. + +A copy of this document (as `README.md`) is also available on [GitHub](https://github.com/operatehappy/terraform-aws-s3-bucket/blob/master/README.md#readme). diff --git a/examples/complex/main.tf b/examples/complex/main.tf new file mode 100644 index 0000000..5f972f7 --- /dev/null +++ b/examples/complex/main.tf @@ -0,0 +1,39 @@ +module "complex-example-target" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + name = "oh-demos-complex-example-target" + acl = "log-delivery-write" + + server_side_encryption_configuration = [{ + kms_master_key_id = "alias/oh-demos" + sse_algorithm = "aws:kms" + }] +} + +module "complex-example" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + + name = "oh-demos-complex-example" + + tags = { + Department = "Operations" + } + + force_destroy = true + + versioning = [{ + enabled = true + mfa_delete = false + }] + + logging = [{ + target_bucket = module.complex-example-target.id + target_prefix = "logs" + }] + + server_side_encryption_configuration = [{ + kms_master_key_id = "alias/oh-demos" + sse_algorithm = "aws:kms" + }] +} diff --git a/examples/logging/README.md b/examples/logging/README.md new file mode 100644 index 0000000..8b29d20 --- /dev/null +++ b/examples/logging/README.md @@ -0,0 +1,47 @@ +# Example: `logging` + +> This is an example of a _logging_ configuration of the [terraform-aws-s3-bucket Module](https://registry.terraform.io/modules/operatehappy/s3-bucket/) + +## Table of Contents + +- [Example: `logging`](#example-logging) + - [Table of Contents](#table-of-contents) + - [Installation](#installation) + - [Usage](#usage) + - [Module Variables and Outputs](#module-variables-and-outputs) + +## Installation + +For a list of installation instructions, see the [Readme document](https://registry.terraform.io/modules/operatehappy/s3-bucket/) on the Terraform Registry. + +## Usage + +A _logging_ configuration of the `terraform-aws-s3-bucket` Module could look like this: + +```hcl +// create S3 Bucket to be used as logging target +module "logging-example-target" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + name = "oh-demos-logging-example-target" + acl = "log-delivery-write" +} + +module "logging-example" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + + name = "oh-demos-logging-example" + + logging = { + target_bucket = module.logging-example-target.id + target_prefix = "logs" + } +} +``` + +## Module Variables and Outputs + +For a list of available variables and outputs, see the [Readme document](https://registry.terraform.io/modules/operatehappy/s3-bucket/) on the Terraform Registry. + +A copy of this document (as `README.md`) is also available on [GitHub](https://github.com/operatehappy/terraform-aws-s3-bucket/blob/master/README.md#readme). diff --git a/examples/logging/main.tf b/examples/logging/main.tf new file mode 100644 index 0000000..c3a8970 --- /dev/null +++ b/examples/logging/main.tf @@ -0,0 +1,18 @@ +module "logging-example-target" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + name = "oh-demos-logging-example-target" + acl = "log-delivery-write" +} + +module "logging-example" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + + name = "oh-demos-logging-example" + + logging = { + target_bucket = module.logging-example-target.id + target_prefix = "logs" + } +} diff --git a/examples/object-lock-configuration/README.md b/examples/object-lock-configuration/README.md new file mode 100644 index 0000000..3e4cf81 --- /dev/null +++ b/examples/object-lock-configuration/README.md @@ -0,0 +1,45 @@ +# Example: `object-lock` + +> This is an example of an _object-lock_ configuration of the [terraform-aws-s3-bucket Module](https://registry.terraform.io/modules/operatehappy/s3-bucket/) + +## Table of Contents + +- [Example: `object-lock`](#example-object-lock) + - [Table of Contents](#table-of-contents) + - [Installation](#installation) + - [Usage](#usage) + - [Module Variables and Outputs](#module-variables-and-outputs) + +## Installation + +For a list of installation instructions, see the [Readme document](https://registry.terraform.io/modules/operatehappy/s3-bucket/) on the Terraform Registry. + +## Usage + +An _object-lock_ configuration of the `terraform-aws-s3-bucket` Module could look like this: + +```hcl +module "object-lock-configuration-example" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + + name = "oh-demos-object-lock-configuration-example" + + object_lock_configuration = { + object_lock_enabled = "Enabled" + + rule = { + default_retention = { + mode = "GOVERNANCE" + days = 366 + } + } + } +} +``` + +## Module Variables and Outputs + +For a list of available variables and outputs, see the [Readme document](https://registry.terraform.io/modules/operatehappy/s3-bucket/) on the Terraform Registry. + +A copy of this document (as `README.md`) is also available on [GitHub](https://github.com/operatehappy/terraform-aws-s3-bucket/blob/master/README.md#readme). diff --git a/examples/object-lock-configuration/main.tf b/examples/object-lock-configuration/main.tf new file mode 100644 index 0000000..ab60ac9 --- /dev/null +++ b/examples/object-lock-configuration/main.tf @@ -0,0 +1,17 @@ +module "object-lock-configuration-example" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + + name = "oh-demos-object-lock-configuration-example" + + object_lock_configuration = { + object_lock_enabled = "Enabled" + + rule = { + default_retention = { + mode = "GOVERNANCE" + days = 366 + } + } + } +} diff --git a/examples/server-side-encryption/README.md b/examples/server-side-encryption/README.md new file mode 100644 index 0000000..e42ab90 --- /dev/null +++ b/examples/server-side-encryption/README.md @@ -0,0 +1,39 @@ +# Example: `server-side-encryption` + +> This is an example of a _server-side-encryption_ configuration of the [terraform-aws-s3-bucket Module](https://registry.terraform.io/modules/operatehappy/s3-bucket/) + +## Table of Contents + +- [Example: `server-side-encryption`](#example-server-side-encryption) + - [Table of Contents](#table-of-contents) + - [Installation](#installation) + - [Usage](#usage) + - [Module Variables and Outputs](#module-variables-and-outputs) + +## Installation + +For a list of installation instructions, see the [Readme document](https://registry.terraform.io/modules/operatehappy/s3-bucket/) on the Terraform Registry. + +## Usage + +A _server-side-encryption_ configuration of the `terraform-aws-s3-bucket` Module could look like this: + +```hcl +module "server-side-encryption-example" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + + name = "oh-demos-server-side-encryption-example" + + server_side_encryption_configuration = { + kms_master_key_id = "alias/oh-demos" + sse_algorithm = "aws:kms" + } +} +``` + +## Module Variables and Outputs + +For a list of available variables and outputs, see the [Readme document](https://registry.terraform.io/modules/operatehappy/s3-bucket/) on the Terraform Registry. + +A copy of this document (as `README.md`) is also available on [GitHub](https://github.com/operatehappy/terraform-aws-s3-bucket/blob/master/README.md#readme). diff --git a/examples/server-side-encryption/main.tf b/examples/server-side-encryption/main.tf new file mode 100644 index 0000000..b1eab2e --- /dev/null +++ b/examples/server-side-encryption/main.tf @@ -0,0 +1,11 @@ +module "server-side-encryption-example" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + + name = "oh-demos-server-side-encryption-example" + + server_side_encryption_configuration = { + kms_master_key_id = "alias/oh-demos" + sse_algorithm = "aws:kms" + } +} diff --git a/examples/simple/README.md b/examples/simple/README.md new file mode 100644 index 0000000..f970bf3 --- /dev/null +++ b/examples/simple/README.md @@ -0,0 +1,42 @@ +# Example: `simple` + +> This is an example of a _simple_ configuration of the [terraform-aws-s3-bucket Module](https://registry.terraform.io/modules/operatehappy/s3-bucket/) + +## Table of Contents + +- [Example: `simple`](#example-simple) + - [Table of Contents](#table-of-contents) + - [Installation](#installation) + - [Usage](#usage) + - [Module Variables and Outputs](#module-variables-and-outputs) + +## Installation + +For a list of installation instructions, see the [Readme document](https://registry.terraform.io/modules/operatehappy/s3-bucket/) on the Terraform Registry. + +## Usage + +A _simple_ configuration of the `terraform-aws-s3-bucket` Module could look like this: + +```hcl +module "simple-example" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + + name = "oh-demo-simple-example" + + tags = { + Department = "Operations" + } + + force_destroy = true + + create_readme = false +} +``` + +## Module Variables and Outputs + +For a list of available variables and outputs, see the [Readme document](https://registry.terraform.io/modules/operatehappy/s3-bucket/) on the Terraform Registry. + +A copy of this document (as `README.md`) is also available on [GitHub](https://github.com/operatehappy/terraform-aws-s3-bucket/blob/master/README.md#readme). diff --git a/examples/simple/main.tf b/examples/simple/main.tf new file mode 100644 index 0000000..a120682 --- /dev/null +++ b/examples/simple/main.tf @@ -0,0 +1,14 @@ +module "simple-example" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + + name = "oh-demos-simple-example" + + tags = { + Department = "Operations" + } + + force_destroy = true + + create_readme = false +} diff --git a/examples/versioning/README.md b/examples/versioning/README.md new file mode 100644 index 0000000..13564b3 --- /dev/null +++ b/examples/versioning/README.md @@ -0,0 +1,39 @@ +# Example: `versioning` + +> This is an example of a _versioning_ configuration of the [terraform-aws-s3-bucket Module](https://registry.terraform.io/modules/operatehappy/s3-bucket/) + +## Table of Contents + +- [Example: `versioning`](#example-versioning) + - [Table of Contents](#table-of-contents) + - [Installation](#installation) + - [Usage](#usage) + - [Module Variables and Outputs](#module-variables-and-outputs) + +## Installation + +For a list of installation instructions, see the [Readme document](https://registry.terraform.io/modules/operatehappy/s3-bucket/) on the Terraform Registry. + +## Usage + +A _versioning_ configuration of the `terraform-aws-s3-bucket` Module could look like this: + +```hcl +module "versioning-example" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + + name = "oh-demos-versioning-example" + + versioning = { + enabled = true + mfa_delete = false + } +} +``` + +## Module Variables and Outputs + +For a list of available variables and outputs, see the [Readme document](https://registry.terraform.io/modules/operatehappy/s3-bucket/) on the Terraform Registry. + +A copy of this document (as `README.md`) is also available on [GitHub](https://github.com/operatehappy/terraform-aws-s3-bucket/blob/master/README.md#readme). diff --git a/examples/versioning/main.tf b/examples/versioning/main.tf new file mode 100644 index 0000000..10726d6 --- /dev/null +++ b/examples/versioning/main.tf @@ -0,0 +1,11 @@ +module "versioning-example" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + + name = "oh-demos-versioning-example" + + versioning = { + enabled = true + mfa_delete = false + } +} diff --git a/examples/website/README.md b/examples/website/README.md new file mode 100644 index 0000000..4580be9 --- /dev/null +++ b/examples/website/README.md @@ -0,0 +1,58 @@ +# Example: `website` + +> This is an example of a _website_ configuration of the [terraform-aws-s3-bucket Module](https://registry.terraform.io/modules/operatehappy/s3-bucket/) + +## Table of Contents + +- [Example: `website`](#example-website) + - [Table of Contents](#table-of-contents) + - [Installation](#installation) + - [Usage](#usage) + - [Module Variables and Outputs](#module-variables-and-outputs) + +## Installation + +For a list of installation instructions, see the [Readme document](https://registry.terraform.io/modules/operatehappy/s3-bucket/) on the Terraform Registry. + +## Usage + +A _website_ configuration of the `terraform-aws-s3-bucket` Module could look like this: + +```hcl +module "website-example" { + source = "operatehappy/s3-bucket/aws" + version = "1.0.0" + + name = "oh-demos-website-example" + + website = [{ + index_document = "index.html" + error_document = "error.html" + routing_rules = < Installing pre-commit with Homebrew..." + brew install pre-commit + fi +fi + +if ls ./*.tf 1> /dev/null 2>&1; then + if ! brew list -1 | grep -q '^terraform$'; then + echo "==> Installing Terraform with Homebrew..." + brew install terraform + fi +fi \ No newline at end of file diff --git a/script/setup b/script/setup new file mode 100755 index 0000000..b31223d --- /dev/null +++ b/script/setup @@ -0,0 +1,19 @@ +#!/bin/sh + +# script/update: Update application to run for its current checkout. + +set -o errexit; set -o nounset + +cd "$(dirname "$0")/.." + +if [ -f ".pre-commit-config.yaml" ]; then + echo "==> Installing pre-commit dependencies..." + pre-commit install +fi + +echo + +if ls ./*.tf 1> /dev/null 2>&1; then + echo "==> Installing Terraform Providers dependencies..." + terraform init +fi \ No newline at end of file diff --git a/script/test b/script/test new file mode 100755 index 0000000..defab8e --- /dev/null +++ b/script/test @@ -0,0 +1,10 @@ +#!/bin/sh + +# script/test: Run test suite for application. + +cd "$(dirname "$0")/.." || exit + +if [ -f ".pre-commit-config.yaml" ]; then + echo "==> Running pre-commit checks..." + pre-commit run --files ./*.* +fi diff --git a/terraform.tf b/terraform.tf new file mode 100644 index 0000000..11046c7 --- /dev/null +++ b/terraform.tf @@ -0,0 +1,8 @@ +terraform { + required_version = ">= 0.12.0" + + required_providers { + aws = "> 2.10.0" + template = "> 1.0.0" + } +} diff --git a/variables.tf b/variables.tf new file mode 100644 index 0000000..ee359e1 --- /dev/null +++ b/variables.tf @@ -0,0 +1,114 @@ +variable "name" { + type = string + description = "Name of S3 Bucket" +} + +variable "use_prefix" { + type = bool + description = "Toggle to use randomly-generated Prefix for Bucket Name" + default = false +} + +variable "acl" { + type = string + description = "Canned ACL of S3 Bucket" + default = "private" +} + +variable "policy" { + type = string + description = "Policy (JSON) Document of S3 Bucket" + default = null +} + +variable "use_default_tags" { + type = bool + description = "Toggle to enable creation of default tags, containing Terraform Workspace identifier" + default = true +} + +variable "tags" { + type = map + description = "Mapping of Tags of S3 Bucket" + default = {} +} + +variable "force_destroy" { + type = bool + description = "Toggle to enable force-destruction of S3 Bucket" + default = false +} + +variable "website" { + type = map(string) + description = "Map of Website configuration of S3 Bucket" + default = {} +} + +variable "cors_rule" { + // NOTE: change to `map(any)` once supported + type = any + description = "Map of CORS Rules of S3 Bucket" + default = {} +} + +variable "versioning" { + type = map(string) + description = "Map of Versionining configuration of S3 Bucket" + default = {} +} + +variable "logging" { + type = map(string) + description = "Map of Logging configuration of S3 Bucket" + default = {} +} + +variable "lifecycle_rule" { + type = list + description = "Map of Lifecycle Rule configuration of S3 Bucket" + default = [] +} + +variable "acceleration_status" { + type = string + description = "Acceleration Status of S3 Bucket" + default = "Suspended" +} + +variable "request_payer" { + type = string + description = "Identifier for Request Cost-allocation of S3 Bucket" + default = "BucketOwner" +} + +variable "region" { + type = string + description = "Region of S3 Bucket" + default = null +} + +variable "server_side_encryption_configuration" { + type = map + description = "Server-side Encryption (SSE) Configuration of S3 Bucket" + default = {} +} + +variable "object_lock_configuration" { + // NOTE: change to `map(any)` once supported + type = any + description = "Object-lock Configuration of S3 Bucket" + default = {} +} + +variable "create_readme" { + type = bool + description = "Toggle creation of `README.md` in root of S3 Bucket" + default = true +} + +variable "readme_additions" { + type = string + description = "Additional content (e.g.: information, instructions) to add to README.md" + default = "" +}