Skip to main content

target_groups

Creates, updates, deletes or gets a target_group resource or lists target_groups in a region

Overview

Nametarget_groups
TypeResource
DescriptionA 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.
Idaws.vpclattice.target_groups

Fields

NameDatatypeDescription
arnstring
configobject
created_atstring
idstring
last_updated_atstring
namestring
statusstring
typestring
targetsarray
tagsarray
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTType, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

/*+ create */
INSERT INTO aws.vpclattice.target_groups (
Type,
region
)
SELECT
'{{ Type }}',
'{{ region }}';

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