S3 bucket tagging (#268)

This commit is contained in:
Robert Fairburn authored and GitHub committed 2026-07-15 07:45:23 -05:00
1 parent d2cae029db
commit 35ad999822
12 files changed
+55 -34

No files matched your search

+7 -15
View File
@@ -9,15 +9,7 @@ This addon configures AWS Kinesis Firehose to send Fleet's osquery logs to Datad
## S3 Bucket Policy: Deny Non-HTTPS
Set `attach_deny_insecure_transport_policy = true` to attach a bucket policy to the failure S3 bucket that denies any requests made over plain HTTP:
```hcl
module "datadog-logging" {
source = "github.com/fleetdm/fleet-terraform//addons/logging-destination-datadog?ref=<tag>"
attach_deny_insecure_transport_policy = true
# ... other configuration ...
}
```
This module automatically attaches a bucket policy to the failure S3 bucket that denies any requests made over plain HTTP. No configuration is required.
## How to use
@@ -132,8 +124,8 @@ No requirements.
## Providers
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 6.41.0 |
| ---- | ------- |
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
## Modules
@@ -142,7 +134,7 @@ No modules.
## Resources
| Name | Type |
|------|------|
| ---- | ---- |
| [aws_iam_policy.firehose](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.firehose-logging](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_role.firehose](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
@@ -162,18 +154,18 @@ No modules.
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_attach_deny_insecure_transport_policy"></a> [attach\_deny\_insecure\_transport\_policy](#input\_attach\_deny\_insecure\_transport\_policy) | When true, attach a bucket policy to the S3 bucket that denies non-SSL requests. | `bool` | `false` | no |
| ---- | ----------- | ---- | ------- | :------: |
| <a name="input_compression_format"></a> [compression\_format](#input\_compression\_format) | Compression format for the Firehose delivery stream | `string` | `"UNCOMPRESSED"` | no |
| <a name="input_datadog_api_key"></a> [datadog\_api\_key](#input\_datadog\_api\_key) | Datadog API key for authentication | `string` | n/a | yes |
| <a name="input_datadog_url"></a> [datadog\_url](#input\_datadog\_url) | Datadog HTTP API endpoint URL | `string` | n/a | yes |
| <a name="input_log_destinations"></a> [log\_destinations](#input\_log\_destinations) | A map of configurations for Datadog Firehose delivery streams. | <pre>map(object({<br/> name = string<br/> buffering_size = number<br/> buffering_interval = number<br/> s3_buffering_size = number<br/> s3_buffering_interval = number<br/> content_encoding = string<br/> common_attributes = optional(list(object({<br/> name = string<br/> value = string<br/> })), [])<br/> }))</pre> | <pre>{<br/> "audit": {<br/> "buffering_interval": 60,<br/> "buffering_size": 2,<br/> "common_attributes": [],<br/> "content_encoding": "NONE",<br/> "name": "fleet-audit-datadog",<br/> "s3_buffering_interval": 400,<br/> "s3_buffering_size": 10<br/> },<br/> "results": {<br/> "buffering_interval": 60,<br/> "buffering_size": 2,<br/> "common_attributes": [],<br/> "content_encoding": "NONE",<br/> "name": "fleet-osquery-results-datadog",<br/> "s3_buffering_interval": 400,<br/> "s3_buffering_size": 10<br/> },<br/> "status": {<br/> "buffering_interval": 60,<br/> "buffering_size": 2,<br/> "common_attributes": [],<br/> "content_encoding": "NONE",<br/> "name": "fleet-osquery-status-datadog",<br/> "s3_buffering_interval": 400,<br/> "s3_buffering_size": 10<br/> }<br/>}</pre> | no |
| <a name="input_s3_bucket_config"></a> [s3\_bucket\_config](#input\_s3\_bucket\_config) | Configuration for the S3 bucket used to store failed Datadog delivery attempts | <pre>object({<br/> name_prefix = optional(string, "fleet-datadog-failure")<br/> expires_days = optional(number, 1)<br/> })</pre> | <pre>{<br/> "expires_days": 1,<br/> "name_prefix": "fleet-datadog-failure"<br/>}</pre> | no |
| <a name="input_s3_bucket_tags"></a> [s3\_bucket\_tags](#input\_s3\_bucket\_tags) | Additional tags to apply to the S3 failure bucket. | `map(string)` | `{}` | no |
## Outputs
| Name | Description |
|------|-------------|
| ---- | ----------- |
| <a name="output_fleet_extra_environment_variables"></a> [fleet\_extra\_environment\_variables](#output\_fleet\_extra\_environment\_variables) | Environment variables to configure Fleet to use Datadog logging via Firehose |
| <a name="output_fleet_extra_iam_policies"></a> [fleet\_extra\_iam\_policies](#output\_fleet\_extra\_iam\_policies) | IAM policies required for Fleet to log to Datadog via Firehose |
| <a name="output_fleet_s3_datadog_failure_config"></a> [fleet\_s3\_datadog\_failure\_config](#output\_fleet\_s3\_datadog\_failure\_config) | S3 bucket details - datadog-failure |
@@ -2,6 +2,7 @@ data "aws_region" "current" {}
resource "aws_s3_bucket" "datadog-failure" { #tfsec:ignore:aws-s3-encryption-customer-key:exp:2022-07-01 #tfsec:ignore:aws-s3-enable-versioning #tfsec:ignore:aws-s3-enable-bucket-logging:exp:2022-06-15
bucket_prefix = var.s3_bucket_config.name_prefix
tags = var.s3_bucket_tags
}
resource "aws_s3_bucket_lifecycle_configuration" "datadog-failure" {
@@ -70,3 +70,9 @@ variable "datadog_api_key" {
description = "Datadog API key for authentication"
sensitive = true
}
variable "s3_bucket_tags" {
description = "Additional tags to apply to the S3 failure bucket."
type = map(string)
default = {}
}