streams
Creates, updates, deletes or gets a stream resource or lists streams in a region
Overview
| Name | streams |
| Type | Resource |
| Description | Resource Type definition for AWS::Kinesis::Stream |
| Id | awscc.kinesis.streams |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon resource name (ARN) of the Kinesis stream |
name | string | The name of the Kinesis stream. |
desired_shard_level_metrics | array | The final list of shard-level metrics |
retention_period_hours | integer | The number of hours for the data records that are stored in shards to remain accessible. |
shard_count | integer | The number of shards that the stream uses. Required when StreamMode = PROVISIONED is passed. |
stream_mode_details | object | The mode in which the stream is running. |
stream_encryption | object | When specified, enables or updates server-side encryption using an AWS KMS key for a specified stream. |
tags | array | An arbitrary set of tags (key–value pairs) to associate with the Kinesis stream. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the Kinesis stream. |
region | string | AWS region. |
For more information, see AWS::Kinesis::Stream.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | streams | INSERT | region |
delete_resource | streams | DELETE | Identifier, region |
update_resource | streams | UPDATE | Identifier, PatchDocument, region |
list_resources | streams_list_only | SELECT | region |
get_resource | streams | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual stream.
SELECT
region,
arn,
name,
desired_shard_level_metrics,
retention_period_hours,
shard_count,
stream_mode_details,
stream_encryption,
tags
FROM awscc.kinesis.streams
WHERE
region = 'us-east-1' AND
Identifier = '{{ name }}';
Lists all streams in a region.
SELECT
region,
name
FROM awscc.kinesis.streams_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new stream resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.kinesis.streams (
Name,
DesiredShardLevelMetrics,
RetentionPeriodHours,
ShardCount,
StreamModeDetails,
StreamEncryption,
Tags,
region
)
SELECT
'{{ name }}',
'{{ desired_shard_level_metrics }}',
'{{ retention_period_hours }}',
'{{ shard_count }}',
'{{ stream_mode_details }}',
'{{ stream_encryption }}',
'{{ tags }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.kinesis.streams (
Name,
DesiredShardLevelMetrics,
RetentionPeriodHours,
ShardCount,
StreamModeDetails,
StreamEncryption,
Tags,
region
)
SELECT
'{{ name }}',
'{{ desired_shard_level_metrics }}',
'{{ retention_period_hours }}',
'{{ shard_count }}',
'{{ stream_mode_details }}',
'{{ stream_encryption }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: stream
props:
- name: name
value: '{{ name }}'
- name: desired_shard_level_metrics
value:
- '{{ desired_shard_level_metrics[0] }}'
- name: retention_period_hours
value: '{{ retention_period_hours }}'
- name: shard_count
value: '{{ shard_count }}'
- name: stream_mode_details
value:
stream_mode: '{{ stream_mode }}'
- name: stream_encryption
value:
encryption_type: '{{ encryption_type }}'
key_id: '{{ key_id }}'
- name: tags
value:
- value: '{{ value }}'
key: '{{ key }}'
UPDATE example
Use the following StackQL query and manifest file to update a stream resource, using stack-deploy.
/*+ update */
UPDATE awscc.kinesis.streams
SET PatchDocument = string('{{ {
"DesiredShardLevelMetrics": desired_shard_level_metrics,
"RetentionPeriodHours": retention_period_hours,
"ShardCount": shard_count,
"StreamModeDetails": stream_mode_details,
"StreamEncryption": stream_encryption,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}';
DELETE example
/*+ delete */
DELETE FROM awscc.kinesis.streams
WHERE
Identifier = '{{ name }}' AND
region = 'us-east-1';
Permissions
To operate on the streams resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
kinesis:EnableEnhancedMonitoring,
kinesis:DescribeStreamSummary,
kinesis:CreateStream,
kinesis:IncreaseStreamRetentionPeriod,
kinesis:StartStreamEncryption,
kinesis:AddTagsToStream,
kinesis:ListTagsForStream,
kinesis:ListTagsForResource
kinesis:DescribeStreamSummary,
kinesis:ListTagsForStream,
kinesis:ListTagsForResource
kinesis:EnableEnhancedMonitoring,
kinesis:DisableEnhancedMonitoring,
kinesis:DescribeStreamSummary,
kinesis:UpdateShardCount,
kinesis:UpdateStreamMode,
kinesis:IncreaseStreamRetentionPeriod,
kinesis:DecreaseStreamRetentionPeriod,
kinesis:StartStreamEncryption,
kinesis:StopStreamEncryption,
kinesis:AddTagsToStream,
kinesis:TagResource,
kinesis:RemoveTagsFromStream,
kinesis:UntagResource,
kinesis:ListTagsForStream,
kinesis:ListTagsForResource
kinesis:DescribeStreamSummary,
kinesis:DeleteStream,
kinesis:RemoveTagsFromStream,
kinesis:UntagResource
kinesis:ListStreams