Skip to content

Commit c0d008b

Browse files
authored
s3 lifecycle updates (#75)
- Added `filter {}` to resource `aws_s3_bucket_lifecycle_configuration` block(s) - Added `filter = []` to `module.s3_bucket_for_logs in addons/logging-alb/main.tf` - Added `filter = []` to `module.athena-s3-bucket in addons/logging-alb/main.tf` --- Addresses the following warnings. ``` No attribute specified when one (and only one) of [rule[0].filter,rule[0].prefix] is required ``` --- ``` ╷ │ Warning: Invalid Attribute Combination │ │ with module.logging_alb.module.athena-s3-bucket[0].aws_s3_bucket_lifecycle_configuration.this[0], │ on .terraform/modules/logging_alb.athena-s3-bucket/main.tf line 219, in resource "aws_s3_bucket_lifecycle_configuration" "this": │ 219: resource "aws_s3_bucket_lifecycle_configuration" "this" { │ │ 2 attributes specified when one (and only one) of [rule[0].expiration[0].date,rule[0].expiration[0].days,rule[0].expiration[0].expired_object_delete_marker] is required ```
1 parent 7d8311c commit c0d008b

5 files changed

Lines changed: 9 additions & 7 deletions

File tree

addons/logging-alb/main.tf

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,12 @@ module "s3_bucket_for_logs" {
168168
]
169169
expiration = {
170170
days = var.s3_expiration_days
171-
# Always resets to false anyhow showing terraform changes constantly
172-
expired_object_delete_marker = false
173171
}
174172
noncurrent_version_expiration = {
175173
newer_noncurrent_versions = var.s3_newer_noncurrent_versions
176174
days = var.s3_noncurrent_version_expiration_days
177175
}
176+
filter = []
178177
}
179178
]
180179
}
@@ -226,13 +225,12 @@ module "athena-s3-bucket" {
226225
]
227226
expiration = {
228227
days = var.s3_expiration_days
229-
# Always resets to false anyhow showing terraform changes constantly
230-
expired_object_delete_marker = false
231228
}
232229
noncurrent_version_expiration = {
233230
newer_noncurrent_versions = var.s3_newer_noncurrent_versions
234231
days = var.s3_noncurrent_version_expiration_days
235232
}
233+
filter = []
236234
}
237235
]
238236
}

addons/logging-destination-firehose/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ resource "aws_s3_bucket_lifecycle_configuration" "osquery-results" {
2020
expiration {
2121
days = var.osquery_results_s3_bucket.expires_days
2222
}
23+
filter {}
2324
}
2425
}
2526

@@ -59,6 +60,7 @@ resource "aws_s3_bucket_lifecycle_configuration" "osquery-status" {
5960
expiration {
6061
days = var.osquery_status_s3_bucket.expires_days
6162
}
63+
filter {}
6264
}
6365
}
6466

addons/osquery-carve/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ resource "aws_s3_bucket_lifecycle_configuration" "main" {
1717
expiration {
1818
days = var.osquery_carve_s3_bucket.expires_days
1919
}
20+
filter {}
2021
}
2122
}
2223

byo-vpc/byo-db/byo-ecs/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ resource "aws_s3_bucket_lifecycle_configuration" "software_installers" {
319319
noncurrent_days = 30
320320
}
321321
status = "Enabled"
322+
filter {}
322323
}
323324
}
324325

example/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ locals {
5252
}
5353

5454
module "fleet" {
55-
source = "github.com/fleetdm/fleet-terraform?depth=1&ref=tf-mod-root-v1.16.2"
55+
source = "github.com/fleetdm/fleet-terraform?depth=1&ref=tf-mod-root-v1.16.3"
5656
certificate_arn = module.acm.acm_certificate_arn
5757

5858
vpc = {
@@ -143,15 +143,15 @@ module "migrations" {
143143

144144
# Enable if using s3 for carves
145145
# module "osquery-carve" {
146-
# source = "github.com/fleetdm/fleet-terraform/addons/osquery-carve?depth=1&ref=tf-mod-addon-osquery-carve-v1.1.0"
146+
# source = "github.com/fleetdm/fleet-terraform/addons/osquery-carve?depth=1&ref=tf-mod-addon-osquery-carve-v1.1.1"
147147
# osquery_carve_s3_bucket = {
148148
# name = local.osquery_carve_bucket_name
149149
# }
150150
# }
151151

152152
# Uncomment if using firehose logging destination
153153
# module "firehose-logging" {
154-
# source = "github.com/fleetdm/fleet-terraform/addons/logging-destination-firehose?depth=1&ref=tf-mod-addon-logging-destination-firehose-v1.1.1"
154+
# source = "github.com/fleetdm/fleet-terraform/addons/logging-destination-firehose?depth=1&ref=tf-mod-addon-logging-destination-firehose-v1.2.1"
155155
# osquery_results_s3_bucket = {
156156
# name = local.osquery_results_bucket_name
157157
# }

0 commit comments

Comments
 (0)