Skip to main content

destinations

Creates, updates, deletes or gets a destination resource or lists destinations in a region

Overview

Namedestinations
TypeResource
DescriptionThe AWS::Logs::Destination resource specifies a CloudWatch Logs destination. A destination encapsulates a physical resource (such as an Amazon Kinesis data stream) and enables you to subscribe that resource to a stream of log events.
Idaws.logs.destinations

Fields

NameDatatypeDescription
arnstring
destination_namestringThe name of the destination resource
destination_policystringAn IAM policy document that governs which AWS accounts can create subscription filters against this destination.
role_arnstringThe ARN of an IAM role that permits CloudWatch Logs to send data to the specified AWS resource
target_arnstringThe ARN of the physical target where the log events are delivered (for example, a Kinesis stream)
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTDestinationName, TargetArn, RoleArn, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all destinations in a region.

SELECT
region,
arn,
destination_name,
destination_policy,
role_arn,
target_arn
FROM aws.logs.destinations
WHERE region = 'us-east-1';

Gets all properties from an individual destination.

SELECT
region,
arn,
destination_name,
destination_policy,
role_arn,
target_arn
FROM aws.logs.destinations
WHERE region = 'us-east-1' AND data__Identifier = '<DestinationName>';

INSERT example

Use the following StackQL query and manifest file to create a new destination resource, using stack-deploy.

/*+ create */
INSERT INTO aws.logs.destinations (
DestinationName,
RoleArn,
TargetArn,
region
)
SELECT
'{{ DestinationName }}',
'{{ RoleArn }}',
'{{ TargetArn }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.logs.destinations
WHERE data__Identifier = '<DestinationName>'
AND region = 'us-east-1';

Permissions

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

Create

logs:PutDestination,
logs:PutDestinationPolicy,
logs:DescribeDestinations,
iam:PassRole

Read

logs:DescribeDestinations

Update

logs:PutDestination,
logs:PutDestinationPolicy,
logs:DescribeDestinations,
iam:PassRole

Delete

logs:DeleteDestination

List

logs:DescribeDestinations