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 = '{{ region }}' AND
Identifier = '{{ id }}';
Lists all traffic_mirror_targets in a region.
SELECT
region,
id
FROM awscc.ec2.traffic_mirror_targets_list_only
WHERE
region = '{{ region }}';
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.traffic_mirror_targets
WHERE
Identifier = '{{ id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
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