destinations
Creates, updates, deletes or gets a destination resource or lists destinations in a region
Overview
| Name | destinations |
| Type | Resource |
| Description | The 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. |
| Id | awscc.logs.destinations |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | |
tags | array | An array of key-value pairs to apply to this resource. |
destination_name | string | The name of the destination resource |
destination_policy | string | An IAM policy document that governs which AWS accounts can create subscription filters against this destination. |
role_arn | string | The ARN of an IAM role that permits CloudWatch Logs to send data to the specified AWS resource |
target_arn | string | The ARN of the physical target where the log events are delivered (for example, a Kinesis stream) |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
destination_name | string | The name of the destination resource |
region | string | AWS region. |
For more information, see AWS::Logs::Destination.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | destinations | INSERT | DestinationName, TargetArn, RoleArn, region |
delete_resource | destinations | DELETE | Identifier, region |
update_resource | destinations | UPDATE | Identifier, PatchDocument, region |
list_resources | destinations_list_only | SELECT | region |
get_resource | destinations | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all destinations in a region.
SELECT
region,
destination_name
FROM awscc.logs.destinations_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new destination resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ 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
;
/*+ create */
INSERT INTO awscc.logs.destinations (
Tags,
DestinationName,
DestinationPolicy,
RoleArn,
TargetArn,
region
)
SELECT
'{{ tags }}',
'{{ destination_name }}',
'{{ destination_policy }}',
'{{ role_arn }}',
'{{ target_arn }}',
'{{ 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: destination
props:
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: destination_name
value: '{{ destination_name }}'
- name: destination_policy
value: '{{ destination_policy }}'
- name: role_arn
value: '{{ role_arn }}'
- name: target_arn
value: '{{ target_arn }}'
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:
| 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 destinations resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
logs:PutDestination,
logs:PutDestinationPolicy,
logs:DescribeDestinations,
logs:TagResource,
iam:PassRole
logs:DescribeDestinations,
logs:ListTagsForResource
logs:PutDestination,
logs:PutDestinationPolicy,
logs:DescribeDestinations,
logs:TagResource,
logs:UntagResource,
logs:ListTagsForResource,
iam:PassRole
logs:DeleteDestination
logs:DescribeDestinations,
logs:ListTagsForResource