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 = 'us-east-1' AND
Identifier = '{{ destination_name }}';
Lists all destinations in a region.
SELECT
region,
destination_name
FROM awscc.logs.destinations_list_only
WHERE
region = 'us-east-1';
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 }}';
/*+ create */
INSERT INTO awscc.logs.destinations (
Tags,
DestinationName,
DestinationPolicy,
RoleArn,
TargetArn,
region
)
SELECT
'{{ tags }}',
'{{ destination_name }}',
'{{ destination_policy }}',
'{{ role_arn }}',
'{{ target_arn }}',
'{{ region }}';
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 }}';
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:
- 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