traffic_mirror_targets
Creates, updates, deletes or gets a traffic_mirror_target resource or lists traffic_mirror_targets in a region
Overview
| Name | traffic_mirror_targets |
| Type | Resource |
| Description | The description of the Traffic Mirror target. |
| Id | awscc.ec2.traffic_mirror_targets |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
network_load_balancer_arn | string | The Amazon Resource Name (ARN) of the Network Load Balancer that is associated with the target. |
description | string | The description of the Traffic Mirror target. |
id | string | |
network_interface_id | string | The network interface ID that is associated with the target. |
gateway_load_balancer_endpoint_id | string | The ID of the Gateway Load Balancer endpoint. |
tags | array | The tags to assign to the Traffic Mirror target. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | |
region | string | AWS region. |
For more information, see AWS::EC2::TrafficMirrorTarget.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | traffic_mirror_targets | INSERT | region |
delete_resource | traffic_mirror_targets | DELETE | Identifier, region |
update_resource | traffic_mirror_targets | UPDATE | Identifier, PatchDocument, region |
list_resources | traffic_mirror_targets_list_only | SELECT | region |
get_resource | traffic_mirror_targets | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual traffic_mirror_target.
SELECT
region,
network_load_balancer_arn,
description,
id,
network_interface_id,
gateway_load_balancer_endpoint_id,
tags
FROM awscc.ec2.traffic_mirror_targets
WHERE
region = 'us-east-1' AND
Identifier = '{{ id }}';
Lists all traffic_mirror_targets in a region.
SELECT
region,
id
FROM awscc.ec2.traffic_mirror_targets_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new traffic_mirror_target resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ec2.traffic_mirror_targets (
NetworkLoadBalancerArn,
Description,
NetworkInterfaceId,
GatewayLoadBalancerEndpointId,
Tags,
region
)
SELECT
'{{ network_load_balancer_arn }}',
'{{ description }}',
'{{ network_interface_id }}',
'{{ gateway_load_balancer_endpoint_id }}',
'{{ tags }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.ec2.traffic_mirror_targets (
NetworkLoadBalancerArn,
Description,
NetworkInterfaceId,
GatewayLoadBalancerEndpointId,
Tags,
region
)
SELECT
'{{ network_load_balancer_arn }}',
'{{ description }}',
'{{ network_interface_id }}',
'{{ gateway_load_balancer_endpoint_id }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: traffic_mirror_target
props:
- name: network_load_balancer_arn
value: '{{ network_load_balancer_arn }}'
- name: description
value: '{{ description }}'
- name: network_interface_id
value: '{{ network_interface_id }}'
- name: gateway_load_balancer_endpoint_id
value: '{{ gateway_load_balancer_endpoint_id }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a traffic_mirror_target resource, using stack-deploy.
/*+ update */
UPDATE awscc.ec2.traffic_mirror_targets
SET PatchDocument = string('{{ {
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.traffic_mirror_targets
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1';
Permissions
To operate on the traffic_mirror_targets resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
ec2:CreateTrafficMirrorTarget,
ec2:CreateTags
ec2:DescribeTrafficMirrorTargets,
ec2:DescribeTags
ec2:DescribeTrafficMirrorTargets,
ec2:CreateTags,
ec2:DeleteTags,
ec2:DescribeTags
ec2:DeleteTrafficMirrorTarget,
ec2:DeleteTags
ec2:DescribeTrafficMirrorTargets,
ec2:DescribeTags