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.
Idawscc.logs.destinations

Fields

NameDatatypeDescription
arnstring
tagsarrayAn array of key-value pairs to apply to this resource.
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.

For more information, see AWS::Logs::Destination.

Methods

NameResourceAccessible byRequired Params
create_resourcedestinationsINSERTDestinationName, TargetArn, RoleArn, region
delete_resourcedestinationsDELETEIdentifier, region
update_resourcedestinationsUPDATEIdentifier, PatchDocument, region
list_resourcesdestinations_list_onlySELECTregion
get_resourcedestinationsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual destination.

SELECT
region,
arn,
tags,
destination_name,
destination_policy,
role_arn,
target_arn
FROM awscc.logs.destinations
WHERE
region = 'us-east-1' AND
Identifier = '{{ destination_name }}';

INSERT example

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

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

UPDATE example

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

/*+ update */
UPDATE awscc.logs.destinations
SET PatchDocument = string('{{ {
"Tags": tags,
"DestinationPolicy": destination_policy,
"RoleArn": role_arn,
"TargetArn": target_arn
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ destination_name }}';

DELETE example

/*+ delete */
DELETE FROM awscc.logs.destinations
WHERE
Identifier = '{{ destination_name }}' AND
region = 'us-east-1';

Permissions

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

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