File tree Expand file tree Collapse file tree 10 files changed +131
-1
lines changed
Expand file tree Collapse file tree 10 files changed +131
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ indent_style = space
2020max_line_length = off
2121
2222[* .md ]
23- max_line_length = 0
23+ max_line_length = off
2424trim_trailing_whitespace = false
2525
2626[* .yml ]
Original file line number Diff line number Diff line change 2828 format : ' table'
2929 exit-code : ' 1'
3030 hide-progress : false
31+ skip-dirs : ' examples'
Original file line number Diff line number Diff line change 11# AWS Secure S3 Terraform module
22
33Terraform module which creates a S3 bucket on AWS with secure defaults.
4+
5+ ## Usage
6+
7+ The simplest usage of this module is shown below. It only requires to pass in the ` bucket_name ` .
8+
9+ ``` hcl
10+ module "terraform_state_s3_bucket" {
11+ source = "ultratendency/secure-s3-bucket/aws"
12+ version = "1.0.0"
13+
14+ bucket_name = "secure-bucket"
15+ }
16+ ```
17+
18+ A complete example looks like the following, where all inputs are configured.
19+
20+ ``` hcl
21+ module "terraform_state_s3_bucket" {
22+ source = "ultratendency/secure-s3-bucket/aws"
23+ version = "1.0.0"
24+
25+ bucket_name = "secure-bucket"
26+
27+ bucket_lifecycle_configuration_rule_noncurrent_version_expiration_noncurrent_days = 45
28+ bucket_lifecycle_configuration_rule_noncurrent_version_first_transition_noncurrent_days = 15
29+ bucket_lifecycle_configuration_rule_noncurrent_version_first_transition_storage_class = "ONEZONE_IA"
30+ bucket_lifecycle_configuration_rule_noncurrent_version_second_transition_noncurrent_days = 30
31+ bucket_lifecycle_configuration_rule_noncurrent_version_second_transition_storage_class = "GLACIER_IR"
32+ bucket_lifecycle_configuration_rule_abort_incomplete_multipart_upload_days_after_initiation = 14
33+
34+ aws_kms_key_enable_key_rotation = false
35+ aws_kms_key_multi_region = true
36+
37+ aws_s3_bucket_public_access_block_block_public_acls = false
38+ aws_s3_bucket_public_access_block_block_public_policy = false
39+ aws_s3_bucket_public_access_block_ignore_public_acls = false
40+ aws_s3_bucket_public_access_block_restrict_public_buckets = false
41+ }
42+ ```
Original file line number Diff line number Diff line change @@ -6,3 +6,5 @@ skip-check:
66 - CKV_AWS_18
77 - CKV_AWS_144
88 - CKV2_AWS_62
9+ # As we're using the Terraform Registry
10+ - CKV_TF_1
Original file line number Diff line number Diff line change 1+ # Complete bucket
2+
3+ The configuration in this directory creates a S3 bucket with all input set to different values
4+ than the defaults.
5+
6+ ## Usage
7+
8+ To run this example you need to execute:
9+
10+ ``` bash
11+ terraform init
12+ terraform plan
13+ terraform apply
14+ ```
15+
16+ Note that this example may create resources which can cost money (AWS Elastic IP, for example).
17+ Run `terraform destroy`` when you don't need these resources.
Original file line number Diff line number Diff line change 1+ provider "aws" {
2+ region = " eu-central-1"
3+ }
4+
5+ module "terraform_state_s3_bucket" {
6+ source = " ultratendency/secure-s3-bucket/aws"
7+ version = " 1.0.0"
8+
9+ bucket_name = " secure-bucket"
10+
11+ bucket_lifecycle_configuration_rule_noncurrent_version_expiration_noncurrent_days = 45
12+ bucket_lifecycle_configuration_rule_noncurrent_version_first_transition_noncurrent_days = 15
13+ bucket_lifecycle_configuration_rule_noncurrent_version_first_transition_storage_class = " ONEZONE_IA"
14+ bucket_lifecycle_configuration_rule_noncurrent_version_second_transition_noncurrent_days = 30
15+ bucket_lifecycle_configuration_rule_noncurrent_version_second_transition_storage_class = " GLACIER_IR"
16+ bucket_lifecycle_configuration_rule_abort_incomplete_multipart_upload_days_after_initiation = 14
17+
18+ aws_kms_key_enable_key_rotation = false
19+ aws_kms_key_multi_region = true
20+
21+ aws_s3_bucket_public_access_block_block_public_acls = false
22+ aws_s3_bucket_public_access_block_block_public_policy = false
23+ aws_s3_bucket_public_access_block_ignore_public_acls = false
24+ aws_s3_bucket_public_access_block_restrict_public_buckets = false
25+ }
Original file line number Diff line number Diff line change 1+ terraform {
2+ required_version = " >= 1.0"
3+
4+ required_providers {
5+ aws = {
6+ source = " hashicorp/aws"
7+ version = " >= 5.0"
8+ }
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ # Simple bucket
2+
3+ The configuration in this directory creates a S3 bucket with all default values.
4+
5+ ## Usage
6+
7+ To run this example you need to execute:
8+
9+ ``` bash
10+ terraform init
11+ terraform plan
12+ terraform apply
13+ ```
14+
15+ Note that this example may create resources which can cost money (AWS Elastic IP, for example).
16+ Run `terraform destroy`` when you don't need these resources.
Original file line number Diff line number Diff line change 1+ provider "aws" {
2+ region = " eu-central-1"
3+ }
4+
5+ module "terraform_state_s3_bucket" {
6+ source = " ultratendency/secure-s3-bucket/aws"
7+ version = " 1.0.0"
8+
9+ bucket_name = " secure-bucket"
10+ }
Original file line number Diff line number Diff line change 1+ terraform {
2+ required_version = " >= 1.0"
3+
4+ required_providers {
5+ aws = {
6+ source = " hashicorp/aws"
7+ version = " >= 5.0"
8+ }
9+ }
10+ }
You can’t perform that action at this time.
0 commit comments