[//]: # (dependabot-start) ⚠️ **Dependabot is rebasing this PR** ⚠️ Rebasing might not happen immediately, so don't worry if this takes some time. Note: if you make any changes to this PR yourself, they will take precedence over the rebase. --- [//]: # (dependabot-end) Bumps [github.com/aws/aws-sdk-go-v2/service/lambda](https://github.com/aws/aws-sdk-go-v2) from 1.88.0 to 1.88.5. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/aws/aws-sdk-go-v2/commit/b9b0c6553b80f99603b4f8356b88f5baf1328deb"><code>b9b0c65</code></a> Release 2025-10-16</li> <li><a href="https://github.com/aws/aws-sdk-go-v2/commit/e2bc8a0ec6f430876fc7de4432ea9cc89c9568f8"><code>e2bc8a0</code></a> Regenerated Clients</li> <li><a href="https://github.com/aws/aws-sdk-go-v2/commit/8691ee380a96c49351e4b5ab8a70bc5d4d100724"><code>8691ee3</code></a> Update API model</li> <li><a href="https://github.com/aws/aws-sdk-go-v2/commit/51e8a3fe032fc566d31b389f492ab58475a98398"><code>51e8a3f</code></a> bump to go1.23 (<a href="https://redirect.github.com/aws/aws-sdk-go-v2/issues/3211">#3211</a>)</li> <li><a href="https://github.com/aws/aws-sdk-go-v2/commit/ad2d36cba7c5772b4e8e4caf96939dc41b95c65c"><code>ad2d36c</code></a> Release 2025-10-15</li> <li><a href="https://github.com/aws/aws-sdk-go-v2/commit/19a35d639f969ee328553e632e8cf8b83d324106"><code>19a35d6</code></a> Regenerated Clients</li> <li><a href="https://github.com/aws/aws-sdk-go-v2/commit/35cb02fd50fb125601b9c3b33feb72f3a2bcaa56"><code>35cb02f</code></a> Update endpoints model</li> <li><a href="https://github.com/aws/aws-sdk-go-v2/commit/f673a1b0a80e666c0128ec606ff053dace9771f1"><code>f673a1b</code></a> Update API model</li> <li><a href="https://github.com/aws/aws-sdk-go-v2/commit/48421fd812d8592a4eb2b32d11ae07e228969012"><code>48421fd</code></a> Release 2025-10-14</li> <li><a href="https://github.com/aws/aws-sdk-go-v2/commit/fedcba778c21b451a91b4e4bcdd5d6c1554c6a5a"><code>fedcba7</code></a> Regenerated Clients</li> <li>Additional commits viewable in <a href="https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.88.0...service/s3/v1.88.5">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/fleetdm/fleet-terraform/network/alerts). </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Robert Fairburn <8029478+rfairburn@users.noreply.github.com>
Fleet CloudWatch Logs to GCP Pub/Sub Bridge
This module creates an AWS Lambda subscription target for a Fleet CloudWatch log group and forwards log events to a GCP Pub/Sub topic.
The Lambda function reads Google service account credentials from an existing AWS Secrets Manager secret.
Deploy this module in the same AWS region as the Fleet CloudWatch log group.
The bridge Lambda is implemented in Go and compiled during Terraform apply.
Publishing uses the official cloud.google.com/go/pubsub/v2 client library.
The Terraform execution environment must include a working go toolchain.
Usage
provider "aws" {
region = "us-east-2"
}
variable "gcp_pubsub_service_account_credentials_json" {
description = "Google service-account credentials JSON shared by the customer (for example from target-account-gcp publisher_credentials_json)."
type = string
sensitive = true
}
resource "aws_secretsmanager_secret" "gcp_pubsub_credentials" {
name = "fleet/gcp/pubsub/service-account"
}
resource "aws_secretsmanager_secret_version" "gcp_pubsub_credentials" {
secret_id = aws_secretsmanager_secret.gcp_pubsub_credentials.id
secret_string = jsonencode({
service_account_json = var.gcp_pubsub_service_account_credentials_json
})
}
module "fleet_pubsub_bridge" {
source = "github.com/fleetdm/fleet-terraform//addons/byo-cloudwatch-log-sharing/pubsub-bridge?depth=1&ref=tf-mod-addon-byo-cloudwatch-log-sharing-v1.0.0"
subscription = {
log_group_name = module.fleet.byo-vpc.byo-db.byo-ecs.logging_config["awslogs-group"]
filter_pattern = ""
}
gcp_pubsub = {
project_id = "customer-observability-prod"
topic_id = "fleet-logs"
credentials_secret_arn = aws_secretsmanager_secret.gcp_pubsub_credentials.arn
}
lambda = {
function_name = "fleet-cloudwatch-pubsub-bridge"
role_name = "fleet-cloudwatch-pubsub-bridge-role"
policy_name = "fleet-cloudwatch-pubsub-bridge-policy"
timeout = 60
memory_size = 256
batch_size = 1000
}
dlq = {
enabled = true
queue_name = "fleet-cloudwatch-pubsub-bridge-dlq"
maximum_retry_attempts = 2
maximum_event_age_in_seconds = 3600
}
alerting = {
enabled = true
sns_topic_arns = ["arn:aws:sns:us-east-2:111111111111:fleet-ops-alerts"]
period_seconds = 300
evaluation_periods = 1
datapoints_to_alarm = 1
lambda_errors_threshold = 1
dlq_visible_messages_threshold = 1
enable_ok_notifications = true
}
replayer = {
enabled = true
function_name = "fleet-cloudwatch-pubsub-bridge-replayer"
batch_size = 10
maximum_batching_window_in_seconds = 5
maximum_concurrency = 2
}
}
output "fleet_pubsub_bridge" {
value = module.fleet_pubsub_bridge
}
The referenced secret should contain either:
- A Google service-account key JSON document directly.
- A JSON object with a
service_account_jsonfield that contains the service-account key JSON.
This module uses CloudWatch alarms for notifications so alerts fire on state transitions instead of per-failed event, which avoids high-volume SNS spam during sustained failures.
A built-in SQS replayer Lambda is enabled by default and re-drives failed async events from the DLQ back to the main bridge Lambda with partial-batch failure handling.
Reprocessing Options
- Built-in automatic replay:
Use the module's default
replayersettings to continuously re-drive failed events from DLQ. - Manual/batched replay: Drain DLQ messages to S3 for analysis, then replay selected batches during controlled windows.
- Scheduled replay workflow: Use EventBridge Scheduler or Step Functions to periodically replay aged DLQ messages with rate limits and stop conditions.
Requirements
| Name | Version |
|---|---|
| terraform | >= 1.3.7 |
| archive | >= 2.4.0 |
| aws | >= 5.29.0 |
| null | >= 3.2.1 |
Providers
| Name | Version |
|---|---|
| archive | >= 2.4.0 |
| aws | >= 5.29.0 |
| null | >= 3.2.1 |
Modules
No modules.
Resources
Inputs
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| alerting | CloudWatch alarm and SNS notification settings for bridge failures. | object({ |
{} |
no |
| dlq | Asynchronous Lambda failure handling via SQS dead-letter queue. | object({ |
{} |
no |
| gcp_pubsub | GCP Pub/Sub settings and credentials secret reference for cloud.google.com/go/pubsub/v2. The secret must contain a Google service-account key JSON, or a JSON object with a service_account_json field containing that key JSON. | object({ |
n/a | yes |
| lambda | Go-based Lambda bridge configuration. | object({ |
{} |
no |
| replayer | SQS DLQ replayer settings. Replays failed bridge events back to the main bridge Lambda. | object({ |
{} |
no |
| subscription | CloudWatch Logs subscription settings for sending Fleet log events to the Pub/Sub bridge Lambda. | object({ |
n/a | yes |
| tags | Tags to apply to created resources that support tags. | map(string) |
{} |
no |
Outputs
| Name | Description |
|---|---|
| alerting | CloudWatch alarm and notification resources for bridge health. |
| dlq | Dead-letter queue configuration and resource details. |
| lambda | Lambda bridge details. |
| pubsub | Configured GCP Pub/Sub destination details. |
| replayer | DLQ replayer Lambda and event source mapping details. |
| subscription_filter | CloudWatch Logs subscription filter details. |