An open API service indexing awesome lists of open source software.

https://github.com/quortex/terraform-aws-rtmp-loadbalancer

A terraform module for Quortex infrastructure RTMP loadbalancer.
https://github.com/quortex/terraform-aws-rtmp-loadbalancer

aws terraform

Last synced: 2 months ago
JSON representation

A terraform module for Quortex infrastructure RTMP loadbalancer.

Awesome Lists containing this project

README

          

[![Quortex][logo]](https://quortex.io)

# terraform-aws-rtmp-loadbalancer
A terraform module for Quortex infrastructure RTMP loadbalancer.

This module provides the resources needed to deploy the Quortex RTMP(S) loadbalancer stack on AWS.

It allows you to provision :
- A [Classic Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html) to distributes RTMP(S) incoming traffic across multiple targets.
- A [Route 53](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/Welcome.html) record alias to the Load Balancer.
- An optional SSL certificate managed by [Certificate Manager](https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html) for RTMPS ssl termination.
- A bucket with configurable lifecycle rules to store Load Balancer access logs.
- A set of security group (rules) to handle permissions.

## Usage example

```hcl
module "rtmp_loadbalancer" {
source = "git@github.com:quortex/terraform-aws-rtmp-loadbalancer.git?ref=main"

name = "${terraform.workspace}-rtmp-loadbalancer"
vpc_id = module.network.vpc_id
vpc_cidr = module.network.vpc_cidr_block
subnet_ids = module.network.public_subnet_ids
rtmp_backend_ingress_port = var.rtmp_loadbalancer_backend_ingress_port
rtmp_backend_security_group_id = module.eks.cluster_security_group_id
access_logs_enabled = true
access_logs_expiration = 2
access_logs_force_destroy = true
dns_hosted_zone_id = var.hosted_zone_id
dns_record = "rtmp.${terraform.workspace}"
ssl_certificate_domain_name = "rtmp.${terraform.workspace}.${var.hosted_zone_domain_name}"

tags = local.tags
}
```

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [name](#input\_name) | A name from which the name of the resources will be chosen. Note that each resource name can be set individually. | `string` | n/a | yes |
| [vpc\_id](#input\_vpc\_id) | ID of the VPC in which the resources should be deployed. | `string` | n/a | yes |
| [vpc\_cidr](#input\_vpc\_cidr) | The CIDR for the VPC. | `string` | n/a | yes |
| [subnet\_ids](#input\_subnet\_ids) | The IDs of the subnets where resources should be placed. | `list(string)` | `[]` | no |
| [elb\_name](#input\_elb\_name) | Override the ELB name. | `string` | `""` | no |
| [elb\_cross\_zone\_load\_balancing](#input\_elb\_cross\_zone\_load\_balancing) | Enable cross-zone load balancing. | `bool` | `false` | no |
| [elb\_idle\_timeout](#input\_elb\_idle\_timeout) | The time in seconds that the connection is allowed to be idle. | `number` | `60` | no |
| [elb\_connection\_draining](#input\_elb\_connection\_draining) | Boolean to enable connection draining. | `bool` | `true` | no |
| [elb\_connection\_draining\_timeout](#input\_elb\_connection\_draining\_timeout) | The time in seconds to allow for connections to drain. | `number` | `300` | no |
| [elb\_health\_check\_healthy\_threshold](#input\_elb\_health\_check\_healthy\_threshold) | The number of checks before the instance is declared healthy. | `number` | `6` | no |
| [elb\_health\_check\_unhealthy\_threshold](#input\_elb\_health\_check\_unhealthy\_threshold) | The number of checks before the instance is declared unhealthy. | `number` | `2` | no |
| [elb\_health\_check\_timeout](#input\_elb\_health\_check\_timeout) | The interval between checks. | `number` | `5` | no |
| [elb\_health\_check\_interval](#input\_elb\_health\_check\_interval) | The length of time before the check times out. | `number` | `10` | no |
| [elb\_security\_group\_name](#input\_elb\_security\_group\_name) | Override the ELB security group name. | `string` | `""` | no |
| [elb\_ingress\_cidr\_blocks\_rtmp](#input\_elb\_ingress\_cidr\_blocks\_rtmp) | CIDRs to allow for the rtmp ingress. | `list(string)` |

[
"0.0.0.0/0"
]
| no |
| [elb\_ingress\_cidr\_blocks\_rtmps](#input\_elb\_ingress\_cidr\_blocks\_rtmps) | CIDRs to allow for the rtmps ingress. | `list(string)` |
[
"0.0.0.0/0"
]
| no |
| [rtmp\_backend\_ingress\_port](#input\_rtmp\_backend\_ingress\_port) | The rtmp backend ingress port (envoy port for rtmp). | `string` | n/a | yes |
| [rtmp\_backend\_security\_group\_id](#input\_rtmp\_backend\_security\_group\_id) | The rtmp backend security group id (used to allow ingress on rtmp\_backend\_ingress\_port). | `string` | n/a | yes |
| [rtmp\_backend\_autoscaling\_group\_name](#input\_rtmp\_backend\_autoscaling\_group\_name) | The rtmp backend ASG name. | `string` | n/a | yes |
| [access\_logs\_enabled](#input\_access\_logs\_enabled) | Wether to enable elb access logs or not. | `bool` | `false` | no |
| [access\_logs\_bucket\_name](#input\_access\_logs\_bucket\_name) | Override the access logs bucket name. | `string` | `""` | no |
| [access\_logs\_bucket\_prefix](#input\_access\_logs\_bucket\_prefix) | The access logs bucket prefix. Logs are stored in the root if not configured. | `string` | `null` | no |
| [access\_logs\_interval](#input\_access\_logs\_interval) | The publishing interval in minutes. | `number` | `60` | no |
| [access\_logs\_expiration](#input\_access\_logs\_expiration) | Specifies the number of days for which access logs are kept (indefinitely if not specified). | `number` | `null` | no |
| [access\_logs\_force\_destroy](#input\_access\_logs\_force\_destroy) | A boolean that indicates all objects should be deleted from the access logs bucket so that the bucket can be destroyed without error. These objects are not recoverable. | `bool` | `false` | no |
| [rtmps\_enabled](#input\_rtmps\_enabled) | Wether to enable rtmps. If set to true, a certificate will be created in certificate manager as well as load balancer configuration to perform ssl termination. | `bool` | `true` | no |
| [create\_cert](#input\_create\_cert) | Should the certificate be created by the module. If not, you must provide var.ssl\_certificate\_arn. | `bool` | `true` | no |
| [dns\_hosted\_zone\_id](#input\_dns\_hosted\_zone\_id) | The ID of the hosted zone in Route53, under which the DNS record should be created. | `string` | n/a | yes |
| [dns\_record](#input\_dns\_record) | The domain name record to add in zone defined by dns\_hosted\_zone\_id for alias on elb dns name. | `string` | `"rtmp"` | no |
| [ssl\_certificate\_arn](#input\_ssl\_certificate\_arn) | The ARN identifier of an existing Certificate in AWS Certificate Manager, to be used for RTMPS requests. If not defined, a new certificate will be issued and validated in the AWS Certificate Manager. | `string` | `null` | no |
| [ssl\_certificate\_name](#input\_ssl\_certificate\_name) | Override the cert manager certificate name. | `string` | `""` | no |
| [ssl\_certificate\_domain\_name](#input\_ssl\_certificate\_domain\_name) | The complete domain name that will be written in the TLS certificate. Can include a wildcard. Required for rtmps. | `string` | `null` | no |
| [tags](#input\_tags) | Tags to apply to resources. A list of key->value pairs. | `map(any)` | `{}` | no |
| [enable\_bucket\_encryption](#input\_enable\_bucket\_encryption) | Should the created bucket be encrypted using SSE-S3. | `bool` | `true` | no |

## Outputs

| Name | Description |
|------|-------------|
| [dns\_record](#output\_dns\_record) | The DNS record for the RTMP endpoint |

## Help

**Got a question?**

File a GitHub [issue](https://github.com/quortex/terraform-aws-cloudfront-realtime-data-analytics/issues).

[logo]: https://storage.googleapis.com/quortex-assets/logo.webp