https://github.com/launchbynttdata/tf-aws-module_primitive-cloudwatch_event_endpoint
https://github.com/launchbynttdata/tf-aws-module_primitive-cloudwatch_event_endpoint
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/launchbynttdata/tf-aws-module_primitive-cloudwatch_event_endpoint
- Owner: launchbynttdata
- License: apache-2.0
- Created: 2026-03-16T14:06:25.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-05-19T18:13:04.000Z (about 2 months ago)
- Last Synced: 2026-05-19T21:47:31.493Z (about 2 months ago)
- Language: Makefile
- Homepage: https://launch.nttdata.com
- Size: 106 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
- Notice: NOTICE
Awesome Lists containing this project
README
# tf-aws-module_primitive-cloudwatch_event_endpoint
[](https://opensource.org/licenses/Apache-2.0)
[](https://creativecommons.org/licenses/by-nc-nd/4.0/)
## Overview
This Terraform module creates an [AWS EventBridge Global Endpoint](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_endpoint) for regional fault tolerance. Global endpoints enable automatic failover between primary and secondary regions when the Route 53 health check reports the primary region as unhealthy.
## Features
- Creates an EventBridge global endpoint with configurable routing
- Supports event replication between primary and secondary regions
- Configurable Route 53 health check for failover triggering
- IAM role for event replication (when replication is enabled)
- Full support for all documented resource attributes
## Usage
```hcl
module "event_endpoint" {
source = "terraform.registry.launch.nttdata.com/module_primitive/cloudwatch_event_endpoint/aws"
version = "~> 1.0"
name = "my-global-endpoint"
description = "EventBridge global endpoint for regional fault tolerance"
event_bus = [
{ event_bus_arn = aws_cloudwatch_event_bus.primary.arn },
{ event_bus_arn = aws_cloudwatch_event_bus.secondary.arn }
]
routing_config = {
primary_health_check_arn = aws_route53_health_check.endpoint.arn
secondary_route = "us-west-2"
}
role_arn = aws_iam_role.replication.arn
replication_config = {
state = "ENABLED"
}
}
```
## Pre-Commit Hooks
The [.pre-commit-config.yaml](.pre-commit-config.yaml) file defines hooks for Terraform, Go, and common linting. The `commitlint` hook enforces conventional commit messages.
The `detect-secrets-hook` prevents new secrets from being introduced. See [detect-secrets documentation](https://github.com/Yelp/detect-secrets) for details.
To install the commit-msg hook:
```shell
pre-commit install --hook-type commit-msg
```
## Local Testing
1. Install components: `make configure`
2. Set up AWS credentials (e.g., `AWS_PROFILE` or `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY`)
3. Create `examples/complete/provider.tf` with AWS provider configuration (or rely on Makefile-generated file)
4. Create `examples/complete/terraform.tfvars` with variable values
5. Run validation: `make check`
## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | ~> 1.5 |
| [aws](#requirement\_aws) | ~> 5.14 |
## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [aws_cloudwatch_event_endpoint.endpoint](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_endpoint) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [description](#input\_description) | A description of the global endpoint. | `string` | `null` | no |
| [event\_bus](#input\_event\_bus) | List of exactly two event bus configurations. Each must have event\_bus\_arn.
Event bus names must be identical across regions for custom buses. |
list(object({
event_bus_arn = string
})) | n/a | yes |
| [name](#input\_name) | The name of the global endpoint. Maximum of 64 characters consisting of numbers, lower/upper case letters, ., -, \_. | `string` | n/a | yes |
| [replication\_config](#input\_replication\_config) | Replication configuration. When null, replication is not explicitly set (provider default: ENABLED).
- state: ENABLED or DISABLED. ENABLED replicates events to both regions. | object({
state = string
}) | `null` | no |
| [role\_arn](#input\_role\_arn) | The ARN of the IAM role used for replication between event buses. | `string` | `null` | no |
| [routing\_config](#input\_routing\_config) | Routing configuration for failover.
- primary\_health\_check\_arn: ARN of the Route 53 health check that triggers failover when unhealthy.
- secondary\_route: The secondary region name (e.g., us-west-2) for failover routing. | object({
primary_health_check_arn = string
secondary_route = string
}) | n/a | yes |
## Outputs
| Name | Description |
|------|-------------|
| [arn](#output\_arn) | The ARN of the global endpoint. |
| [description](#output\_description) | The description of the global endpoint. |
| [endpoint\_url](#output\_endpoint\_url) | The URL of the endpoint used for publishing events. |
| [event\_bus](#output\_event\_bus) | The event buses associated with the endpoint. |
| [id](#output\_id) | The ID of the resource (same as the name). |
| [name](#output\_name) | The name of the global endpoint. |
| [replication\_config](#output\_replication\_config) | The replication configuration of the endpoint. |
| [role\_arn](#output\_role\_arn) | The ARN of the IAM role used for replication. |
| [routing\_config](#output\_routing\_config) | The routing configuration including failover settings. |