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 = '{{ region }}' AND
Identifier = '{{ name }}';
Lists all streams in a region.
SELECT
region,
name
FROM awscc.kinesis.streams_list_only
WHERE
region = '{{ region }}';
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ 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 }}'
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: 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.kinesis.streams
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 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