Skip to main content

destinations

Creates, updates, deletes, gets or lists a destinations resource.

Overview

Namedestinations
TypeResource
Idaws.logs.destinations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
access_policystringAn IAM policy document that governs which Amazon Web Services accounts can create subscription filters against this destination.
arnstringThe ARN of this destination.
creation_timeinteger (int64)The creation time of the destination, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.
destination_namestringThe name of the destination. (pattern: <code>[^:]</code>)
role_arnstringA role for impersonation, used when delivering log events to the target.
target_arnstringThe Amazon Resource Name (ARN) of the physical target where the log events are delivered (for example, a Kinesis stream).

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_destinationsselectregionLists all your destinations. The results are ASCII-sorted by destination name.
put_destinationreplaceregion, destinationName, targetArn, roleArnCreates or updates a destination. This operation is used only to create destinations for cross-account subscriptions. A destination encapsulates a physical resource (such as an Amazon Kinesis stream). With a destination, you can subscribe to a real-time stream of log events for a different account, ingested using PutLogEvents. Through an access policy, a destination controls what is written to it. By default, PutDestination does not set any access policy with the destination, which means a cross-account user cannot call PutSubscriptionFilter against this destination. To enable this, the destination owner must call PutDestinationPolicy after PutDestination. To perform a PutDestination operation, you must also have the iam:PassRole permission.
put_destination_policyreplaceregion, destinationName, accessPolicyCreates or updates an access policy associated with an existing destination. An access policy is an IAM policy document that is used to authorize claims to register a subscription filter against a given destination.
delete_destinationdeleteregionDeletes the specified destination, and eventually disables all the subscription filters that publish to it. This operation does not delete the physical resource encapsulated by the destination.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Lists all your destinations. The results are ASCII-sorted by destination name.

SELECT
access_policy,
arn,
creation_time,
destination_name,
role_arn,
target_arn
FROM aws.logs.destinations
WHERE region = '{{ region }}' -- required
;

REPLACE examples

Creates or updates a destination. This operation is used only to create destinations for cross-account subscriptions. A destination encapsulates a physical resource (such as an Amazon Kinesis stream). With a destination, you can subscribe to a real-time stream of log events for a different account, ingested using PutLogEvents. Through an access policy, a destination controls what is written to it. By default, PutDestination does not set any access policy with the destination, which means a cross-account user cannot call PutSubscriptionFilter against this destination. To enable this, the destination owner must call PutDestinationPolicy after PutDestination. To perform a PutDestination operation, you must also have the iam:PassRole permission.

REPLACE aws.logs.destinations
SET
destinationName = '{{ destinationName }}',
targetArn = '{{ targetArn }}',
roleArn = '{{ roleArn }}',
tags = '{{ tags }}'
WHERE
region = '{{ region }}' --required
AND destinationName = '{{ destinationName }}' --required
AND targetArn = '{{ targetArn }}' --required
AND roleArn = '{{ roleArn }}' --required
RETURNING
destination;

DELETE examples

Deletes the specified destination, and eventually disables all the subscription filters that publish to it. This operation does not delete the physical resource encapsulated by the destination.

DELETE FROM aws.logs.destinations
WHERE region = '{{ region }}' --required
;