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.
Idawscc.vpclattice.target_groups

Fields

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

For more information, see AWS::VpcLattice::TargetGroup.

Methods

NameResourceAccessible byRequired Params
create_resourcetarget_groupsINSERTType, region
delete_resourcetarget_groupsDELETEIdentifier, region
update_resourcetarget_groupsUPDATEIdentifier, PatchDocument, region
list_resourcestarget_groups_list_onlySELECTregion
get_resourcetarget_groupsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual target_group.

SELECT
region,
arn,
config,
created_at,
id,
last_updated_at,
name,
status,
type,
targets,
tags
FROM awscc.vpclattice.target_groups
WHERE
region = 'us-east-1' AND
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 awscc.vpclattice.target_groups (
Type,
region
)
SELECT
'{{ type }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a target_group resource, using stack-deploy.

/*+ update */
UPDATE awscc.vpclattice.target_groups
SET PatchDocument = string('{{ {
"Targets": targets,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.vpclattice.target_groups
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';

Permissions

To operate on the target_groups resource, the following permissions are required:

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