Terraform module to create and manage a Cosmic load balancer.
This module will create a public IP address and configure it as a load balancer in the specified network. It will also create a network ACL for the public IP and add the public ports and allowed CIDRs as ingress ACL rules, ensuring all configured load balancer rules have a corresponding allow rule in the public IP's ACL.
module "loadbalancer" {
source = "MissionCriticalCloud/loadbalancer/cosmic"
name = "MyApp"
network_id = cosmic_network.default.id
vpc_id = cosmic_vpc.default.id
services = {
http = {
allowed_cidrs = ["1.2.3.4/32"]
member_ids = cosmic_instance.default.*.id
private_port = 80
public_port = 80
protocol = "tcp"
}
https = {
allowed_cidrs = ["1.2.3.4/32"]
member_ids = cosmic_instance.default.*.id
private_port = 443
public_port = 443
protocol = "tcp"
}
}
}
Name | Version |
---|---|
terraform | >= 0.13 |
Name | Version |
---|---|
cosmic | n/a |
Name | Description | Type | Default | Required |
---|---|---|---|---|
name | Name of load balancer and ACL | string |
n/a | yes |
network_id | VPC network ID | string |
n/a | yes |
services | n/a | map(object({ |
n/a | yes |
vpc_id | VPC ID | string |
n/a | yes |
Name | Description |
---|---|
acl_id | ACL ID |
ip_address | IP address |