{"id":18431011,"url":"https://github.com/seanturner026/terraform-module-eventbridge-debug-logger","last_synced_at":"2025-04-07T18:32:20.644Z","repository":{"id":50990688,"uuid":"358756865","full_name":"seanturner026/terraform-module-eventbridge-debug-logger","owner":"seanturner026","description":"A terraform module to create resources for capturing all eventbridge events for a given service as cloudwatch logs.","archived":false,"fork":false,"pushed_at":"2022-05-11T02:06:37.000Z","size":61,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-05T23:08:26.228Z","etag":null,"topics":["aws","aws-cloudwatch-events","aws-cloudwatch-logs","aws-eventbridge","aws-lambda","aws-lambda-golang","go","golang","terraform","terraform-module"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seanturner026.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-17T01:17:17.000Z","updated_at":"2022-12-24T14:59:27.000Z","dependencies_parsed_at":"2022-09-25T00:03:02.422Z","dependency_job_id":null,"html_url":"https://github.com/seanturner026/terraform-module-eventbridge-debug-logger","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanturner026%2Fterraform-module-eventbridge-debug-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanturner026%2Fterraform-module-eventbridge-debug-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanturner026%2Fterraform-module-eventbridge-debug-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanturner026%2Fterraform-module-eventbridge-debug-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seanturner026","download_url":"https://codeload.github.com/seanturner026/terraform-module-eventbridge-debug-logger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223288183,"owners_count":17120340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-cloudwatch-events","aws-cloudwatch-logs","aws-eventbridge","aws-lambda","aws-lambda-golang","go","golang","terraform","terraform-module"],"created_at":"2024-11-06T05:23:06.160Z","updated_at":"2024-11-06T05:23:06.742Z","avatar_url":"https://github.com/seanturner026.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-module-eventbridge-debug-logger\n\nA terraform module to create resources for capturing all eventbridge events for a given service as cloudwatch logs. \n\nThis is a developer workflow productivity tool that can be used to log events created by any service in order to see the event json schema, which is necessary in order to produce workflows around eventbridge rules.\n\n## Contributing\n\nEnsure that the pre-commit hooks are installed by running the following command: `pre-commit install`\n\n## Usage example\n\nFull example(s) leveraging this module is contained in the [examples](https://github.com/seanturner026/terraform-module-eventbridge-debug-logger/tree/master/examples/).\n\n**IMPORTANT**: The master branch is used in source just as an example. In your code, do not pin to master because there may be breaking changes between releases. Instead pin to the release tag (e.g. `git@github.com:seanturner026/terraform-module-eventbridge-debug-logger.git?ref=vX.Y.Z`) using one of the [latest releases](https://github.com/seanturner026/terraform-module-eventbridge-debug-logger/releases/).\n\n```hcl\nmodule \"eventbridge_debug_logger\" {\n  source = \"github.com/seanturner026/terraform-module-eventbridge-debug-logger.git\"\n\n  name                          = \"eventbridge_debug_logger\"\n  service_name                  = \"ec2\"\n  lambda_logs_retention_in_days = 1\n  tags                          = var.tags\n}\n```\n\nThe above example module invocation will track all ec2 events. Using a tool like [saw](https://github.com/TylerBrock/saw) to tail cloudwatch logs, the following log events will be written by launching and terminating an EC2 instance.\n\n```\n$ saw watch /aws/lambda/events_debug_logger_ec2 --expand\n[2021-04-17T12:30:43+12:00] START RequestId: 9130fe6d-4a72-460f-87bb-2e3ede273772 Version: $LATEST\n[2021-04-17T12:30:43+12:00] {\n    \"account-id\": \"123456789012\",\n    \"detail\": {\n        \"instance-id\": \"i-0e12345678cdfc123\",\n        \"state\": \"pending\"\n    },\n    \"detail-type\": \"EC2 Instance State-change Notification\",\n    \"id\": \"01d4aadf-a202-ed3e-0464-8bb84910a8ec\",\n    \"region\": \"us-east-1\",\n    \"resources\": [\n        \"arn:aws:ec2:us-east-1:123456789012:instance/i-0e12345678cdfc123\"\n    ],\n    \"source\": \"aws.ec2\",\n    \"version\": \"0\",\n    \"level\": \"info\",\n    \"msg\": \"handled event\",\n    \"time\": \"2021-04-17T00:30:43Z\"\n}\n[2021-04-17T12:30:43+12:00] END RequestId: 9130fe6d-4a72-460f-87bb-2e3ede273772\n[2021-04-17T12:30:43+12:00] REPORT RequestId: 9130fe6d-4a72-460f-87bb-2e3ede273772\tDuration: 0.88 ms\tBilled Duration: 1 ms\tMemory Size: 128 MB\tMax Memory Used: 30 MB\tInit Duration: 74.44 ms\n[2021-04-17T12:33:58+12:00] START RequestId: 4c13af9e-3b16-4f8e-b8ac-56f524a6435e Version: $LATEST\n[2021-04-17T12:33:58+12:00] {\n    \"account\": \"123456789012\",\n    \"detail\": {\n        \"instance-id\": \"i-0e12345678cdfc123\",\n        \"state\": \"shutting-down\"\n    },\n    \"detail-type\": \"EC2 Instance State-change Notification\",\n    \"id\": \"cb3e793e-613b-a733-91e3-b92907d6f9fd\",\n    \"level\": \"info\",\n    \"msg\": \"handled event\",\n    \"region\": \"us-east-1\",\n    \"resources\": [\n        \"arn:aws:ec2:us-east-1:123456789012:instance/i-0e12345678cdfc123\"\n    ],\n    \"source\": \"aws.ec2\",\n    \"time\": \"2021-04-17T00:33:58Z\",\n    \"version\": \"0\"\n}\n[2021-04-17T12:33:58+12:00] END RequestId: 4c13af9e-3b16-4f8e-b8ac-56f524a6435e\n[2021-04-17T12:33:58+12:00] REPORT RequestId: 4c13af9e-3b16-4f8e-b8ac-56f524a6435e\tDuration: 1.14 ms\tBilled Duration: 2 ms\tMemory Size: 128 MB\tMax Memory Used: 31 MB\tInit Duration: 61.97 ms\n```\n\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| archive | \u003e= 2.0 |\n| aws | \u003e= 3.0 |\n| null | \u003e= 3.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| archive | \u003e= 2.0 |\n| aws | \u003e= 3.0 |\n| null | \u003e= 3.0 |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| lambda\\_logs\\_retention\\_in\\_days | Specifies the number of days you want to retain log events in the specified lambda log group.\u003cbr\u003e\u003cbr\u003eSpecifying \"0\" means logs are permanently retained. | `number` | `1` | no |\n| name | Common name shared between resources. | `string` | n/a | yes |\n| service\\_name | Name of the service to create a catch-all eventbridge rule for.\u003cbr\u003e\u003cbr\u003eSee variables.tf for a complete list of input options. | `string` | n/a | yes |\n| tags | A map of tags to add to all resources. | `map(string)` | n/a | yes |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| cloudwatch\\_log\\_group\\_arn | ARN of cloudwatch log group which holds service-specific log events. |\n| cloudwatch\\_log\\_group\\_name | Name of cloudwatch log group which holds service-specific log events. |\n| event\\_rule\\_arn | ARN of the event bridge rule. |\n| event\\_rule\\_id | ID of the event bridge rule. |\n| event\\_rule\\_name | Name of the event bridge rule. |\n| event\\_target\\_arn | ARN of the resource targeted by the eventbridge target. |\n| event\\_target\\_rule | Eventbridge rule responsible for invoking the target. |\n\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseanturner026%2Fterraform-module-eventbridge-debug-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseanturner026%2Fterraform-module-eventbridge-debug-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseanturner026%2Fterraform-module-eventbridge-debug-logger/lists"}