Skip to main content

streams

Creates, updates, deletes or gets a stream resource or lists streams in a region

Overview

Namestreams
TypeResource
DescriptionResource Type definition for AWS::Kinesis::Stream
Idawscc.kinesis.streams

Fields

NameDatatypeDescription
arnstringThe Amazon resource name (ARN) of the Kinesis stream
namestringThe name of the Kinesis stream.
desired_shard_level_metricsarrayThe final list of shard-level metrics
retention_period_hoursintegerThe number of hours for the data records that are stored in shards to remain accessible.
shard_countintegerThe number of shards that the stream uses. Required when StreamMode = PROVISIONED is passed.
stream_mode_detailsobjectThe mode in which the stream is running.
stream_encryptionobjectWhen specified, enables or updates server-side encryption using an AWS KMS key for a specified stream.
tagsarrayAn arbitrary set of tags (key–value pairs) to associate with the Kinesis stream.
regionstringAWS region.

For more information, see AWS::Kinesis::Stream.

Methods

NameResourceAccessible byRequired Params
create_resourcestreamsINSERTregion
delete_resourcestreamsDELETEIdentifier, region
update_resourcestreamsUPDATEIdentifier, PatchDocument, region
list_resourcesstreams_list_onlySELECTregion
get_resourcestreamsSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new stream resource, using stack-deploy.

/*+ 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
;

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:

ParameterDescription
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:

kinesis:EnableEnhancedMonitoring,
kinesis:DescribeStreamSummary,
kinesis:CreateStream,
kinesis:IncreaseStreamRetentionPeriod,
kinesis:StartStreamEncryption,
kinesis:AddTagsToStream,
kinesis:ListTagsForStream,
kinesis:ListTagsForResource