log_streams
Creates, updates, deletes or gets a log_stream
resource or lists log_streams
in a region
Overview
Name | log_streams |
Type | Resource |
Description | Resource Type definition for AWS::Logs::LogStream |
Id | aws.logs.log_streams |
Fields
Name | Datatype | Description |
---|---|---|
log_stream_name | string | The name of the log stream. The name must be unique wihtin the log group. |
log_group_name | string | The name of the log group where the log stream is created. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | LogGroupName, region |
delete_resource | DELETE | data__Identifier, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all log_streams
in a region.
SELECT
region,
log_stream_name,
log_group_name
FROM aws.logs.log_streams
WHERE region = 'us-east-1';
Gets all properties from an individual log_stream
.
SELECT
region,
log_stream_name,
log_group_name
FROM aws.logs.log_streams
WHERE region = 'us-east-1' AND data__Identifier = '<LogGroupName>|<LogStreamName>';
INSERT
example
Use the following StackQL query and manifest file to create a new log_stream
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.logs.log_streams (
LogGroupName,
region
)
SELECT
'{{ LogGroupName }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.logs.log_streams (
LogStreamName,
LogGroupName,
region
)
SELECT
'{{ LogStreamName }}',
'{{ LogGroupName }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: log_stream
props:
- name: LogStreamName
value: '{{ LogStreamName }}'
- name: LogGroupName
value: '{{ LogGroupName }}'
DELETE
example
/*+ delete */
DELETE FROM aws.logs.log_streams
WHERE data__Identifier = '<LogGroupName|LogStreamName>'
AND region = 'us-east-1';
Permissions
To operate on the log_streams
resource, the following permissions are required:
Read
logs:DescribeLogStreams
Create
logs:CreateLogStream,
logs:DescribeLogStreams
List
logs:DescribeLogStreams
Delete
logs:DeleteLogStream