Fragmentos de plantillas de Elastic Load Balancing
Recurso del balanceador de carga de Elastic Load Balancing
Este ejemplo muestra un balanceador de carga de Elastic Load Balancing con un único agente de escucha y ninguna instancia.
JSON
"MyLoadBalancer" : { "Type" : "AWS::ElasticLoadBalancing::LoadBalancer", "Properties" : { "AvailabilityZones" : [ "us-east-1a" ], "Listeners" : [ { "LoadBalancerPort" : "80", "InstancePort" : "80", "Protocol" : "HTTP" } ] } }
YAML
MyLoadBalancer: Type: AWS::ElasticLoadBalancing::LoadBalancer Properties: AvailabilityZones: - "us-east-1a" Listeners: - LoadBalancerPort: '80' InstancePort: '80' Protocol: HTTP
Recurso del balanceador de carga de Elastic Load Balancing con comprobación de estado
En este ejemplo se muestra un balanceador de carga de Elastic Load Balancing con dos instancias Amazon EC2, un único agente de escucha y una comprobación de estado.
JSON
"MyLoadBalancer" : { "Type" : "AWS::ElasticLoadBalancing::LoadBalancer", "Properties" : { "AvailabilityZones" : [ "us-east-1a" ], "Instances" : [ { "Ref" : "
logical name of AWS::EC2::Instance resource 1
" }, { "Ref" : "logical name of AWS::EC2::Instance resource 2
" } ], "Listeners" : [ { "LoadBalancerPort" : "80", "InstancePort" : "80", "Protocol" : "HTTP" } ], "HealthCheck" : { "Target" : "HTTP:80/", "HealthyThreshold" : "3", "UnhealthyThreshold" : "5", "Interval" : "30", "Timeout" : "5" } } }
YAML
MyLoadBalancer: Type: AWS::ElasticLoadBalancing::LoadBalancer Properties: AvailabilityZones: - "us-east-1a" Instances: - Ref:
logical name of AWS::EC2::Instance resource 1
- Ref:logical name of AWS::EC2::Instance resource 2
Listeners: - LoadBalancerPort: '80' InstancePort: '80' Protocol: HTTP HealthCheck: Target: HTTP:80/ HealthyThreshold: '3' UnhealthyThreshold: '5' Interval: '30' Timeout: '5'