Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"variables": {
"${LATEST}": "3.322.3"
"${LATEST}": "3.322.4"
},
"endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json",
"services": {
Expand Down
4 changes: 4 additions & 0 deletions src/Service/Kinesis/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Added

- AWS api-change: This release includes support to add tags when creating a stream

### Changed

- Enable compiler optimization for the `sprintf` function.
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Kinesis/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "3.1-dev"
}
}
}
38 changes: 38 additions & 0 deletions src/Service/Kinesis/src/Input/CreateStreamInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,19 @@ final class CreateStreamInput extends Input
*/
private $streamModeDetails;

/**
* A set of up to 10 key-value pairs to use to create the tags.
*
* @var array<string, string>|null
*/
private $tags;

/**
* @param array{
* StreamName?: string,
* ShardCount?: null|int,
* StreamModeDetails?: null|StreamModeDetails|array,
* Tags?: null|array<string, string>,
* '@region'?: string|null,
* } $input
*/
Expand All @@ -54,6 +62,7 @@ public function __construct(array $input = [])
$this->streamName = $input['StreamName'] ?? null;
$this->shardCount = $input['ShardCount'] ?? null;
$this->streamModeDetails = isset($input['StreamModeDetails']) ? StreamModeDetails::create($input['StreamModeDetails']) : null;
$this->tags = $input['Tags'] ?? null;
parent::__construct($input);
}

Expand All @@ -62,6 +71,7 @@ public function __construct(array $input = [])
* StreamName?: string,
* ShardCount?: null|int,
* StreamModeDetails?: null|StreamModeDetails|array,
* Tags?: null|array<string, string>,
* '@region'?: string|null,
* }|CreateStreamInput $input
*/
Expand All @@ -85,6 +95,14 @@ public function getStreamName(): ?string
return $this->streamName;
}

/**
* @return array<string, string>
*/
public function getTags(): array
{
return $this->tags ?? [];
}

/**
* @internal
*/
Expand Down Expand Up @@ -132,6 +150,16 @@ public function setStreamName(?string $value): self
return $this;
}

/**
* @param array<string, string> $value
*/
public function setTags(array $value): self
{
$this->tags = $value;

return $this;
}

private function requestBody(): array
{
$payload = [];
Expand All @@ -145,6 +173,16 @@ private function requestBody(): array
if (null !== $v = $this->streamModeDetails) {
$payload['StreamModeDetails'] = $v->requestBody();
}
if (null !== $v = $this->tags) {
if (empty($v)) {
$payload['Tags'] = new \stdClass();
} else {
$payload['Tags'] = [];
foreach ($v as $name => $mv) {
$payload['Tags'][$name] = $mv;
}
}
}

return $payload;
}
Expand Down
10 changes: 8 additions & 2 deletions src/Service/Kinesis/src/KinesisClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ public function addTagsToStream($input): Result
*
* CreateStream has a limit of five transactions per second per account.
*
* You can add tags to the stream when making a `CreateStream` request by setting the `Tags` parameter. If you pass
* `Tags` parameter, in addition to having `kinesis:createStream` permission, you must also have
* `kinesis:addTagsToStream` permission for the stream that will be created. Tags will take effect from the `CREATING`
* status of the stream.
*
* [^1]: https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html
* [^2]: https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html
*
Expand All @@ -161,6 +166,7 @@ public function addTagsToStream($input): Result
* StreamName: string,
* ShardCount?: null|int,
* StreamModeDetails?: null|StreamModeDetails|array,
* Tags?: null|array<string, string>,
* '@region'?: string|null,
* }|CreateStreamInput $input
*
Expand Down Expand Up @@ -1166,13 +1172,13 @@ public function putRecords($input): PutRecordsOutput
*
* You can register up to 20 consumers per stream. A given consumer can only be registered with one stream at a time.
*
* For an example of how to use this operations, see Enhanced Fan-Out Using the Kinesis Data Streams API [^1].
* For an example of how to use this operation, see Enhanced Fan-Out Using the Kinesis Data Streams API [^1].
*
* 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 more than 5 consumers in a `CREATING` status at the same
* time. Registering a 6th consumer while there are 5 in a `CREATING` status results in a `LimitExceededException`.
*
* [^1]: /streams/latest/dev/building-enhanced-consumers-api.html
* [^1]: https://docs.aws.amazon.com/streams/latest/dev/building-enhanced-consumers-api.html
*
* @see https://docs.aws.amazon.com/kinesis/latest/APIReference/API_RegisterStreamConsumer.html
* @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-kinesis-2013-12-02.html#registerstreamconsumer
Expand Down
Loading