target_groups
Creates, updates, deletes, gets or lists a target_groups resource.
Overview
| Name | target_groups |
| Type | Resource |
| Id | aws.vpc_lattice.target_groups |
Fields
The following fields are returned by SELECT queries:
- get_target_group
- list_target_groups
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the target group. (pattern: <code>tg-[0-9a-z]{17}</code>) |
name | string | The name of the target group. (pattern: <code>(?!tg-)(?![-])(?!.[-]$)(?!.[-]{2})[a-z0-9-]+</code>) |
arn | string | The Amazon Resource Name (ARN) of the target group. (pattern: <code>arn:[a-z0-9-]+:vpc-lattice:[a-zA-Z0-9-]+:\d{12}:targetgroup/tg-[0-9a-z]{17}</code>) |
config | object | Describes the configuration of a target group. For more information, see Target groups in the Amazon VPC Lattice User Guide. |
created_at | string (date-time) | The date and time that the target group was created, in ISO-8601 format. |
failure_code | string | The failure code. |
failure_message | string | The failure message. |
last_updated_at | string (date-time) | The date and time that the target group was last updated, in ISO-8601 format. |
service_arns | array | The Amazon Resource Names (ARNs) of the service. |
status | string | The status. (CREATE_IN_PROGRESS, ACTIVE, DELETE_IN_PROGRESS, CREATE_FAILED, DELETE_FAILED) |
type_ | string | The target group type. (IP, LAMBDA, INSTANCE, ALB) |
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the target group. (pattern: <code>tg-[0-9a-z]{17}</code>) |
name | string | The name of the target group. (pattern: <code>(?!tg-)(?![-])(?!.[-]$)(?!.[-]{2})[a-z0-9-]+</code>) |
arn | string | The ARN (Amazon Resource Name) of the target group. (pattern: <code>arn:[a-z0-9-]+:vpc-lattice:[a-zA-Z0-9-]+:\d{12}:targetgroup/tg-[0-9a-z]{17}</code>) |
created_at | string (date-time) | The date and time that the target group was created, in ISO-8601 format. |
ip_address_type | string | The type of IP address used for the target group. The possible values are IPV4 and IPV6. This is an optional parameter. If not specified, the default is IPV4. (IPV4, IPV6) |
lambda_event_structure_version | string | The version of the event structure that your Lambda function receives. Supported only if the target group type is LAMBDA. (V1, V2) |
last_updated_at | string (date-time) | The date and time that the target group was last updated, in ISO-8601 format. |
port | integer | The port of the target group. |
protocol | string | The protocol of the target group. (HTTP, HTTPS, TCP) |
service_arns | array | The Amazon Resource Names (ARNs) of the service. |
status | string | The status. (CREATE_IN_PROGRESS, ACTIVE, DELETE_IN_PROGRESS, CREATE_FAILED, DELETE_FAILED) |
type_ | string | The target group type. (IP, LAMBDA, INSTANCE, ALB) |
vpc_identifier | string | The ID of the VPC of the target group. (pattern: <code>vpc-(([0-9a-z]{8})|([0-9a-z]{17}))</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_target_group | select | target_group_identifier, region | Retrieves information about the specified target group. | |
list_target_groups | select | region | maxResults, nextToken, vpcIdentifier, targetGroupType | Lists your target groups. You can narrow your search by using the filters below in your request. |
create_target_group | insert | region, name, type | Creates a target group. A target group is a collection of targets, or compute resources, that run your application or service. A target group can only be used by a single service. For more information, see Target groups in the Amazon VPC Lattice User Guide. | |
update_target_group | update | target_group_identifier, region, healthCheck | Updates the specified target group. | |
delete_target_group | delete | target_group_identifier, region | Deletes a target group. You can't delete a target group if it is used in a listener rule or if the target group creation is in progress. |
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. |
targetGroupType | string | The target group type. |
vpcIdentifier | string | The ID or ARN of the VPC. |
SELECT examples
- get_target_group
- list_target_groups
Retrieves information about the specified target group.
SELECT
id,
name,
arn,
config,
created_at,
failure_code,
failure_message,
last_updated_at,
service_arns,
status,
type_
FROM aws.vpc_lattice.target_groups
WHERE target_group_identifier = '{{ target_group_identifier }}' -- required
AND region = '{{ region }}' -- required
;
Lists your target groups. You can narrow your search by using the filters below in your request.
SELECT
id,
name,
arn,
created_at,
ip_address_type,
lambda_event_structure_version,
last_updated_at,
port,
protocol,
service_arns,
status,
type_,
vpc_identifier
FROM aws.vpc_lattice.target_groups
WHERE region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
AND vpcIdentifier = '{{ vpcIdentifier }}'
AND targetGroupType = '{{ targetGroupType }}'
;
INSERT examples
- create_target_group
- Manifest
Creates a target group. A target group is a collection of targets, or compute resources, that run your application or service. A target group can only be used by a single service. For more information, see Target groups in the Amazon VPC Lattice User Guide.
INSERT INTO aws.vpc_lattice.target_groups (
name,
type,
config,
clientToken,
tags,
region
)
SELECT
'{{ name }}' /* required */,
'{{ type }}' /* required */,
'{{ config }}',
'{{ clientToken }}',
'{{ tags }}',
'{{ region }}'
RETURNING
id,
name,
arn,
config,
status,
type_
;
# Description fields are for documentation purposes
- name: target_groups
props:
- name: region
value: "{{ region }}"
description: Required parameter for the target_groups resource.
- name: name
value: "{{ name }}"
- name: type
value: "{{ type }}"
valid_values: ['IP', 'LAMBDA', 'INSTANCE', 'ALB']
- name: config
description: |
Describes the configuration of a target group. For more information, see Target groups in the Amazon VPC Lattice User Guide.
value:
port: {{ port }}
protocol: "{{ protocol }}"
protocolVersion: "{{ protocolVersion }}"
ipAddressType: "{{ ipAddressType }}"
vpcIdentifier: "{{ vpcIdentifier }}"
healthCheck:
enabled: {{ enabled }}
protocol: "{{ protocol }}"
protocolVersion: "{{ protocolVersion }}"
port: {{ port }}
path: "{{ path }}"
healthCheckIntervalSeconds: {{ healthCheckIntervalSeconds }}
healthCheckTimeoutSeconds: {{ healthCheckTimeoutSeconds }}
healthyThresholdCount: {{ healthyThresholdCount }}
unhealthyThresholdCount: {{ unhealthyThresholdCount }}
matcher:
httpCode: "{{ httpCode }}"
lambdaEventStructureVersion: "{{ lambdaEventStructureVersion }}"
- name: clientToken
value: "{{ clientToken }}"
- name: tags
value: "{{ tags }}"
UPDATE examples
- update_target_group
Updates the specified target group.
UPDATE aws.vpc_lattice.target_groups
SET
healthCheck = '{{ healthCheck }}'
WHERE
target_group_identifier = '{{ target_group_identifier }}' --required
AND region = '{{ region }}' --required
AND healthCheck = '{{ healthCheck }}' --required
RETURNING
id,
name,
arn,
config,
status,
type_;
DELETE examples
- delete_target_group
Deletes a target group. You can't delete a target group if it is used in a listener rule or if the target group creation is in progress.
DELETE FROM aws.vpc_lattice.target_groups
WHERE target_group_identifier = '{{ target_group_identifier }}' --required
AND region = '{{ region }}' --required
;