Skip to content

Commit 942b693

Browse files
author
awstools
committed
feat(client-kinesis): Amazon KDS now supports tagging and attribute-based access control (ABAC) for enhanced fan-out consumers.
1 parent 219315a commit 942b693

16 files changed

+922
-70
lines changed

clients/client-kinesis/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,14 @@ ListStreams
357357

358358
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/kinesis/command/ListStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-kinesis/Interface/ListStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-kinesis/Interface/ListStreamsCommandOutput/)
359359

360+
</details>
361+
<details>
362+
<summary>
363+
ListTagsForResource
364+
</summary>
365+
366+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/kinesis/command/ListTagsForResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-kinesis/Interface/ListTagsForResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-kinesis/Interface/ListTagsForResourceCommandOutput/)
367+
360368
</details>
361369
<details>
362370
<summary>
@@ -445,6 +453,22 @@ SubscribeToShard
445453

446454
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/kinesis/command/SubscribeToShardCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-kinesis/Interface/SubscribeToShardCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-kinesis/Interface/SubscribeToShardCommandOutput/)
447455

456+
</details>
457+
<details>
458+
<summary>
459+
TagResource
460+
</summary>
461+
462+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/kinesis/command/TagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-kinesis/Interface/TagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-kinesis/Interface/TagResourceCommandOutput/)
463+
464+
</details>
465+
<details>
466+
<summary>
467+
UntagResource
468+
</summary>
469+
470+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/kinesis/command/UntagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-kinesis/Interface/UntagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-kinesis/Interface/UntagResourceCommandOutput/)
471+
448472
</details>
449473
<details>
450474
<summary>

clients/client-kinesis/src/Kinesis.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ import {
8585
ListStreamConsumersCommandOutput,
8686
} from "./commands/ListStreamConsumersCommand";
8787
import { ListStreamsCommand, ListStreamsCommandInput, ListStreamsCommandOutput } from "./commands/ListStreamsCommand";
88+
import {
89+
ListTagsForResourceCommand,
90+
ListTagsForResourceCommandInput,
91+
ListTagsForResourceCommandOutput,
92+
} from "./commands/ListTagsForResourceCommand";
8893
import {
8994
ListTagsForStreamCommand,
9095
ListTagsForStreamCommandInput,
@@ -124,6 +129,12 @@ import {
124129
SubscribeToShardCommandInput,
125130
SubscribeToShardCommandOutput,
126131
} from "./commands/SubscribeToShardCommand";
132+
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
133+
import {
134+
UntagResourceCommand,
135+
UntagResourceCommandInput,
136+
UntagResourceCommandOutput,
137+
} from "./commands/UntagResourceCommand";
127138
import {
128139
UpdateShardCountCommand,
129140
UpdateShardCountCommandInput,
@@ -156,6 +167,7 @@ const commands = {
156167
ListShardsCommand,
157168
ListStreamConsumersCommand,
158169
ListStreamsCommand,
170+
ListTagsForResourceCommand,
159171
ListTagsForStreamCommand,
160172
MergeShardsCommand,
161173
PutRecordCommand,
@@ -167,6 +179,8 @@ const commands = {
167179
StartStreamEncryptionCommand,
168180
StopStreamEncryptionCommand,
169181
SubscribeToShardCommand,
182+
TagResourceCommand,
183+
UntagResourceCommand,
170184
UpdateShardCountCommand,
171185
UpdateStreamModeCommand,
172186
};
@@ -464,6 +478,24 @@ export interface Kinesis {
464478
cb: (err: any, data?: ListStreamsCommandOutput) => void
465479
): void;
466480

481+
/**
482+
* @see {@link ListTagsForResourceCommand}
483+
*/
484+
listTagsForResource(): Promise<ListTagsForResourceCommandOutput>;
485+
listTagsForResource(
486+
args: ListTagsForResourceCommandInput,
487+
options?: __HttpHandlerOptions
488+
): Promise<ListTagsForResourceCommandOutput>;
489+
listTagsForResource(
490+
args: ListTagsForResourceCommandInput,
491+
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
492+
): void;
493+
listTagsForResource(
494+
args: ListTagsForResourceCommandInput,
495+
options: __HttpHandlerOptions,
496+
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
497+
): void;
498+
467499
/**
468500
* @see {@link ListTagsForStreamCommand}
469501
*/
@@ -628,6 +660,28 @@ export interface Kinesis {
628660
cb: (err: any, data?: SubscribeToShardCommandOutput) => void
629661
): void;
630662

663+
/**
664+
* @see {@link TagResourceCommand}
665+
*/
666+
tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise<TagResourceCommandOutput>;
667+
tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void;
668+
tagResource(
669+
args: TagResourceCommandInput,
670+
options: __HttpHandlerOptions,
671+
cb: (err: any, data?: TagResourceCommandOutput) => void
672+
): void;
673+
674+
/**
675+
* @see {@link UntagResourceCommand}
676+
*/
677+
untagResource(args: UntagResourceCommandInput, options?: __HttpHandlerOptions): Promise<UntagResourceCommandOutput>;
678+
untagResource(args: UntagResourceCommandInput, cb: (err: any, data?: UntagResourceCommandOutput) => void): void;
679+
untagResource(
680+
args: UntagResourceCommandInput,
681+
options: __HttpHandlerOptions,
682+
cb: (err: any, data?: UntagResourceCommandOutput) => void
683+
): void;
684+
631685
/**
632686
* @see {@link UpdateShardCountCommand}
633687
*/

clients/client-kinesis/src/KinesisClient.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ import {
105105
ListStreamConsumersCommandOutput,
106106
} from "./commands/ListStreamConsumersCommand";
107107
import { ListStreamsCommandInput, ListStreamsCommandOutput } from "./commands/ListStreamsCommand";
108+
import {
109+
ListTagsForResourceCommandInput,
110+
ListTagsForResourceCommandOutput,
111+
} from "./commands/ListTagsForResourceCommand";
108112
import { ListTagsForStreamCommandInput, ListTagsForStreamCommandOutput } from "./commands/ListTagsForStreamCommand";
109113
import { MergeShardsCommandInput, MergeShardsCommandOutput } from "./commands/MergeShardsCommand";
110114
import { PutRecordCommandInput, PutRecordCommandOutput } from "./commands/PutRecordCommand";
@@ -128,6 +132,8 @@ import {
128132
StopStreamEncryptionCommandOutput,
129133
} from "./commands/StopStreamEncryptionCommand";
130134
import { SubscribeToShardCommandInput, SubscribeToShardCommandOutput } from "./commands/SubscribeToShardCommand";
135+
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
136+
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
131137
import { UpdateShardCountCommandInput, UpdateShardCountCommandOutput } from "./commands/UpdateShardCountCommand";
132138
import { UpdateStreamModeCommandInput, UpdateStreamModeCommandOutput } from "./commands/UpdateStreamModeCommand";
133139
import {
@@ -164,6 +170,7 @@ export type ServiceInputTypes =
164170
| ListShardsCommandInput
165171
| ListStreamConsumersCommandInput
166172
| ListStreamsCommandInput
173+
| ListTagsForResourceCommandInput
167174
| ListTagsForStreamCommandInput
168175
| MergeShardsCommandInput
169176
| PutRecordCommandInput
@@ -175,6 +182,8 @@ export type ServiceInputTypes =
175182
| StartStreamEncryptionCommandInput
176183
| StopStreamEncryptionCommandInput
177184
| SubscribeToShardCommandInput
185+
| TagResourceCommandInput
186+
| UntagResourceCommandInput
178187
| UpdateShardCountCommandInput
179188
| UpdateStreamModeCommandInput;
180189

@@ -201,6 +210,7 @@ export type ServiceOutputTypes =
201210
| ListShardsCommandOutput
202211
| ListStreamConsumersCommandOutput
203212
| ListStreamsCommandOutput
213+
| ListTagsForResourceCommandOutput
204214
| ListTagsForStreamCommandOutput
205215
| MergeShardsCommandOutput
206216
| PutRecordCommandOutput
@@ -212,6 +222,8 @@ export type ServiceOutputTypes =
212222
| StartStreamEncryptionCommandOutput
213223
| StopStreamEncryptionCommandOutput
214224
| SubscribeToShardCommandOutput
225+
| TagResourceCommandOutput
226+
| UntagResourceCommandOutput
215227
| UpdateShardCountCommandOutput
216228
| UpdateStreamModeCommandOutput;
217229

clients/client-kinesis/src/commands/CreateStreamCommand.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ export interface CreateStreamCommandOutput extends __MetadataBearer {}
7272
* <p>
7373
* <a>CreateStream</a> has a limit of five transactions per second per
7474
* account.</p>
75-
* <p>You can add tags to the stream when making a <code>CreateStream</code> request by
76-
* setting the <code>Tags</code> parameter. If you pass <code>Tags</code> parameter, in
77-
* addition to having <code>kinesis:createStream</code> permission, you must also have
78-
* <code>kinesis:addTagsToStream</code> permission for the stream that will be created.
79-
* Tags will take effect from the <code>CREATING</code> status of the stream. </p>
75+
* <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 the <code>Tags</code> parameter, in addition to having the <code>kinesis:CreateStream</code> permission, you must also have the <code>kinesis:AddTagsToStream</code> permission for the stream that will be created. The <code>kinesis:TagResource</code> permission won’t work to tag streams on creation. Tags will take effect from the <code>CREATING</code> status of the stream, but you can't make any updates to the tags until the stream is in <code>ACTIVE</code> state.</p>
8076
* @example
8177
* Use a bare-bones client and the command you need to make an API call.
8278
* ```javascript

clients/client-kinesis/src/commands/GetRecordsCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ export interface GetRecordsCommandOutput extends GetRecordsOutput, __MetadataBea
135135
* @throws {@link ExpiredIteratorException} (client fault)
136136
* <p>The provided iterator exceeds the maximum age allowed.</p>
137137
*
138+
* @throws {@link InternalFailureException} (server fault)
139+
* <p>The processing of the request failed because of an unknown error, exception, or
140+
* failure.</p>
141+
*
138142
* @throws {@link InvalidArgumentException} (client fault)
139143
* <p>A specified parameter exceeds its restrictions, is not supported, or can't be used.
140144
* For more information, see the returned message.</p>

clients/client-kinesis/src/commands/GetShardIteratorCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ export interface GetShardIteratorCommandOutput extends GetShardIteratorOutput, _
9999
* <p>Specifies that you do not have the permissions required to perform this
100100
* operation.</p>
101101
*
102+
* @throws {@link InternalFailureException} (server fault)
103+
* <p>The processing of the request failed because of an unknown error, exception, or
104+
* failure.</p>
105+
*
102106
* @throws {@link InvalidArgumentException} (client fault)
103107
* <p>A specified parameter exceeds its restrictions, is not supported, or can't be used.
104108
* For more information, see the returned message.</p>
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { KinesisClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KinesisClient";
9+
import { ListTagsForResourceInput, ListTagsForResourceOutput } from "../models/models_0";
10+
import { de_ListTagsForResourceCommand, se_ListTagsForResourceCommand } from "../protocols/Aws_json1_1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link ListTagsForResourceCommand}.
21+
*/
22+
export interface ListTagsForResourceCommandInput extends ListTagsForResourceInput {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link ListTagsForResourceCommand}.
27+
*/
28+
export interface ListTagsForResourceCommandOutput extends ListTagsForResourceOutput, __MetadataBearer {}
29+
30+
/**
31+
* <p>List all tags added to the specified Kinesis resource. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources.</p>
32+
* <p>For more information about tagging Kinesis resources, see <a href="https://docs.aws.amazon.com/streams/latest/dev/tagging.html">Tag your Amazon Kinesis Data Streams resources</a>.</p>
33+
* @example
34+
* Use a bare-bones client and the command you need to make an API call.
35+
* ```javascript
36+
* import { KinesisClient, ListTagsForResourceCommand } from "@aws-sdk/client-kinesis"; // ES Modules import
37+
* // const { KinesisClient, ListTagsForResourceCommand } = require("@aws-sdk/client-kinesis"); // CommonJS import
38+
* const client = new KinesisClient(config);
39+
* const input = { // ListTagsForResourceInput
40+
* ResourceARN: "STRING_VALUE",
41+
* };
42+
* const command = new ListTagsForResourceCommand(input);
43+
* const response = await client.send(command);
44+
* // { // ListTagsForResourceOutput
45+
* // Tags: [ // TagList
46+
* // { // Tag
47+
* // Key: "STRING_VALUE", // required
48+
* // Value: "STRING_VALUE",
49+
* // },
50+
* // ],
51+
* // };
52+
*
53+
* ```
54+
*
55+
* @param ListTagsForResourceCommandInput - {@link ListTagsForResourceCommandInput}
56+
* @returns {@link ListTagsForResourceCommandOutput}
57+
* @see {@link ListTagsForResourceCommandInput} for command's `input` shape.
58+
* @see {@link ListTagsForResourceCommandOutput} for command's `response` shape.
59+
* @see {@link KinesisClientResolvedConfig | config} for KinesisClient's `config` shape.
60+
*
61+
* @throws {@link AccessDeniedException} (client fault)
62+
* <p>Specifies that you do not have the permissions required to perform this
63+
* operation.</p>
64+
*
65+
* @throws {@link InvalidArgumentException} (client fault)
66+
* <p>A specified parameter exceeds its restrictions, is not supported, or can't be used.
67+
* For more information, see the returned message.</p>
68+
*
69+
* @throws {@link LimitExceededException} (client fault)
70+
* <p>The requested resource exceeds the maximum number allowed, or the number of concurrent
71+
* stream requests exceeds the maximum number allowed. </p>
72+
*
73+
* @throws {@link ResourceInUseException} (client fault)
74+
* <p>The resource is not available for this operation. For successful operation, the
75+
* resource must be in the <code>ACTIVE</code> state.</p>
76+
*
77+
* @throws {@link ResourceNotFoundException} (client fault)
78+
* <p>The requested resource could not be found. The stream might not be specified
79+
* correctly.</p>
80+
*
81+
* @throws {@link KinesisServiceException}
82+
* <p>Base exception class for all service exceptions from Kinesis service.</p>
83+
*
84+
*
85+
* @public
86+
*/
87+
export class ListTagsForResourceCommand extends $Command
88+
.classBuilder<
89+
ListTagsForResourceCommandInput,
90+
ListTagsForResourceCommandOutput,
91+
KinesisClientResolvedConfig,
92+
ServiceInputTypes,
93+
ServiceOutputTypes
94+
>()
95+
.ep({
96+
...commonParams,
97+
OperationType: { type: "staticContextParams", value: `control` },
98+
ResourceARN: { type: "contextParams", name: "ResourceARN" },
99+
})
100+
.m(function (this: any, Command: any, cs: any, config: KinesisClientResolvedConfig, o: any) {
101+
return [
102+
getSerdePlugin(config, this.serialize, this.deserialize),
103+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
104+
];
105+
})
106+
.s("Kinesis_20131202", "ListTagsForResource", {})
107+
.n("KinesisClient", "ListTagsForResourceCommand")
108+
.f(void 0, void 0)
109+
.ser(se_ListTagsForResourceCommand)
110+
.de(de_ListTagsForResourceCommand)
111+
.build() {
112+
/** @internal type navigation helper, not in runtime. */
113+
protected declare static __types: {
114+
api: {
115+
input: ListTagsForResourceInput;
116+
output: ListTagsForResourceOutput;
117+
};
118+
sdk: {
119+
input: ListTagsForResourceCommandInput;
120+
output: ListTagsForResourceCommandOutput;
121+
};
122+
};
123+
}

clients/client-kinesis/src/commands/PutRecordCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ export interface PutRecordCommandOutput extends PutRecordOutput, __MetadataBeare
103103
* <p>Specifies that you do not have the permissions required to perform this
104104
* operation.</p>
105105
*
106+
* @throws {@link InternalFailureException} (server fault)
107+
* <p>The processing of the request failed because of an unknown error, exception, or
108+
* failure.</p>
109+
*
106110
* @throws {@link InvalidArgumentException} (client fault)
107111
* <p>A specified parameter exceeds its restrictions, is not supported, or can't be used.
108112
* For more information, see the returned message.</p>

clients/client-kinesis/src/commands/PutRecordsCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ export interface PutRecordsCommandOutput extends PutRecordsOutput, __MetadataBea
133133
* <p>Specifies that you do not have the permissions required to perform this
134134
* operation.</p>
135135
*
136+
* @throws {@link InternalFailureException} (server fault)
137+
* <p>The processing of the request failed because of an unknown error, exception, or
138+
* failure.</p>
139+
*
136140
* @throws {@link InvalidArgumentException} (client fault)
137141
* <p>A specified parameter exceeds its restrictions, is not supported, or can't be used.
138142
* For more information, see the returned message.</p>

clients/client-kinesis/src/commands/RegisterStreamConsumerCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export interface RegisterStreamConsumerCommandOutput extends RegisterStreamConsu
3333
* from the stream using enhanced fan-out, at a rate of up to 2 MiB per second for every
3434
* shard you subscribe to. This rate is unaffected by the total number of consumers that
3535
* read from the same stream.</p>
36+
* <p>You can add tags to the registered consumer when making a <code>RegisterStreamConsumer</code> request by setting the <code>Tags</code> parameter. If you pass the <code>Tags</code> parameter, in addition to having the <code>kinesis:RegisterStreamConsumer</code> permission, you must also have the <code>kinesis:TagResource</code> permission for the consumer that will be registered. Tags will take effect from the <code>CREATING</code> status of the consumer.</p>
3637
* <p>You can register up to 20 consumers per stream. A given consumer can only be
3738
* registered with one stream at a time.</p>
3839
* <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
@@ -51,6 +52,9 @@ export interface RegisterStreamConsumerCommandOutput extends RegisterStreamConsu
5152
* const input = { // RegisterStreamConsumerInput
5253
* StreamARN: "STRING_VALUE", // required
5354
* ConsumerName: "STRING_VALUE", // required
55+
* Tags: { // TagMap
56+
* "<keys>": "STRING_VALUE",
57+
* },
5458
* };
5559
* const command = new RegisterStreamConsumerCommand(input);
5660
* const response = await client.send(command);

0 commit comments

Comments
 (0)