Skip to content

Commit fb3466c

Browse files
authored
Merge pull request #408 from trussworks/barry-update-things
fix: use proper parameters for some s3 bucket resources
2 parents 1bfbbf3 + f1d82e1 commit fb3466c

File tree

14 files changed

+90
-67
lines changed

14 files changed

+90
-67
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ on:
1010

1111
jobs:
1212
validate-tf:
13-
uses: trussworks/shared-actions/.github/workflows/validate-tf.yml@main
13+
uses: trussworks/shared-actions/.github/workflows/validate-tf.yml@3cab03ab95045711da37ad6d63a93c666fc22398 # v0.0.2

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.DS_Store
22
.terraform
3+
.terraform.lock.hcl
34
terraform.tfstate
45
terraform.tfstate.backup
56
terraform.tfstate.*.backup
7+
.envrc*

.markdownlintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"first-line-h1": false,
55
"line_length": false,
66
"no-multiple-blanks": false,
7-
"no-inline-html": false
7+
"no-inline-html": false,
8+
"no-alt-text": false
89
}

.pre-commit-config.yaml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-json
66
- id: check-merge-conflict
@@ -14,27 +14,17 @@ repos:
1414
- id: end-of-file-fixer
1515
- id: mixed-line-ending
1616

17-
- repo: https://github.com/executablebooks/mdformat
18-
rev: 0.7.16
19-
hooks:
20-
- id: mdformat
21-
additional_dependencies:
22-
- mdformat-gfm
23-
- mdformat-toc
24-
# mdformat fights with terraform_docs
25-
exclude: README.m(ark)?d(own)?
26-
2717
- repo: https://github.com/igorshubovych/markdownlint-cli
28-
rev: v0.33.0
18+
rev: v0.43.0
2919
hooks:
3020
- id: markdownlint
3121

32-
- repo: https://github.com/detailyang/pre-commit-shell
33-
rev: 1.0.5
22+
- repo: https://github.com/terraform-docs/terraform-docs
23+
rev: "v0.19.0"
3424
hooks:
35-
- id: shell-lint
25+
- id: terraform-docs-system
3626

3727
- repo: https://github.com/antonbabenko/pre-commit-terraform
38-
rev: v1.77.1
28+
rev: v1.96.3
3929
hooks:
4030
- id: terraform_fmt

.terraform-docs.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
1+
version: ">= 0.19.0, < 1.0.0"
2+
13
settings:
24
html: false
35
anchor: false
6+
escape: false
7+
lockfile: false
8+
hide-empty: true
49
formatter: "markdown table"
10+
11+
sort:
12+
enabled: true
13+
by: required
14+
15+
sections:
16+
show:
17+
- requirements
18+
- providers
19+
- modules
20+
- data-sources
21+
- resources
22+
- inputs
23+
- outputs
24+
25+
recursive:
26+
enabled: false
27+
include-main: false
28+
29+
output:
30+
file: README.md
31+
mode: inject
32+
template: |-
33+
<!-- BEGIN_TF_DOCS -->
34+
{{ .Content }}
35+
<!-- END_TF_DOCS -->

README.md

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,13 @@ module "aws-s3-bucket" {
4545
| Name | Version |
4646
|------|---------|
4747
| terraform | >= 1.0 |
48-
| aws | >= 3.75.0 |
48+
| aws | >= 5.43.0 |
4949

5050
## Providers
5151

5252
| Name | Version |
5353
|------|---------|
54-
| aws | >= 3.75.0 |
55-
56-
## Modules
57-
58-
No modules.
54+
| aws | >= 5.43.0 |
5955

6056
## Resources
6157

@@ -83,40 +79,41 @@ No modules.
8379

8480
| Name | Description | Type | Default | Required |
8581
|------|-------------|------|---------|:--------:|
86-
| abort\_incomplete\_multipart\_upload\_days | Number of days until aborting incomplete multipart uploads | `number` | `14` | no |
87-
| additional\_lifecycle\_rules | List of additional lifecycle rules to specify | `list(any)` | `[]` | no |
8882
| bucket | The name of the bucket. | `string` | n/a | yes |
89-
| bucket\_key\_enabled | Whether or not to use Amazon S3 Bucket Keys for SSE-KMS. | `bool` | `false` | no |
90-
| control\_object\_ownership | Whether to manage S3 Bucket Ownership Controls on this bucket. | `bool` | `true` | no |
91-
| cors\_rules | List of maps containing rules for Cross-Origin Resource Sharing. | `list(any)` | `[]` | no |
92-
| custom\_bucket\_policy | JSON formatted bucket policy to attach to the bucket. | `string` | `""` | no |
93-
| enable\_analytics | Enables storage class analytics on the bucket. | `bool` | `true` | no |
94-
| enable\_bucket\_force\_destroy | If set to true, Bucket will be emptied and destroyed when terraform destroy is run. | `bool` | `false` | no |
95-
| enable\_bucket\_inventory | If set to true, Bucket Inventory will be enabled. | `bool` | `false` | no |
96-
| enable\_s3\_public\_access\_block | Bool for toggling whether the s3 public access block resource should be enabled. | `bool` | `true` | no |
83+
| abort_incomplete_multipart_upload_days | Number of days until aborting incomplete multipart uploads | `number` | `14` | no |
84+
| additional_lifecycle_rules | List of additional lifecycle rules to specify | `list(any)` | `[]` | no |
85+
| bucket_key_enabled | Whether or not to use Amazon S3 Bucket Keys for SSE-KMS. | `bool` | `false` | no |
86+
| control_object_ownership | Whether to manage S3 Bucket Ownership Controls on this bucket. | `bool` | `true` | no |
87+
| cors_rules | List of maps containing rules for Cross-Origin Resource Sharing. | `list(any)` | `[]` | no |
88+
| custom_bucket_policy | JSON formatted bucket policy to attach to the bucket. | `string` | `""` | no |
89+
| enable_analytics | Enables storage class analytics on the bucket. | `bool` | `true` | no |
90+
| enable_bucket_force_destroy | If set to true, Bucket will be emptied and destroyed when terraform destroy is run. | `bool` | `false` | no |
91+
| enable_bucket_inventory | If set to true, Bucket Inventory will be enabled. | `bool` | `false` | no |
92+
| enable_s3_public_access_block | Bool for toggling whether the s3 public access block resource should be enabled. | `bool` | `true` | no |
9793
| expiration | expiration blocks | `list(any)` | ```[ { "expired_object_delete_marker": true } ]``` | no |
98-
| inventory\_bucket\_format | The format for the inventory file. Default is ORC. Options are ORC or CSV. | `string` | `"ORC"` | no |
99-
| kms\_master\_key\_id | The AWS KMS master key ID used for the SSE-KMS encryption. If blank, bucket encryption configuration defaults to AES256. | `string` | `""` | no |
100-
| logging\_bucket | The S3 bucket to send S3 access logs. | `string` | `""` | no |
101-
| noncurrent\_version\_expiration | Number of days until non-current version of object expires | `number` | `365` | no |
102-
| noncurrent\_version\_transitions | Non-current version transition blocks | `list(any)` | ```[ { "days": 30, "storage_class": "STANDARD_IA" } ]``` | no |
103-
| object\_ownership | Object ownership. Valid values: BucketOwnerEnforced, BucketOwnerPreferred or ObjectWriter. | `string` | `"BucketOwnerEnforced"` | no |
104-
| s3\_bucket\_acl | Set bucket ACL per [AWS S3 Canned ACL](<https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl>) list. | `string` | `null` | no |
105-
| schedule\_frequency | The S3 bucket inventory frequency. Defaults to Weekly. Options are 'Weekly' or 'Daily'. | `string` | `"Weekly"` | no |
94+
| inventory_bucket_format | The format for the inventory file. Default is ORC. Options are ORC or CSV. | `string` | `"ORC"` | no |
95+
| kms_master_key_id | The AWS KMS master key ID used for the SSE-KMS encryption. If blank, bucket encryption configuration defaults to AES256. | `string` | `""` | no |
96+
| logging_bucket | The S3 bucket to send S3 access logs. | `string` | `""` | no |
97+
| noncurrent_version_expiration | Number of days until non-current version of object expires | `number` | `365` | no |
98+
| noncurrent_version_transitions | Non-current version transition blocks | `list(any)` | ```[ { "days": 30, "storage_class": "STANDARD_IA" } ]``` | no |
99+
| object_ownership | Object ownership. Valid values: BucketOwnerEnforced, BucketOwnerPreferred or ObjectWriter. | `string` | `"BucketOwnerEnforced"` | no |
100+
| s3_bucket_acl | Set bucket ACL per [AWS S3 Canned ACL](<https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl>) list. | `string` | `null` | no |
101+
| schedule_frequency | The S3 bucket inventory frequency. Defaults to Weekly. Options are 'Weekly' or 'Daily'. | `string` | `"Weekly"` | no |
106102
| tags | A mapping of tags to assign to the bucket. | `map(string)` | `{}` | no |
107-
| transfer\_acceleration | Whether or not to enable bucket acceleration. | `bool` | `null` | no |
103+
| transfer_acceleration | Whether or not to enable bucket acceleration. | `bool` | `null` | no |
108104
| transitions | Current version transition blocks | `list(any)` | `[]` | no |
109-
| use\_account\_alias\_prefix | Whether to prefix the bucket name with the AWS account alias. | `string` | `true` | no |
110-
| use\_random\_suffix | Whether to add a random suffix to the bucket name. | `bool` | `false` | no |
111-
| versioning\_status | A string that indicates the versioning status for the log bucket. | `string` | `"Enabled"` | no |
105+
| use_account_alias_prefix | Whether to prefix the bucket name with the AWS account alias. | `string` | `true` | no |
106+
| use_random_suffix | Whether to add a random suffix to the bucket name. | `bool` | `false` | no |
107+
| versioning_status | A string that indicates the versioning status for the log bucket. | `string` | `"Enabled"` | no |
112108

113109
## Outputs
114110

115111
| Name | Description |
116112
|------|-------------|
117113
| arn | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. |
118-
| bucket\_domain\_name | The bucket domain name. |
119-
| bucket\_regional\_domain\_name | The bucket region-specific domain name. |
114+
| bucket_domain_name | The bucket domain name. |
115+
| bucket_logging_prefix | Prefix defined for logging to an S3 bucket. |
116+
| bucket_regional_domain_name | The bucket region-specific domain name. |
120117
| id | The name of the bucket. |
121118
| name | The Name of the bucket. Will be of format bucketprefix-bucketname. |
122119
<!-- END_TF_DOCS -->

examples/bucket-inventory/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,7 @@ module "s3_logs" {
2626

2727
s3_bucket_name = var.logging_bucket
2828

29-
default_allow = false
29+
default_allow = false
30+
allow_s3 = true
31+
s3_logs_prefix = ["s3/${var.test_name}"]
3032
}

examples/custom-bucket-policy/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,7 @@ module "s3_logs" {
5757
s3_bucket_name = var.logging_bucket
5858

5959
default_allow = false
60+
allow_s3 = true
61+
62+
s3_logs_prefix = ["s3/${var.test_name}"]
6063
}

examples/s3-bucket-key/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ module "s3_private_bucket" {
1919
use_account_alias_prefix = false
2020

2121
kms_master_key_id = module.aws_s3_bucket_kms_key.aws_kms_key_arn
22-
sse_algorithm = "aws:kms"
2322
bucket_key_enabled = true
2423
}

examples/simple/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ module "s3_logs" {
2828
s3_bucket_name = var.logging_bucket
2929

3030
default_allow = false
31+
allow_s3 = true
32+
33+
s3_logs_prefix = ["s3/${var.test_name}"]
3134
}

0 commit comments

Comments
 (0)