target_groups
Creates, updates, deletes or gets a target_group
resource or lists target_groups
in a region
Overview
Name | target_groups |
Type | Resource |
Description | 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. |
Id | aws.vpclattice.target_groups |
Fields
Name | Datatype | Description |
---|---|---|
arn | string | |
config | object | |
created_at | string | |
id | string | |
last_updated_at | string | |
name | string | |
status | string | |
type | string | |
targets | array | |
tags | array | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Type, 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 target_groups
in a region.
SELECT
region,
arn,
config,
created_at,
id,
last_updated_at,
name,
status,
type,
targets,
tags
FROM aws.vpclattice.target_groups
WHERE region = 'us-east-1';
Gets all properties from an individual target_group
.
SELECT
region,
arn,
config,
created_at,
id,
last_updated_at,
name,
status,
type,
targets,
tags
FROM aws.vpclattice.target_groups
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';
INSERT
example
Use the following StackQL query and manifest file to create a new target_group
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.vpclattice.target_groups (
Type,
region
)
SELECT
'{{ Type }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.vpclattice.target_groups (
Config,
Name,
Type,
Targets,
Tags,
region
)
SELECT
'{{ Config }}',
'{{ Name }}',
'{{ Type }}',
'{{ Targets }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: target_group
props:
- name: Config
value:
Port: '{{ Port }}'
Protocol: '{{ Protocol }}'
ProtocolVersion: '{{ ProtocolVersion }}'
IpAddressType: '{{ IpAddressType }}'
LambdaEventStructureVersion: '{{ LambdaEventStructureVersion }}'
VpcIdentifier: '{{ VpcIdentifier }}'
HealthCheck:
Enabled: '{{ Enabled }}'
Protocol: '{{ Protocol }}'
ProtocolVersion: '{{ ProtocolVersion }}'
Port: '{{ Port }}'
Path: '{{ Path }}'
HealthCheckIntervalSeconds: '{{ HealthCheckIntervalSeconds }}'
HealthCheckTimeoutSeconds: '{{ HealthCheckTimeoutSeconds }}'
HealthyThresholdCount: '{{ HealthyThresholdCount }}'
UnhealthyThresholdCount: '{{ UnhealthyThresholdCount }}'
Matcher:
HttpCode: '{{ HttpCode }}'
- name: Name
value: '{{ Name }}'
- name: Type
value: '{{ Type }}'
- name: Targets
value:
- Id: '{{ Id }}'
Port: '{{ Port }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.vpclattice.target_groups
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';
Permissions
To operate on the target_groups
resource, the following permissions are required:
Create
vpc-lattice:CreateTargetGroup,
vpc-lattice:GetTargetGroup,
vpc-lattice:RegisterTargets,
vpc-lattice:ListTargets,
vpc-lattice:ListTagsForResource,
vpc-lattice:TagResource,
vpc-lattice:UntagResource,
ec2:DescribeVpcs,
ec2:DescribeInstances,
ec2:DescribeSubnets,
ec2:DescribeAvailabilityZoneMappings,
lambda:Invoke,
lambda:AddPermission,
elasticloadbalancing:DescribeLoadBalancers,
iam:CreateServiceLinkedRole
Read
vpc-lattice:GetTargetGroup,
vpc-lattice:ListTargets,
vpc-lattice:ListTagsForResource
Update
vpc-lattice:UpdateTargetGroup,
vpc-lattice:GetTargetGroup,
vpc-lattice:ListTargets,
vpc-lattice:RegisterTargets,
vpc-lattice:DeregisterTargets,
ec2:DescribeVpcs,
ec2:DescribeInstances,
ec2:DescribeSubnets,
ec2:DescribeAvailabilityZoneMappings,
elasticloadbalancing:DescribeLoadBalancers,
lambda:Invoke,
lambda:RemovePermission,
lambda:AddPermission,
vpc-lattice:TagResource,
vpc-lattice:UntagResource,
vpc-lattice:ListTagsForResource
Delete
vpc-lattice:DeleteTargetGroup,
vpc-lattice:GetTargetGroup,
vpc-lattice:DeregisterTargets,
vpc-lattice:ListTargets,
lambda:RemovePermission
List
vpc-lattice:ListTargetGroups