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. |
| Id | awscc.logs.delivery_sources |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
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. |
| Name | Datatype | Description |
|---|---|---|
name | string | The unique name of the Log source. |
region | string | AWS region. |
For more information, see AWS::Logs::DeliverySource.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | delivery_sources | INSERT | Name, region |
delete_resource | delivery_sources | DELETE | Identifier, region |
update_resource | delivery_sources | UPDATE | Identifier, PatchDocument, region |
list_resources | delivery_sources_list_only | SELECT | region |
get_resource | delivery_sources | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual delivery_source.
SELECT
region,
name,
arn,
resource_arns,
resource_arn,
service,
log_type,
tags
FROM awscc.logs.delivery_sources
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}';
Lists all delivery_sources in a region.
SELECT
region,
name
FROM awscc.logs.delivery_sources_list_only
WHERE
region = '{{ region }}';
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 awscc.logs.delivery_sources (
Name,
region
)
SELECT
'{{ name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.logs.delivery_sources (
Name,
ResourceArn,
LogType,
Tags,
region
)
SELECT
'{{ name }}',
'{{ resource_arn }}',
'{{ log_type }}',
'{{ tags }}',
'{{ 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: delivery_source
props:
- name: name
value: '{{ name }}'
- name: resource_arn
value: '{{ resource_arn }}'
- name: log_type
value: '{{ log_type }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a delivery_source resource, using stack-deploy.
/*+ update */
UPDATE awscc.logs.delivery_sources
SET PatchDocument = string('{{ {
"ResourceArn": resource_arn,
"LogType": log_type,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.logs.delivery_sources
WHERE
Identifier = '{{ 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 delivery_sources resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
logs:PutDeliverySource,
logs:GetDeliverySource,
logs:ListTagsForResource,
logs:TagResource,
logs:AllowVendedLogDeliveryForResource,
codewhisperer:AllowVendedLogDeliveryForResource,
autoloop:AllowVendedLogDeliveryForResource,
workmail:AllowVendedLogDeliveryForResource
logs:GetDeliverySource,
logs:ListTagsForResource
logs:PutDeliverySource,
logs:GetDeliverySource,
logs:ListTagsForResource,
logs:TagResource,
logs:UntagResource
logs:DeleteDeliverySource
logs:DescribeDeliverySources