load_balancers
Creates, updates, deletes or gets a load_balancer
resource or lists load_balancers
in a region
Overview
Name | load_balancers |
Type | Resource |
Description | Resource Type definition for AWS::Lightsail::LoadBalancer |
Id | aws.lightsail.load_balancers |
Fields
Name | Datatype | Description |
---|---|---|
load_balancer_name | string | The name of your load balancer. |
load_balancer_arn | string | |
instance_port | integer | The instance port where you're creating your load balancer. |
ip_address_type | string | The IP address type for the load balancer. The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. The default value is dualstack. |
attached_instances | array | The names of the instances attached to the load balancer. |
health_check_path | string | The path you provided to perform the load balancer health check. If you didn't specify a health check path, Lightsail uses the root path of your website (e.g., "/"). |
session_stickiness_enabled | boolean | Configuration option to enable session stickiness. |
session_stickiness_lb_cookie_duration_seconds | string | Configuration option to adjust session stickiness cookie duration parameter. |
tls_policy_name | string | The name of the TLS policy to apply to the load balancer. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | LoadBalancerName, InstancePort, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all load_balancers
in a region.
SELECT
region,
load_balancer_name,
load_balancer_arn,
instance_port,
ip_address_type,
attached_instances,
health_check_path,
session_stickiness_enabled,
session_stickiness_lb_cookie_duration_seconds,
tls_policy_name,
tags
FROM aws.lightsail.load_balancers
WHERE region = 'us-east-1';
Gets all properties from an individual load_balancer
.
SELECT
region,
load_balancer_name,
load_balancer_arn,
instance_port,
ip_address_type,
attached_instances,
health_check_path,
session_stickiness_enabled,
session_stickiness_lb_cookie_duration_seconds,
tls_policy_name,
tags
FROM aws.lightsail.load_balancers
WHERE region = 'us-east-1' AND data__Identifier = '<LoadBalancerName>';
INSERT
example
Use the following StackQL query and manifest file to create a new load_balancer
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.lightsail.load_balancers (
LoadBalancerName,
InstancePort,
region
)
SELECT
'{{ LoadBalancerName }}',
'{{ InstancePort }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.lightsail.load_balancers (
LoadBalancerName,
InstancePort,
IpAddressType,
AttachedInstances,
HealthCheckPath,
SessionStickinessEnabled,
SessionStickinessLBCookieDurationSeconds,
TlsPolicyName,
Tags,
region
)
SELECT
'{{ LoadBalancerName }}',
'{{ InstancePort }}',
'{{ IpAddressType }}',
'{{ AttachedInstances }}',
'{{ HealthCheckPath }}',
'{{ SessionStickinessEnabled }}',
'{{ SessionStickinessLBCookieDurationSeconds }}',
'{{ TlsPolicyName }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: load_balancer
props:
- name: LoadBalancerName
value: '{{ LoadBalancerName }}'
- name: InstancePort
value: '{{ InstancePort }}'
- name: IpAddressType
value: '{{ IpAddressType }}'
- name: AttachedInstances
value:
- '{{ AttachedInstances[0] }}'
- name: HealthCheckPath
value: '{{ HealthCheckPath }}'
- name: SessionStickinessEnabled
value: '{{ SessionStickinessEnabled }}'
- name: SessionStickinessLBCookieDurationSeconds
value: '{{ SessionStickinessLBCookieDurationSeconds }}'
- name: TlsPolicyName
value: '{{ TlsPolicyName }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.lightsail.load_balancers
WHERE data__Identifier = '<LoadBalancerName>'
AND region = 'us-east-1';
Permissions
To operate on the load_balancers
resource, the following permissions are required:
Create
lightsail:CreateLoadBalancer,
lightsail:GetLoadBalancer,
lightsail:GetLoadBalancers,
lightsail:GetInstance,
lightsail:AttachInstancesToLoadBalancer,
lightsail:DetachInstancesFromLoadBalancer,
lightsail:UpdateLoadBalancerAttribute,
lightsail:TagResource,
lightsail:UntagResource
Read
lightsail:GetLoadBalancer,
lightsail:GetLoadBalancers
Update
lightsail:GetLoadBalancer,
lightsail:GetLoadBalancers,
lightsail:GetInstance,
lightsail:AttachInstancesToLoadBalancer,
lightsail:DetachInstancesFromLoadBalancer,
lightsail:UpdateLoadBalancerAttribute,
lightsail:TagResource,
lightsail:UntagResource
Delete
lightsail:DeleteLoadBalancer,
lightsail:GetLoadBalancer,
lightsail:GetLoadBalancers
List
lightsail:GetLoadBalancers