lb_listener_rule: (object(lb_listener_rule)) All outputs of the created 'aws_lb_listener_rule' resource. module_enabled: (bool) Whether this module is enabled. module_tags: (map(string)) The map of tags that are being applied to all created resources that accept tags....
其中查了下AWS NLB listener 配置,确定需要使用TCP_UDP协议。 To support both TCP and UDP on the same port, create a TCP_UDP listener. The target groups for a TCP_UDP listener must use the TCP_UDP protocol. Terraform 代码如下: resource "aws_lb_target_group" "consul_nlb_tg" { name = "...
resource "aws_autoscaling_attachment" "asg_attachment_lb" { autoscaling_group_name = aws_autoscaling_group.ss.id lb_target_group_arn = aws_lb_target_group.ss_tg.arn } resource "aws_lb_listener" "ss" { load_balancer_arn = aws_lb.ss.arn port = var.lb_listener_port protocol = "TCP...
resource "aws_autoscaling_attachment" "asg_attachment_lb" { autoscaling_group_name = aws_autoscaling_group.ss.id lb_target_group_arn = aws_lb_target_group.ss_tg.arn } resource "aws_lb_listener" "ss" { load_balancer_arn = aws_lb.ss.arn port = var.lb_listener_port protocol = "TCP...
zone_id =data.aws_route53_zone.zone.zone_id name ="zk-${count.index +1}"type ="A"ttl =60records = element(aws_network_interface.zk.*.private_ips, count.index) } 复制代码 定义输出 在成功运行terraform apply后会输出 ZooKeeper 服务实例的 IP 及对应的域名。
provider "aws" { region = "cn-northwest-1" } #terraform init 3.2获取现有资源 1)获取VPC # terraformer import aws --resources=vpc 2)获取子网: # terraformer import aws --resources=subnet 3)获取igw,nat # terraformer import aws --resources=igw,nat ...
resource "aws_lb_target_group" "ss_tg" { name = "shardingsphere-proxy-lb-tg" port = var.lb_listener_port protocol = "TCP" vpc_id = var.vpc_id preserve_client_ip = false health_check { protocol = "TCP" healthy_threshold = 2 ...
EC2 竞价实例:使用aws_spot_instance_request资源类型来请求竞价实例。 Auto Scaling Group:使用aws_autoscaling_group资源类型来创建自动扩展组,以管理竞价实例的数量。 Load Balancer:使用aws_elb或aws_alb资源类型来创建负载均衡器,确保流量均匀分布到各个运行器实例。
resource "aws_lb" "web_app_alb" { name = "web-app-alb" internal = false load_balancer_type = "application" subnets = [var.vpc_subnet_id_1, var.vpc_subnet_id_2] # 设置安全组 security_groups = [var.security_group_id] # 定义监听器 listener { port = 80 protocol = "HTTP" default...
An Amazon ELB listener is a process that checks for connection requests and forwards traffic from the load balancer to the target groups. To create a listener with a certificate in Terraform, you can use the aws_lb_listener resource. In this example, we're creating a listener with the load...