Skip to content

Commit

Permalink
feat(client-kinesis): This release includes support to add tags when …
Browse files Browse the repository at this point in the history
…creating a stream
  • Loading branch information
awstools committed Sep 24, 2024
1 parent 3a5d854 commit 8212995
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 5 deletions.
8 changes: 8 additions & 0 deletions clients/client-kinesis/src/commands/CreateStreamCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ export interface CreateStreamCommandOutput extends __MetadataBearer {}
* <p>
* <a>CreateStream</a> has a limit of five transactions per second per
* account.</p>
* <p>You can add tags to the stream when making a <code>CreateStream</code> request by
* setting the <code>Tags</code> parameter. If you pass <code>Tags</code> parameter, in
* addition to having <code>kinesis:createStream</code> permission, you must also have
* <code>kinesis:addTagsToStream</code> permission for the stream that will be created.
* Tags will take effect from the <code>CREATING</code> status of the stream. </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand All @@ -84,6 +89,9 @@ export interface CreateStreamCommandOutput extends __MetadataBearer {}
* StreamModeDetails: { // StreamModeDetails
* StreamMode: "PROVISIONED" || "ON_DEMAND", // required
* },
* Tags: { // TagMap
* "<keys>": "STRING_VALUE",
* },
* };
* const command = new CreateStreamCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export interface GetResourcePolicyCommandOutput extends GetResourcePolicyOutput,
* <p>The requested resource exceeds the maximum number allowed, or the number of concurrent
* stream requests exceeds the maximum number allowed. </p>
*
* @throws {@link ResourceInUseException} (client fault)
* <p>The resource is not available for this operation. For successful operation, the
* resource must be in the <code>ACTIVE</code> state.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The requested resource could not be found. The stream might not be specified
* correctly.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface RegisterStreamConsumerCommandOutput extends RegisterStreamConsu
* read from the same stream.</p>
* <p>You can register up to 20 consumers per stream. A given consumer can only be
* registered with one stream at a time.</p>
* <p>For an example of how to use this operations, see <a href="/streams/latest/dev/building-enhanced-consumers-api.html">Enhanced Fan-Out
* <p>For an example of how to use this operation, see <a href="https://docs.aws.amazon.com/streams/latest/dev/building-enhanced-consumers-api.html">Enhanced Fan-Out
* Using the Kinesis Data Streams API</a>.</p>
* <p>The use of this operation has a limit of five transactions per second per account.
* Also, only 5 consumers can be created simultaneously. In other words, you cannot have
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface SubscribeToShardCommandOutput extends SubscribeToShardOutput, _
* seconds or more after a successful call, the second call takes over the subscription and
* the previous connection expires or fails with a
* <code>ResourceInUseException</code>.</p>
* <p>For an example of how to use this operations, see <a href="/streams/latest/dev/building-enhanced-consumers-api.html">Enhanced Fan-Out
* <p>For an example of how to use this operation, see <a href="https://docs.aws.amazon.com/streams/latest/dev/building-enhanced-consumers-api.html">Enhanced Fan-Out
* Using the Kinesis Data Streams API</a>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
6 changes: 6 additions & 0 deletions clients/client-kinesis/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,12 @@ export interface CreateStreamInput {
* @public
*/
StreamModeDetails?: StreamModeDetails;

/**
* <p>A set of up to 10 key-value pairs to use to create the tags.</p>
* @public
*/
Tags?: Record<string, string>;
}

/**
Expand Down
15 changes: 12 additions & 3 deletions codegen/sdk-codegen/aws-models/kinesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
}
],
"traits": {
"smithy.api#documentation": "<p>Creates a Kinesis data stream. A stream captures and transports data records that are\n continuously emitted from different data sources or <i>producers</i>.\n Scale-out within a stream is explicitly supported by means of shards, which are uniquely\n identified groups of data records in a stream.</p>\n <p>You can create your data stream using either on-demand or provisioned capacity mode.\n Data streams with an on-demand mode require no capacity planning and automatically scale\n to handle gigabytes of write and read throughput per minute. With the on-demand mode,\n Kinesis Data Streams automatically manages the shards in order to provide the necessary\n throughput. For the data streams with a provisioned mode, you must specify the number of\n shards for the data stream. Each shard can support reads up to five transactions per\n second, up to a maximum data read total of 2 MiB per second. Each shard can support\n writes up to 1,000 records per second, up to a maximum data write total of 1 MiB per\n second. If the amount of data input increases or decreases, you can add or remove\n shards.</p>\n <p>The stream name identifies the stream. The name is scoped to the Amazon Web Services\n account used by the application. It is also scoped by Amazon Web Services Region. That\n is, two streams in two different accounts can have the same name, and two streams in the\n same account, but in two different Regions, can have the same name.</p>\n <p>\n <code>CreateStream</code> is an asynchronous operation. Upon receiving a\n <code>CreateStream</code> request, Kinesis Data Streams immediately returns and sets\n the stream status to <code>CREATING</code>. After the stream is created, Kinesis Data\n Streams sets the stream status to <code>ACTIVE</code>. You should perform read and write\n operations only on an <code>ACTIVE</code> stream. </p>\n <p>You receive a <code>LimitExceededException</code> when making a\n <code>CreateStream</code> request when you try to do one of the following:</p>\n <ul>\n <li>\n <p>Have more than five streams in the <code>CREATING</code> state at any point in\n time.</p>\n </li>\n <li>\n <p>Create more shards than are authorized for your account.</p>\n </li>\n </ul>\n <p>For the default shard limit for an Amazon Web Services account, see <a href=\"https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html\">Amazon\n Kinesis Data Streams Limits</a> in the <i>Amazon Kinesis Data Streams\n Developer Guide</i>. To increase this limit, <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html\">contact Amazon Web Services\n Support</a>.</p>\n <p>You can use <a>DescribeStreamSummary</a> to check the stream status, which\n is returned in <code>StreamStatus</code>.</p>\n <p>\n <a>CreateStream</a> has a limit of five transactions per second per\n account.</p>"
"smithy.api#documentation": "<p>Creates a Kinesis data stream. A stream captures and transports data records that are\n continuously emitted from different data sources or <i>producers</i>.\n Scale-out within a stream is explicitly supported by means of shards, which are uniquely\n identified groups of data records in a stream.</p>\n <p>You can create your data stream using either on-demand or provisioned capacity mode.\n Data streams with an on-demand mode require no capacity planning and automatically scale\n to handle gigabytes of write and read throughput per minute. With the on-demand mode,\n Kinesis Data Streams automatically manages the shards in order to provide the necessary\n throughput. For the data streams with a provisioned mode, you must specify the number of\n shards for the data stream. Each shard can support reads up to five transactions per\n second, up to a maximum data read total of 2 MiB per second. Each shard can support\n writes up to 1,000 records per second, up to a maximum data write total of 1 MiB per\n second. If the amount of data input increases or decreases, you can add or remove\n shards.</p>\n <p>The stream name identifies the stream. The name is scoped to the Amazon Web Services\n account used by the application. It is also scoped by Amazon Web Services Region. That\n is, two streams in two different accounts can have the same name, and two streams in the\n same account, but in two different Regions, can have the same name.</p>\n <p>\n <code>CreateStream</code> is an asynchronous operation. Upon receiving a\n <code>CreateStream</code> request, Kinesis Data Streams immediately returns and sets\n the stream status to <code>CREATING</code>. After the stream is created, Kinesis Data\n Streams sets the stream status to <code>ACTIVE</code>. You should perform read and write\n operations only on an <code>ACTIVE</code> stream. </p>\n <p>You receive a <code>LimitExceededException</code> when making a\n <code>CreateStream</code> request when you try to do one of the following:</p>\n <ul>\n <li>\n <p>Have more than five streams in the <code>CREATING</code> state at any point in\n time.</p>\n </li>\n <li>\n <p>Create more shards than are authorized for your account.</p>\n </li>\n </ul>\n <p>For the default shard limit for an Amazon Web Services account, see <a href=\"https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html\">Amazon\n Kinesis Data Streams Limits</a> in the <i>Amazon Kinesis Data Streams\n Developer Guide</i>. To increase this limit, <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html\">contact Amazon Web Services\n Support</a>.</p>\n <p>You can use <a>DescribeStreamSummary</a> to check the stream status, which\n is returned in <code>StreamStatus</code>.</p>\n <p>\n <a>CreateStream</a> has a limit of five transactions per second per\n account.</p>\n <p>You can add tags to the stream when making a <code>CreateStream</code> request by\n setting the <code>Tags</code> parameter. If you pass <code>Tags</code> parameter, in\n addition to having <code>kinesis:createStream</code> permission, you must also have\n <code>kinesis:addTagsToStream</code> permission for the stream that will be created.\n Tags will take effect from the <code>CREATING</code> status of the stream. </p>"
}
},
"com.amazonaws.kinesis#CreateStreamInput": {
Expand All @@ -324,6 +324,12 @@
"traits": {
"smithy.api#documentation": "<p> Indicates the capacity mode of the data stream. Currently, in Kinesis Data Streams,\n you can choose between an <b>on-demand</b> capacity mode and a\n <b>provisioned</b> capacity mode for your data\n streams.</p>"
}
},
"Tags": {
"target": "com.amazonaws.kinesis#TagMap",
"traits": {
"smithy.api#documentation": "<p>A set of up to 10 key-value pairs to use to create the tags.</p>"
}
}
},
"traits": {
Expand Down Expand Up @@ -1296,6 +1302,9 @@
{
"target": "com.amazonaws.kinesis#LimitExceededException"
},
{
"target": "com.amazonaws.kinesis#ResourceInUseException"
},
{
"target": "com.amazonaws.kinesis#ResourceNotFoundException"
}
Expand Down Expand Up @@ -6924,7 +6933,7 @@
}
],
"traits": {
"smithy.api#documentation": "<p>Registers a consumer with a Kinesis data stream. When you use this operation, the\n consumer you register can then call <a>SubscribeToShard</a> to receive data\n from the stream using enhanced fan-out, at a rate of up to 2 MiB per second for every\n shard you subscribe to. This rate is unaffected by the total number of consumers that\n read from the same stream.</p>\n <p>You can register up to 20 consumers per stream. A given consumer can only be\n registered with one stream at a time.</p>\n <p>For an example of how to use this operations, see <a href=\"/streams/latest/dev/building-enhanced-consumers-api.html\">Enhanced Fan-Out\n Using the Kinesis Data Streams API</a>.</p>\n <p>The use of this operation has a limit of five transactions per second per account.\n Also, only 5 consumers can be created simultaneously. In other words, you cannot have\n more than 5 consumers in a <code>CREATING</code> status at the same time. Registering a\n 6th consumer while there are 5 in a <code>CREATING</code> status results in a\n <code>LimitExceededException</code>.</p>",
"smithy.api#documentation": "<p>Registers a consumer with a Kinesis data stream. When you use this operation, the\n consumer you register can then call <a>SubscribeToShard</a> to receive data\n from the stream using enhanced fan-out, at a rate of up to 2 MiB per second for every\n shard you subscribe to. This rate is unaffected by the total number of consumers that\n read from the same stream.</p>\n <p>You can register up to 20 consumers per stream. A given consumer can only be\n registered with one stream at a time.</p>\n <p>For an example of how to use this operation, see <a href=\"https://docs.aws.amazon.com/streams/latest/dev/building-enhanced-consumers-api.html\">Enhanced Fan-Out\n Using the Kinesis Data Streams API</a>.</p>\n <p>The use of this operation has a limit of five transactions per second per account.\n Also, only 5 consumers can be created simultaneously. In other words, you cannot have\n more than 5 consumers in a <code>CREATING</code> status at the same time. Registering a\n 6th consumer while there are 5 in a <code>CREATING</code> status results in a\n <code>LimitExceededException</code>.</p>",
"smithy.rules#staticContextParams": {
"OperationType": {
"value": "control"
Expand Down Expand Up @@ -7884,7 +7893,7 @@
}
],
"traits": {
"smithy.api#documentation": "<p>This operation establishes an HTTP/2 connection between the consumer you specify in\n the <code>ConsumerARN</code> parameter and the shard you specify in the\n <code>ShardId</code> parameter. After the connection is successfully established,\n Kinesis Data Streams pushes records from the shard to the consumer over this connection.\n Before you call this operation, call <a>RegisterStreamConsumer</a> to\n register the consumer with Kinesis Data Streams.</p>\n <p>When the <code>SubscribeToShard</code> call succeeds, your consumer starts receiving\n events of type <a>SubscribeToShardEvent</a> over the HTTP/2 connection for up\n to 5 minutes, after which time you need to call <code>SubscribeToShard</code> again to\n renew the subscription if you want to continue to receive records.</p>\n <p>You can make one call to <code>SubscribeToShard</code> per second per registered\n consumer per shard. For example, if you have a 4000 shard stream and two registered\n stream consumers, you can make one <code>SubscribeToShard</code> request per second for\n each combination of shard and registered consumer, allowing you to subscribe both\n consumers to all 4000 shards in one second. </p>\n <p>If you call <code>SubscribeToShard</code> again with the same <code>ConsumerARN</code>\n and <code>ShardId</code> within 5 seconds of a successful call, you'll get a\n <code>ResourceInUseException</code>. If you call <code>SubscribeToShard</code> 5\n seconds or more after a successful call, the second call takes over the subscription and\n the previous connection expires or fails with a\n <code>ResourceInUseException</code>.</p>\n <p>For an example of how to use this operations, see <a href=\"/streams/latest/dev/building-enhanced-consumers-api.html\">Enhanced Fan-Out\n Using the Kinesis Data Streams API</a>.</p>",
"smithy.api#documentation": "<p>This operation establishes an HTTP/2 connection between the consumer you specify in\n the <code>ConsumerARN</code> parameter and the shard you specify in the\n <code>ShardId</code> parameter. After the connection is successfully established,\n Kinesis Data Streams pushes records from the shard to the consumer over this connection.\n Before you call this operation, call <a>RegisterStreamConsumer</a> to\n register the consumer with Kinesis Data Streams.</p>\n <p>When the <code>SubscribeToShard</code> call succeeds, your consumer starts receiving\n events of type <a>SubscribeToShardEvent</a> over the HTTP/2 connection for up\n to 5 minutes, after which time you need to call <code>SubscribeToShard</code> again to\n renew the subscription if you want to continue to receive records.</p>\n <p>You can make one call to <code>SubscribeToShard</code> per second per registered\n consumer per shard. For example, if you have a 4000 shard stream and two registered\n stream consumers, you can make one <code>SubscribeToShard</code> request per second for\n each combination of shard and registered consumer, allowing you to subscribe both\n consumers to all 4000 shards in one second. </p>\n <p>If you call <code>SubscribeToShard</code> again with the same <code>ConsumerARN</code>\n and <code>ShardId</code> within 5 seconds of a successful call, you'll get a\n <code>ResourceInUseException</code>. If you call <code>SubscribeToShard</code> 5\n seconds or more after a successful call, the second call takes over the subscription and\n the previous connection expires or fails with a\n <code>ResourceInUseException</code>.</p>\n <p>For an example of how to use this operation, see <a href=\"https://docs.aws.amazon.com/streams/latest/dev/building-enhanced-consumers-api.html\">Enhanced Fan-Out\n Using the Kinesis Data Streams API</a>.</p>",
"smithy.rules#staticContextParams": {
"OperationType": {
"value": "data"
Expand Down

0 comments on commit 8212995

Please sign in to comment.