delivery_sources
Creates, updates, deletes or gets a delivery_source
resource or lists delivery_sources
in a region
Overview
Name | delivery_sources |
Type | Resource |
Description | A delivery source is an AWS resource that sends logs to an AWS destination. The destination can be CloudWatch Logs, Amazon S3, or Kinesis Data Firehose. Only some AWS services support being configured as a delivery source. These services are listed as Supported [V2 Permissions] in the table at [Enabling logging from AWS services](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html). |
Id | aws.logs.delivery_sources |
Fields
Name | Datatype | Description |
---|---|---|
name | string | The unique name of the Log source. |
arn | string | The Amazon Resource Name (ARN) that uniquely identifies this delivery source. |
resource_arns | array | This array contains the ARN of the AWS resource that sends logs and is represented by this delivery source. Currently, only one ARN can be in the array. |
resource_arn | string | The ARN of the resource that will be sending the logs. |
service | string | The AWS service that is sending logs. |
log_type | string | The type of logs being delivered. Only mandatory when the resourceArn could match more than one. In such a case, the error message will contain all the possible options. |
tags | array | The tags that have been assigned to this delivery source. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Name, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all delivery_sources
in a region.
SELECT
region,
name,
arn,
resource_arns,
resource_arn,
service,
log_type,
tags
FROM aws.logs.delivery_sources
WHERE region = 'us-east-1';
Gets all properties from an individual delivery_source
.
SELECT
region,
name,
arn,
resource_arns,
resource_arn,
service,
log_type,
tags
FROM aws.logs.delivery_sources
WHERE region = 'us-east-1' AND data__Identifier = '<Name>';
INSERT
example
Use the following StackQL query and manifest file to create a new delivery_source
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.logs.delivery_sources (
Name,
region
)
SELECT
'{{ Name }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.logs.delivery_sources (
Name,
ResourceArn,
LogType,
Tags,
region
)
SELECT
'{{ Name }}',
'{{ ResourceArn }}',
'{{ LogType }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: delivery_source
props:
- name: Name
value: '{{ Name }}'
- name: ResourceArn
value: '{{ ResourceArn }}'
- name: LogType
value: '{{ LogType }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.logs.delivery_sources
WHERE data__Identifier = '<Name>'
AND region = 'us-east-1';
Permissions
To operate on the delivery_sources
resource, the following permissions are required:
Create
logs:PutDeliverySource,
logs:GetDeliverySource,
logs:ListTagsForResource,
logs:TagResource,
logs:AllowVendedLogDeliveryForResource,
codewhisperer:AllowVendedLogDeliveryForResource,
autoloop:AllowVendedLogDeliveryForResource,
workmail:AllowVendedLogDeliveryForResource
Read
logs:GetDeliverySource,
logs:ListTagsForResource
Update
logs:PutDeliverySource,
logs:GetDeliverySource,
logs:ListTagsForResource,
logs:TagResource,
logs:UntagResource
Delete
logs:DeleteDeliverySource
List
logs:DescribeDeliverySources