diff --git a/manifest.json b/manifest.json index c3f112875..18f7e2cee 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "variables": { - "${LATEST}": "3.342.36" + "${LATEST}": "3.343.0" }, "endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json", "services": { diff --git a/src/Service/Kinesis/CHANGELOG.md b/src/Service/Kinesis/CHANGELOG.md index 851a8ec04..a0c13098c 100644 --- a/src/Service/Kinesis/CHANGELOG.md +++ b/src/Service/Kinesis/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added - AWS api-change: added `eu-isoe-west-1` region +- AWS api-change: Amazon KDS now supports tagging and attribute-based access control (ABAC) for enhanced fan-out consumers. ### Changed diff --git a/src/Service/Kinesis/src/Exception/InternalFailureException.php b/src/Service/Kinesis/src/Exception/InternalFailureException.php new file mode 100644 index 000000000..c3f9f9d0f --- /dev/null +++ b/src/Service/Kinesis/src/Exception/InternalFailureException.php @@ -0,0 +1,12 @@ +|null */ diff --git a/src/Service/Kinesis/src/Input/RegisterStreamConsumerInput.php b/src/Service/Kinesis/src/Input/RegisterStreamConsumerInput.php index c32e9c0dc..bdca71254 100644 --- a/src/Service/Kinesis/src/Input/RegisterStreamConsumerInput.php +++ b/src/Service/Kinesis/src/Input/RegisterStreamConsumerInput.php @@ -31,10 +31,18 @@ final class RegisterStreamConsumerInput extends Input */ private $consumerName; + /** + * A set of up to 50 key-value pairs. A tag consists of a required key and an optional value. + * + * @var array|null + */ + private $tags; + /** * @param array{ * StreamARN?: string, * ConsumerName?: string, + * Tags?: null|array, * '@region'?: string|null, * } $input */ @@ -42,6 +50,7 @@ public function __construct(array $input = []) { $this->streamArn = $input['StreamARN'] ?? null; $this->consumerName = $input['ConsumerName'] ?? null; + $this->tags = $input['Tags'] ?? null; parent::__construct($input); } @@ -49,6 +58,7 @@ public function __construct(array $input = []) * @param array{ * StreamARN?: string, * ConsumerName?: string, + * Tags?: null|array, * '@region'?: string|null, * }|RegisterStreamConsumerInput $input */ @@ -67,6 +77,14 @@ public function getStreamArn(): ?string return $this->streamArn; } + /** + * @return array + */ + public function getTags(): array + { + return $this->tags ?? []; + } + /** * @internal */ @@ -107,6 +125,16 @@ public function setStreamArn(?string $value): self return $this; } + /** + * @param array $value + */ + public function setTags(array $value): self + { + $this->tags = $value; + + return $this; + } + private function requestBody(): array { $payload = []; @@ -118,6 +146,16 @@ private function requestBody(): array throw new InvalidArgument(\sprintf('Missing parameter "ConsumerName" for "%s". The value cannot be null.', __CLASS__)); } $payload['ConsumerName'] = $v; + 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; } diff --git a/src/Service/Kinesis/src/KinesisClient.php b/src/Service/Kinesis/src/KinesisClient.php index be7aea6f2..3f0da10c2 100644 --- a/src/Service/Kinesis/src/KinesisClient.php +++ b/src/Service/Kinesis/src/KinesisClient.php @@ -15,6 +15,7 @@ use AsyncAws\Kinesis\Exception\AccessDeniedException; use AsyncAws\Kinesis\Exception\ExpiredIteratorException; use AsyncAws\Kinesis\Exception\ExpiredNextTokenException; +use AsyncAws\Kinesis\Exception\InternalFailureException; use AsyncAws\Kinesis\Exception\InvalidArgumentException; use AsyncAws\Kinesis\Exception\KMSAccessDeniedException; use AsyncAws\Kinesis\Exception\KMSDisabledException; @@ -151,10 +152,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. + * You can add tags to the stream when making a `CreateStream` request by setting the `Tags` parameter. If you pass the + * `Tags` parameter, in addition to having the `kinesis:CreateStream` permission, you must also have the + * `kinesis:AddTagsToStream` permission for the stream that will be created. The `kinesis:TagResource` permission + * won’t work to tag streams on creation. Tags will take effect from the `CREATING` status of the stream, but you + * can't make any updates to the tags until the stream is in `ACTIVE` state. * * [^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 @@ -603,6 +605,7 @@ public function enableEnhancedMonitoring($input): EnhancedMonitoringOutput * * @throws AccessDeniedException * @throws ExpiredIteratorException + * @throws InternalFailureException * @throws InvalidArgumentException * @throws KMSAccessDeniedException * @throws KMSDisabledException @@ -619,6 +622,7 @@ public function getRecords($input): GetRecordsOutput $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'GetRecords', 'region' => $input->getRegion(), 'exceptionMapping' => [ 'AccessDeniedException' => AccessDeniedException::class, 'ExpiredIteratorException' => ExpiredIteratorException::class, + 'InternalFailureException' => InternalFailureException::class, 'InvalidArgumentException' => InvalidArgumentException::class, 'KMSAccessDeniedException' => KMSAccessDeniedException::class, 'KMSDisabledException' => KMSDisabledException::class, @@ -683,6 +687,7 @@ public function getRecords($input): GetRecordsOutput * }|GetShardIteratorInput $input * * @throws AccessDeniedException + * @throws InternalFailureException * @throws InvalidArgumentException * @throws ProvisionedThroughputExceededException * @throws ResourceNotFoundException @@ -692,6 +697,7 @@ public function getShardIterator($input): GetShardIteratorOutput $input = GetShardIteratorInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'GetShardIterator', 'region' => $input->getRegion(), 'exceptionMapping' => [ 'AccessDeniedException' => AccessDeniedException::class, + 'InternalFailureException' => InternalFailureException::class, 'InvalidArgumentException' => InvalidArgumentException::class, 'ProvisionedThroughputExceededException' => ProvisionedThroughputExceededException::class, 'ResourceNotFoundException' => ResourceNotFoundException::class, @@ -1037,6 +1043,7 @@ public function mergeShards($input): Result * }|PutRecordInput $input * * @throws AccessDeniedException + * @throws InternalFailureException * @throws InvalidArgumentException * @throws KMSAccessDeniedException * @throws KMSDisabledException @@ -1052,6 +1059,7 @@ public function putRecord($input): PutRecordOutput $input = PutRecordInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'PutRecord', 'region' => $input->getRegion(), 'exceptionMapping' => [ 'AccessDeniedException' => AccessDeniedException::class, + 'InternalFailureException' => InternalFailureException::class, 'InvalidArgumentException' => InvalidArgumentException::class, 'KMSAccessDeniedException' => KMSAccessDeniedException::class, 'KMSDisabledException' => KMSDisabledException::class, @@ -1135,6 +1143,7 @@ public function putRecord($input): PutRecordOutput * }|PutRecordsInput $input * * @throws AccessDeniedException + * @throws InternalFailureException * @throws InvalidArgumentException * @throws KMSAccessDeniedException * @throws KMSDisabledException @@ -1150,6 +1159,7 @@ public function putRecords($input): PutRecordsOutput $input = PutRecordsInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'PutRecords', 'region' => $input->getRegion(), 'exceptionMapping' => [ 'AccessDeniedException' => AccessDeniedException::class, + 'InternalFailureException' => InternalFailureException::class, 'InvalidArgumentException' => InvalidArgumentException::class, 'KMSAccessDeniedException' => KMSAccessDeniedException::class, 'KMSDisabledException' => KMSDisabledException::class, @@ -1170,6 +1180,11 @@ public function putRecords($input): PutRecordsOutput * every shard you subscribe to. This rate is unaffected by the total number of consumers that read from the same * stream. * + * You can add tags to the registered consumer when making a `RegisterStreamConsumer` request by setting the `Tags` + * parameter. If you pass the `Tags` parameter, in addition to having the `kinesis:RegisterStreamConsumer` permission, + * you must also have the `kinesis:TagResource` permission for the consumer that will be registered. Tags will take + * effect from the `CREATING` status of the consumer. + * * 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 operation, see Enhanced Fan-Out Using the Kinesis Data Streams API [^1]. @@ -1186,6 +1201,7 @@ public function putRecords($input): PutRecordsOutput * @param array{ * StreamARN: string, * ConsumerName: string, + * Tags?: null|array, * '@region'?: string|null, * }|RegisterStreamConsumerInput $input * diff --git a/src/Service/Kinesis/src/ValueObject/Tag.php b/src/Service/Kinesis/src/ValueObject/Tag.php index 52026e636..e1fab8db0 100644 --- a/src/Service/Kinesis/src/ValueObject/Tag.php +++ b/src/Service/Kinesis/src/ValueObject/Tag.php @@ -5,7 +5,7 @@ use AsyncAws\Core\Exception\InvalidArgument; /** - * Metadata assigned to the stream, consisting of a key-value pair. + * Metadata assigned to the stream or consumer, consisting of a key-value pair. */ final class Tag {