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 | awscc.vpclattice.target_groups |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
arn | string | |
region | string | AWS region. |
For more information, see AWS::VpcLattice::TargetGroup.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | target_groups | INSERT | Type, region |
delete_resource | target_groups | DELETE | Identifier, region |
update_resource | target_groups | UPDATE | Identifier, PatchDocument, region |
list_resources | target_groups_list_only | SELECT | region |
get_resource | target_groups | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all target_groups in a region.
SELECT
region,
arn
FROM awscc.vpclattice.target_groups_list_only
WHERE
region = 'us-east-1';
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 awscc.vpclattice.target_groups (
Type,
region
)
SELECT
'{{ type }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.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 }}'
protocol_version: '{{ protocol_version }}'
ip_address_type: '{{ ip_address_type }}'
lambda_event_structure_version: '{{ lambda_event_structure_version }}'
vpc_identifier: '{{ vpc_identifier }}'
health_check:
enabled: '{{ enabled }}'
protocol: '{{ protocol }}'
protocol_version: '{{ protocol_version }}'
port: '{{ port }}'
path: '{{ path }}'
health_check_interval_seconds: '{{ health_check_interval_seconds }}'
health_check_timeout_seconds: '{{ health_check_timeout_seconds }}'
healthy_threshold_count: '{{ healthy_threshold_count }}'
unhealthy_threshold_count: '{{ unhealthy_threshold_count }}'
matcher:
http_code: '{{ http_code }}'
- name: name
value: '{{ name }}'
- name: type
value: '{{ type }}'
- name: targets
value:
- id: '{{ id }}'
port: '{{ port }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
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:
- Create
- Read
- Update
- Delete
- List
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
vpc-lattice:GetTargetGroup,
vpc-lattice:ListTargets,
vpc-lattice:ListTagsForResource
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
vpc-lattice:DeleteTargetGroup,
vpc-lattice:GetTargetGroup,
vpc-lattice:DeregisterTargets,
vpc-lattice:ListTargets,
lambda:RemovePermission
vpc-lattice:ListTargetGroups