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 = '{{ region }}' 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.logs.destinations
WHERE
Identifier = '{{ destination_name }}' 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:

ParameterDescription
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 destinations resource, the following permissions are required:

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