Skip to content

Commit 8250b8e

Browse files
fix: Change tags for 'aws_s3_bucket_object' based on AWS limit and add validation for them (#26)
Co-authored-by: Bryant Biggs <[email protected]> Resolves #25
1 parent b6572ff commit 8250b8e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+42
-21
lines changed

.github/workflows/pre-commit.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
env:
1010
TERRAFORM_DOCS_VERSION: v0.16.0
11+
TFLINT_VERSION: v0.44.1
1112

1213
jobs:
1314
collectInputs:
@@ -21,7 +22,7 @@ jobs:
2122

2223
- name: Get root directories
2324
id: dirs
24-
uses: clowdhaus/terraform-composite-actions/[email protected].0
25+
uses: clowdhaus/terraform-composite-actions/[email protected].3
2526

2627
preCommitMinVersions:
2728
name: Min TF pre-commit
@@ -36,24 +37,26 @@ jobs:
3637

3738
- name: Terraform min/max versions
3839
id: minMax
39-
uses: clowdhaus/[email protected].0
40+
uses: clowdhaus/[email protected].4
4041
with:
4142
directory: ${{ matrix.directory }}
4243

4344
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
4445
# Run only validate pre-commit check on min version supported
4546
if: ${{ matrix.directory != '.' }}
46-
uses: clowdhaus/terraform-composite-actions/[email protected].0
47+
uses: clowdhaus/terraform-composite-actions/[email protected].3
4748
with:
4849
terraform-version: ${{ steps.minMax.outputs.minVersion }}
50+
tflint-version: ${{ env.TFLINT_VERSION }}
4951
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*'
5052

5153
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
5254
# Run only validate pre-commit check on min version supported
5355
if: ${{ matrix.directory == '.' }}
54-
uses: clowdhaus/terraform-composite-actions/[email protected].0
56+
uses: clowdhaus/terraform-composite-actions/[email protected].3
5557
with:
5658
terraform-version: ${{ steps.minMax.outputs.minVersion }}
59+
tflint-version: ${{ env.TFLINT_VERSION }}
5760
args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'
5861

5962
preCommitMaxVersion:
@@ -69,10 +72,12 @@ jobs:
6972

7073
- name: Terraform min/max versions
7174
id: minMax
72-
uses: clowdhaus/[email protected].0
75+
uses: clowdhaus/[email protected].4
7376

7477
- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}
75-
uses: clowdhaus/terraform-composite-actions/[email protected].0
78+
uses: clowdhaus/terraform-composite-actions/[email protected].3
7679
with:
7780
terraform-version: ${{ steps.minMax.outputs.maxVersion }}
81+
tflint-version: ${{ env.TFLINT_VERSION }}
7882
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}
83+
install-hcledit: true

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
workflow_dispatch:
55
push:
66
branches:
7+
- main
78
- master
89
paths:
910
- '**/*.tpl'

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.76.0
3+
rev: v1.77.1
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate
@@ -23,7 +23,7 @@ repos:
2323
- '--args=--only=terraform_standard_module_structure'
2424
- '--args=--only=terraform_workspace_remote'
2525
- repo: https://github.com/pre-commit/pre-commit-hooks
26-
rev: v4.3.0
26+
rev: v4.4.0
2727
hooks:
2828
- id: check-merge-conflict
2929
- id: end-of-file-fixer

README.md

Lines changed: 4 additions & 3 deletions

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ module "log_forwarder" {
3838
s3_zip_kms_key_id = var.log_forwarder_s3_zip_kms_key_id
3939
s3_zip_metadata = var.log_forwarder_s3_zip_metadata
4040
s3_zip_tags = var.log_forwarder_s3_zip_tags
41+
s3_zip_tags_only = var.log_forwarder_s3_zip_tags_only
4142

4243
create_role = var.create_log_forwarder_role
4344
role_arn = var.log_forwarder_role_arn

modules/log_forwarder/README.md

Lines changed: 2 additions & 1 deletion

modules/log_forwarder/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ resource "aws_s3_object" "this" {
144144
kms_key_id = var.s3_zip_kms_key_id
145145
metadata = var.s3_zip_metadata
146146

147-
tags = merge(var.tags, var.s3_zip_tags, local.version_tag)
147+
tags = var.s3_zip_tags_only ? var.s3_zip_tags : merge(var.tags, var.s3_zip_tags, local.version_tag)
148148

149149
depends_on = [null_resource.this]
150150
}

modules/log_forwarder/variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ variable "s3_zip_tags" {
9393
default = {}
9494
}
9595

96+
variable "s3_zip_tags_only" {
97+
description = "Set to true to not merge `var.tags` with `s3_zip_tags`. Useful to avoid breaching S3 Object 10 tag limit"
98+
type = bool
99+
default = false
100+
}
101+
96102
# Forwarder IAM Role
97103
variable "create_role" {
98104
description = "Controls whether an IAM role is created for the forwarder"
@@ -182,7 +188,7 @@ variable "s3_log_bucket_arns" {
182188
variable "forwarder_version" {
183189
description = "Forwarder version - see https://github.com/DataDog/datadog-serverless-functions/releases"
184190
type = string
185-
default = "3.44.0"
191+
default = "3.69.0"
186192
}
187193

188194
variable "name" {

modules/rds_enhanced_monitoring_forwarder/README.md

Lines changed: 1 addition & 1 deletion

modules/rds_enhanced_monitoring_forwarder/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ variable "policy_path" {
112112
variable "forwarder_version" {
113113
description = "Forwarder version - see https://github.com/DataDog/datadog-serverless-functions/releases"
114114
type = string
115-
default = "3.44.0"
115+
default = "3.69.0"
116116
}
117117

118118
variable "name" {

0 commit comments

Comments
 (0)