targets
Creates, updates, deletes, gets or lists a targets resource.
Overview
| Name | targets |
| Type | Resource |
| Id | aws.vpc_lattice.targets |
Fields
The following fields are returned by SELECT queries:
- list_targets
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the target. If the target group type is INSTANCE, this is an instance ID. If the target group type is IP, this is an IP address. If the target group type is LAMBDA, this is the ARN of a Lambda function. If the target type is ALB, this is the ARN of an Application Load Balancer. |
port | integer | The port on which the target is listening. |
reason_code | string | The code for why the target status is what it is. |
status | string | The status of the target. DRAINING: The target is being deregistered. No new connections are sent to this target while current connections are being drained. The default draining time is 1 minute. UNAVAILABLE: Health checks are unavailable for the target group. HEALTHY: The target is healthy. UNHEALTHY: The target is unhealthy. INITIAL: Initial health checks on the target are being performed. UNUSED: Target group is not used in a service. (DRAINING, UNAVAILABLE, HEALTHY, UNHEALTHY, INITIAL, UNUSED) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_targets | select | target_group_identifier, region | maxResults, nextToken | Lists the targets for the target group. By default, all targets are included. You can use this API to check the health status of targets. You can also filter the results by target. |
register_targets | insert | target_group_identifier, region, targets | Registers the targets with the target group. If it's a Lambda target, you can only have one target in a target group. | |
deregister_targets | delete | target_group_identifier, region | Deregisters the specified targets from the specified target group. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
target_group_identifier | string | The ID or ARN of the target group. |
maxResults | integer | The maximum number of results to return. |
nextToken | string | A pagination token for the next page of results. |
SELECT examples
- list_targets
Lists the targets for the target group. By default, all targets are included. You can use this API to check the health status of targets. You can also filter the results by target.
SELECT
id,
port,
reason_code,
status
FROM aws.vpc_lattice.targets
WHERE target_group_identifier = '{{ target_group_identifier }}' -- required
AND region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- register_targets
- Manifest
Registers the targets with the target group. If it's a Lambda target, you can only have one target in a target group.
INSERT INTO aws.vpc_lattice.targets (
targets,
target_group_identifier,
region
)
SELECT
'{{ targets }}' /* required */,
'{{ target_group_identifier }}',
'{{ region }}'
RETURNING
successful,
unsuccessful
;
# Description fields are for documentation purposes
- name: targets
props:
- name: target_group_identifier
value: "{{ target_group_identifier }}"
description: Required parameter for the targets resource.
- name: region
value: "{{ region }}"
description: Required parameter for the targets resource.
- name: targets
value:
- id: "{{ id }}"
port: {{ port }}
DELETE examples
- deregister_targets
Deregisters the specified targets from the specified target group.
DELETE FROM aws.vpc_lattice.targets
WHERE target_group_identifier = '{{ target_group_identifier }}' --required
AND region = '{{ region }}' --required
;