Commit c56f082f authored by Anton Babenko's avatar Anton Babenko

Minor formatting, cleanups, readme

parent dc9864d5
{{ if .Versions -}}
<a name="unreleased"></a>
## [Unreleased]
{{ if .Unreleased.CommitGroups -}}
{{ range .Unreleased.CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{ else }}
{{ range .Unreleased.Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{ end -}}
{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
{{ if .CommitGroups -}}
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{ else }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
{{- if .Versions }}
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
{{ range .Versions -}}
{{ if .Tag.Previous -}}
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
{{ end -}}
{{ end -}}
{{ end -}}
\ No newline at end of file
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/terraform-aws-modules/terraform-aws-s3-bucket
options:
header:
pattern: "^(.*)$"
pattern_maps:
- Subject
# EditorConfig is awesome: http://EditorConfig.org
# Uses editorconfig to maintain consistent coding styles
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true
[*.{tf,tfvars}]
indent_size = 2
indent_style = space
[*.md]
max_line_length = 0
trim_trailing_whitespace = false
[Makefile]
tab_width = 2
indent_style = tab
[COMMIT_EDITMSG]
max_line_length = 0
\ No newline at end of file
# Created by https://www.gitignore.io/api/terraform
# Edit at https://www.gitignore.io/?templates=terraform
### Terraform ###
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
# Crash log files
crash.log
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
# .tfvars files are managed as part of configuration and so should be included in
# version control.
#
# example.tfvars
# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json
# Include override files you do wish to add to version control using negated pattern
#
# !example_override.tf
# End of https://www.gitignore.io/api/terraform
.terraform
terraform.tfstate
*.tfstate*
terraform.tfvars
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.17.0
hooks:
- id: terraform_fmt
- id: terraform_docs
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
hooks:
- id: check-merge-conflict
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
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.
.PHONY: changelog release
changelog:
git-chglog -o CHANGELOG.md --next-tag `semtag final -s minor -o`
release:
semtag final -s minor
This diff is collapsed.
......@@ -4,7 +4,7 @@ variable "region" {
# Configure the AWS Provider
provider "aws" {
region = var.region
region = var.region
}
// Calling module:
......@@ -14,20 +14,20 @@ module "aws_s3_bucket" {
bucket = "s3-tf-example-cors"
acl = "private"
cors_rule_inputs =[
cors_rule_inputs = [
{
allowed_headers = ["*"]
allowed_methods = ["PUT","POST"]
allowed_origins = ["https://s3-website-test.hashicorp.com","https://s3-website-test.hashicorp.io"]
expose_headers = ["ETag"]
max_age_seconds = 3000
allowed_headers = ["*"]
allowed_methods = ["PUT", "POST"]
allowed_origins = ["https://s3-website-test.hashicorp.com", "https://s3-website-test.hashicorp.io"]
expose_headers = ["ETag"]
max_age_seconds = 3000
},
{
allowed_headers = ["*"]
allowed_methods = ["GET"]
allowed_origins = ["https://s3-website-test.hashicorp.io"]
expose_headers = ["ETag"]
max_age_seconds = 3000
allowed_headers = ["*"]
allowed_methods = ["GET"]
allowed_origins = ["https://s3-website-test.hashicorp.io"]
expose_headers = ["ETag"]
max_age_seconds = 3000
},
]
......
......@@ -4,7 +4,7 @@ variable "region" {
# Configure the AWS Provider
provider "aws" {
region = var.region
region = var.region
}
// Calling module:
......@@ -15,9 +15,9 @@ module "aws_s3_bucket" {
acl = "private"
lifecycle_rule_inputs = [{
id = "log"
enabled = true
prefix = "log/"
id = "log"
enabled = true
prefix = "log/"
abort_incomplete_multipart_upload_days = null
tags = {
"rule" = "log"
......@@ -25,43 +25,43 @@ module "aws_s3_bucket" {
}
expiration_inputs = [{
days = 90
date = null
days = 90
date = null
expired_object_delete_marker = null
},
]
transition_inputs = []
]
transition_inputs = []
noncurrent_version_transition_inputs = []
noncurrent_version_expiration_inputs = []
},
{
id = "log1"
enabled = true
prefix = "log1/"
abort_incomplete_multipart_upload_days = null
tags = {
"rule" = "log1"
"autoclean" = "true"
}
},
{
id = "log1"
enabled = true
prefix = "log1/"
abort_incomplete_multipart_upload_days = null
tags = {
"rule" = "log1"
"autoclean" = "true"
}
expiration_inputs = []
transition_inputs = []
noncurrent_version_transition_inputs = [
{
days = 30
storage_class = "STANDARD_IA"
},
{
days = 60
storage_class = "ONEZONE_IA"
},
{
days = 90
storage_class = "GLACIER"
},
]
noncurrent_version_expiration_inputs = []
expiration_inputs = []
transition_inputs = []
noncurrent_version_transition_inputs = [
{
days = 30
storage_class = "STANDARD_IA"
},
{
days = 60
storage_class = "ONEZONE_IA"
},
{
days = 90
storage_class = "GLACIER"
},
]
noncurrent_version_expiration_inputs = []
},
]
]
}
\ No newline at end of file
......@@ -4,13 +4,13 @@ variable "region" {
# Configure the AWS Provider
provider "aws" {
region = var.region
region = var.region
}
// Calling module:
module "log_bucket" {
source = "../.."
source = "../.."
bucket = "s3-tf-example-logger"
acl = "log-delivery-write"
......@@ -23,10 +23,10 @@ module "aws_s3_bucket" {
acl = "private"
logging_inputs = [
{
target_bucket = "s3-tf-example-logger"
target_prefix = "log/"
},
{
target_bucket = "s3-tf-example-logger"
target_prefix = "log/"
},
]
}
......@@ -4,45 +4,45 @@ variable "region" {
# Configure the AWS Provider
provider "aws" {
region = var.region
region = var.region
}
module "bucket" {
source = "../.."
bucket = "s3-tf-example-replication"
acl = "private"
bucket = "s3-tf-example-replication"
acl = "private"
versioning_inputs = [
{
enabled = true
mfa_delete = null
},
enabled = true
mfa_delete = null
},
]
replication_configuration_inputs = [
{
role = "<ROLE_ARN>" // Place the IAM Role to access the destination bucket
role = "<ROLE_ARN>" // Place the IAM Role to access the destination bucket
rules_inputs = [
{
id = "foobar"
prefix = "foo"
status = "Enabled"
priority = null
source_selection_criteria_inputs = null
filter_inputs = null
destination_inputs = [
rules_inputs = [
{
bucket = "<DESTINATION_BUCKET>" // Place the destination bicket ARN
storage_class = "STANDARD"
replica_kms_key_id = null
account_id = null
access_control_translation_inputs = null
id = "foobar"
prefix = "foo"
status = "Enabled"
priority = null
source_selection_criteria_inputs = null
filter_inputs = null
destination_inputs = [
{
bucket = "<DESTINATION_BUCKET>" // Place the destination bicket ARN
storage_class = "STANDARD"
replica_kms_key_id = null
account_id = null
access_control_translation_inputs = null
},
]
},
]
},
]
},
]
}
......@@ -4,7 +4,7 @@ variable "region" {
# Configure the AWS Provider
provider "aws" {
region = var.region
region = var.region
}
// Calling module:
......@@ -14,12 +14,12 @@ module "aws_s3_bucket" {
bucket = "s3-tf-example-versioning"
acl = "private"
versioning_inputs = [
{
enabled = true
mfa_delete = null
},
]
versioning_inputs = [
{
enabled = true
mfa_delete = null
},
]
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ variable "region" {
# Configure the AWS Provider
provider "aws" {
region = var.region
region = var.region
}
// Calling module:
......@@ -14,12 +14,12 @@ module "aws_s3_bucket" {
bucket = "s3-tf-example-website"
acl = "private"
website_inputs = [
{
index_document = "index.html"
error_document = "error.html"
redirect_all_requests_to = null
routing_rules = <<EOF
website_inputs = [
{
index_document = "index.html"
error_document = "error.html"
redirect_all_requests_to = null
routing_rules = <<EOF
[{
"Condition": {
"KeyPrefixEquals": "docs/"
......@@ -29,8 +29,8 @@ website_inputs = [
}
}]
EOF
}
]
}
]
}
\ No newline at end of file
This diff is collapsed.
output "id" {
description = "The name of the bucket."
value = "${element(concat(aws_s3_bucket.this.*.id, list("")), 0)}"
description = "The name of the bucket."
value = element(concat(aws_s3_bucket.this.*.id, list("")), 0)
}
output "arn" {
description = "The ARN of the bucket. Will be of format arn:aws:s3:::bucketname."
value = "${element(concat(aws_s3_bucket.this.*.arn, list("")), 0)}"
description = "The ARN of the bucket. Will be of format arn:aws:s3:::bucketname."
value = element(concat(aws_s3_bucket.this.*.arn, list("")), 0)
}
output "bucket_domain_name" {
description = "The bucket domain name. Will be of format bucketname.s3.amazonaws.com."
value = "${element(concat(aws_s3_bucket.this.*.bucket_domain_name, list("")), 0)}"
description = "The bucket domain name. Will be of format bucketname.s3.amazonaws.com."
value = element(concat(aws_s3_bucket.this.*.bucket_domain_name, list("")), 0)
}
output "bucket_regional_domain_name" {
description = "The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL."
value = "${element(concat(aws_s3_bucket.this.*.bucket_regional_domain_name, list("")), 0)}"
description = "The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL."
value = element(concat(aws_s3_bucket.this.*.bucket_regional_domain_name, list("")), 0)
}
output "hosted_zone_id" {
description = "The Route 53 Hosted Zone ID for this bucket's region."
value = "${element(concat(aws_s3_bucket.this.*.hosted_zone_id, list("")), 0)}"
description = "The Route 53 Hosted Zone ID for this bucket's region."
value = element(concat(aws_s3_bucket.this.*.hosted_zone_id, list("")), 0)
}
output "region" {
description = "The AWS region this bucket resides in."
value = "${element(concat(aws_s3_bucket.this.*.region, list("")), 0)}"
description = "The AWS region this bucket resides in."
value = element(concat(aws_s3_bucket.this.*.region, list("")), 0)
}
output "website_endpoint" {
description = "The website endpoint, if the bucket is configured with a website. If not, this will be an empty string."
value = "${element(concat(aws_s3_bucket.this.*.website_endpoint, list("")), 0)}"
description = "The website endpoint, if the bucket is configured with a website. If not, this will be an empty string."
value = element(concat(aws_s3_bucket.this.*.website_endpoint, list("")), 0)
}
output "website_domain" {
description = "The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. "
value = "${element(concat(aws_s3_bucket.this.*.website_domain, list("")), 0)}"
}
\ No newline at end of file
description = "The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. "
value = element(concat(aws_s3_bucket.this.*.website_domain, list("")), 0)
}
variable "bucket" {
description = "(Optional, Forces new resource) The name of the bucket. If omitted, Terraform will assign a random, unique name."
default = null
description = "(Optional, Forces new resource) The name of the bucket. If omitted, Terraform will assign a random, unique name."
default = null
}
variable "bucket_prefix" {
description = "(Optional, Forces new resource) Creates a unique bucket name beginning with the specified prefix. Conflicts with bucket."
default = null
description = "(Optional, Forces new resource) Creates a unique bucket name beginning with the specified prefix. Conflicts with bucket."
default = null
}
variable "acl" {
description = "(Optional) The canned ACL to apply. Defaults to 'private'."
default = "private"
description = "(Optional) The canned ACL to apply. Defaults to 'private'."
default = "private"
}
variable "policy" {
description = "(Optional) A valid bucket policy JSON document. Note that if the policy document is not specific enough (but still valid), Terraform may view the policy as constantly changing in a terraform plan. In this case, please make sure you use the verbose/specific version of the policy. For more information about building AWS IAM policy documents with Terraform, see the AWS IAM Policy Document Guide."
default = null
description = "(Optional) A valid bucket policy JSON document. Note that if the policy document is not specific enough (but still valid), Terraform may view the policy as constantly changing in a terraform plan. In this case, please make sure you use the verbose/specific version of the policy. For more information about building AWS IAM policy documents with Terraform, see the AWS IAM Policy Document Guide."
default = null
}
variable "tags" {
description = "(Optional) A mapping of tags to assign to the bucket."
default = {}
description = "(Optional) A mapping of tags to assign to the bucket."
default = {}
}
variable "force_destroy" {
description = "(Optional, Default:false ) A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable."
default = false
description = "(Optional, Default:false ) A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable."
default = false
}
variable "acceleration_status" {
description = "(Optional) Sets the accelerate configuration of an existing bucket. Can be Enabled or Suspended."
default = null
description = "(Optional) Sets the accelerate configuration of an existing bucket. Can be Enabled or Suspended."
default = null
}
variable "region" {
description = "(Optional) If specified, the AWS region this bucket should reside in. Otherwise, the region used by the callee."
default = null
description = "(Optional) If specified, the AWS region this bucket should reside in. Otherwise, the region used by the callee."
default = null
}
variable "request_payer" {
description = "(Optional) Specifies who should bear the cost of Amazon S3 data transfer. Can be either BucketOwner or Requester. By default, the owner of the S3 bucket would incur the costs of any data transfer. See Requester Pays Buckets developer guide for more information."
default = null
description = "(Optional) Specifies who should bear the cost of Amazon S3 data transfer. Can be either BucketOwner or Requester. By default, the owner of the S3 bucket would incur the costs of any data transfer. See Requester Pays Buckets developer guide for more information."
default = null
}
variable "website_inputs" {
type = list(object({
index_document = string
error_document = string
redirect_all_requests_to = string
routing_rules = string
}))
default = null
type = list(object({
index_document = string
error_document = string
redirect_all_requests_to = string
routing_rules = string
}))
default = null
}
variable "cors_rule_inputs" {
type = list(object({
allowed_headers = list(string)
allowed_methods = list(string)
allowed_origins = list(string)
expose_headers = list(string)
max_age_seconds = number
}))
default = null
type = list(object({
allowed_headers = list(string)
allowed_methods = list(string)
allowed_origins = list(string)
expose_headers = list(string)
max_age_seconds = number
}))
default = null
}
variable "versioning_inputs" {
type = list(object({
enabled = string
mfa_delete = string
}))
default = null
type = list(object({
enabled = string
mfa_delete = string
}))
default = null
}
variable "logging_inputs" {
type = list(object({
target_bucket = string
target_prefix = string
}))
default = null
type = list(object({
target_bucket = string
target_prefix = string
}))
default = null
}
// Lifecycle rules variables:
variable "lifecycle_rule_inputs" {
type = list(object({
id = string
prefix = string
tags = map(string)
enabled = string
abort_incomplete_multipart_upload_days = string
expiration_inputs = list(object({
date = string
days = number
expired_object_delete_marker = string
}))
transition_inputs = list(object({
date = string
days = number
storage_class = string
}))
noncurrent_version_transition_inputs = list(object({
days = number
storage_class = string
}))
noncurrent_version_expiration_inputs = list(object({
days = number
}))
type = list(object({
id = string
prefix = string
tags = map(string)
enabled = string
abort_incomplete_multipart_upload_days = string
expiration_inputs = list(object({
date = string
days = number
expired_object_delete_marker = string
}))
default = null
transition_inputs = list(object({
date = string
days = number
storage_class = string
}))
noncurrent_version_transition_inputs = list(object({
days = number
storage_class = string
}))
noncurrent_version_expiration_inputs = list(object({
days = number
}))
}))
default = null
}
// Replication configuration variables:
variable "replication_configuration_inputs" {
type = list(object({
role = string
rules_inputs = list(object({
id = string
type = list(object({
role = string
rules_inputs = list(object({
id = string
// priority = number
prefix = string
status = string
destination_inputs = list(object({
bucket = string
storage_class = string
replica_kms_key_id = string
account_id = string
access_control_translation_inputs = list(object({
owner = string
}))
}))
source_selection_criteria_inputs = list(object({
enabled = string
prefix = string
status = string
destination_inputs = list(object({
bucket = string
storage_class = string
replica_kms_key_id = string
account_id = string
access_control_translation_inputs = list(object({
owner = string
}))
}))
source_selection_criteria_inputs = list(object({
enabled = string
}))
/* filter_inputs = list(object({
prefix = string
tags = map(string)
}))
*/
}))
*/
}))
default = null
}))
default = null
}
// Server side encryption config:
variable "server_side_encryption_configuration_inputs" {
type = list(object({
sse_algorithm = string
kms_master_key_id = string
}))
default = null
type = list(object({
sse_algorithm = string
kms_master_key_id = string
}))
default = null
}
//Object lock config
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment