aws-cdk-lib 2.178.2__py3-none-any.whl → 2.180.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of aws-cdk-lib might be problematic. Click here for more details.
- aws_cdk/__init__.py +83 -41
- aws_cdk/_jsii/__init__.py +1 -2
- aws_cdk/_jsii/{aws-cdk-lib@2.178.2.jsii.tgz → aws-cdk-lib@2.180.0.jsii.tgz} +0 -0
- aws_cdk/aws_acmpca/__init__.py +47 -0
- aws_cdk/aws_apigateway/__init__.py +176 -35
- aws_cdk/aws_apigatewayv2/__init__.py +151 -32
- aws_cdk/aws_apigatewayv2_integrations/__init__.py +348 -0
- aws_cdk/aws_applicationautoscaling/__init__.py +8 -8
- aws_cdk/aws_appsync/__init__.py +10 -7
- aws_cdk/aws_backup/__init__.py +89 -0
- aws_cdk/aws_batch/__init__.py +89 -50
- aws_cdk/aws_bedrock/__init__.py +506 -62
- aws_cdk/aws_cloudfront/__init__.py +1037 -146
- aws_cdk/aws_cloudfront_origins/__init__.py +1338 -144
- aws_cdk/aws_cloudtrail/__init__.py +4 -8
- aws_cdk/aws_cloudwatch/__init__.py +1 -1
- aws_cdk/aws_codebuild/__init__.py +218 -2
- aws_cdk/aws_codepipeline/__init__.py +113 -28
- aws_cdk/aws_codepipeline_actions/__init__.py +554 -63
- aws_cdk/aws_codestar/__init__.py +2 -1
- aws_cdk/aws_cognito/__init__.py +676 -29
- aws_cdk/aws_connect/__init__.py +257 -0
- aws_cdk/aws_datasync/__init__.py +279 -50
- aws_cdk/aws_deadline/__init__.py +683 -6
- aws_cdk/aws_directoryservice/__init__.py +9 -4
- aws_cdk/aws_dlm/__init__.py +2 -2
- aws_cdk/aws_dms/__init__.py +3 -3
- aws_cdk/aws_dynamodb/__init__.py +0 -54
- aws_cdk/aws_ec2/__init__.py +402 -130
- aws_cdk/aws_ecs/__init__.py +28 -43
- aws_cdk/aws_efs/__init__.py +1 -1
- aws_cdk/aws_eks/__init__.py +560 -182
- aws_cdk/aws_elasticloadbalancingv2/__init__.py +112 -27
- aws_cdk/aws_emrcontainers/__init__.py +44 -1
- aws_cdk/aws_events/__init__.py +17 -26
- aws_cdk/aws_events_targets/__init__.py +303 -16
- aws_cdk/aws_fms/__init__.py +5 -5
- aws_cdk/aws_fsx/__init__.py +5 -4
- aws_cdk/aws_glue/__init__.py +161 -0
- aws_cdk/aws_groundstation/__init__.py +23 -1
- aws_cdk/aws_iam/__init__.py +15 -15
- aws_cdk/aws_iot/__init__.py +7 -0
- aws_cdk/aws_ivs/__init__.py +254 -77
- aws_cdk/aws_kinesis/__init__.py +689 -35
- aws_cdk/aws_lambda/__init__.py +10 -15
- aws_cdk/aws_lambda_event_sources/__init__.py +175 -2
- aws_cdk/aws_logs/__init__.py +62 -13
- aws_cdk/aws_medialive/__init__.py +314 -4
- aws_cdk/aws_opensearchserverless/__init__.py +19 -0
- aws_cdk/aws_pinpoint/__init__.py +14 -9
- aws_cdk/aws_rds/__init__.py +246 -82
- aws_cdk/aws_s3/__init__.py +287 -9
- aws_cdk/aws_s3objectlambda/__init__.py +2 -2
- aws_cdk/aws_ses/__init__.py +228 -8
- aws_cdk/aws_ssm/__init__.py +4 -5
- aws_cdk/aws_stepfunctions/__init__.py +301 -70
- aws_cdk/aws_stepfunctions_tasks/__init__.py +269 -163
- aws_cdk/aws_supportapp/__init__.py +7 -7
- aws_cdk/aws_transfer/__init__.py +820 -2
- aws_cdk/aws_wafv2/__init__.py +17 -9
- aws_cdk/custom_resources/__init__.py +23 -26
- aws_cdk/cx_api/__init__.py +16 -0
- aws_cdk/pipelines/__init__.py +2 -2
- {aws_cdk_lib-2.178.2.dist-info → aws_cdk_lib-2.180.0.dist-info}/METADATA +1 -2
- {aws_cdk_lib-2.178.2.dist-info → aws_cdk_lib-2.180.0.dist-info}/RECORD +69 -70
- aws_cdk/lambda_layer_kubectl/__init__.py +0 -107
- {aws_cdk_lib-2.178.2.dist-info → aws_cdk_lib-2.180.0.dist-info}/LICENSE +0 -0
- {aws_cdk_lib-2.178.2.dist-info → aws_cdk_lib-2.180.0.dist-info}/NOTICE +0 -0
- {aws_cdk_lib-2.178.2.dist-info → aws_cdk_lib-2.180.0.dist-info}/WHEEL +0 -0
- {aws_cdk_lib-2.178.2.dist-info → aws_cdk_lib-2.180.0.dist-info}/top_level.txt +0 -0
aws_cdk/aws_kinesis/__init__.py
CHANGED
|
@@ -17,7 +17,10 @@ intake and aggregation.
|
|
|
17
17
|
* [Write Permissions](#write-permissions)
|
|
18
18
|
* [Custom Permissions](#custom-permissions)
|
|
19
19
|
* [Metrics](#metrics)
|
|
20
|
-
|
|
20
|
+
* [Stream Consumers](#stream-consumers)
|
|
21
|
+
|
|
22
|
+
* [Read Permissions](#read-permissions-1)
|
|
23
|
+
* [Resource Policy](#resource-policy)
|
|
21
24
|
|
|
22
25
|
## Streams
|
|
23
26
|
|
|
@@ -186,9 +189,54 @@ stream.metric_get_records_success()
|
|
|
186
189
|
stream.metric_get_records_success(statistic="Maximum")
|
|
187
190
|
```
|
|
188
191
|
|
|
189
|
-
|
|
192
|
+
## Stream Consumers
|
|
193
|
+
|
|
194
|
+
Creating stream consumers allow consumers to receive data from the stream using enhanced fan-out at a rate of up to 2 MiB per second for every shard.
|
|
195
|
+
This rate is unaffected by the total number of consumers that read from the same stream.
|
|
196
|
+
|
|
197
|
+
For more information, see [Develop enhanced fan-out consumers with dedicated throughput](https://docs.aws.amazon.com/streams/latest/dev/enhanced-consumers.html).
|
|
198
|
+
|
|
199
|
+
To create and associate a stream consumer with a stream
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
stream = kinesis.Stream(self, "MyStream")
|
|
203
|
+
|
|
204
|
+
stream_consumer = kinesis.StreamConsumer(self, "MyStreamConsumer",
|
|
205
|
+
stream_consumer_name="MyStreamConsumer",
|
|
206
|
+
stream=stream
|
|
207
|
+
)
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
#### Read Permissions
|
|
211
|
+
|
|
212
|
+
Grant `read` access to a stream consumer, and the stream it is registered with, by calling the `grantRead()` API.
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
lambda_role = iam.Role(self, "Role",
|
|
216
|
+
assumed_by=iam.ServicePrincipal("lambda.amazonaws.com"),
|
|
217
|
+
description="Example role..."
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
stream = kinesis.Stream(self, "MyEncryptedStream",
|
|
221
|
+
encryption=kinesis.StreamEncryption.KMS
|
|
222
|
+
)
|
|
223
|
+
stream_consumer = kinesis.StreamConsumer(self, "MyStreamConsumer",
|
|
224
|
+
stream_consumer_name="MyStreamConsumer",
|
|
225
|
+
stream=stream
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
# give lambda permissions to read stream via the stream consumer
|
|
229
|
+
stream_consumer.grant_read(lambda_role)
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
In addition to stream's permissions, the following permissions are provided to a service principal by the `grantRead()` API:
|
|
233
|
+
|
|
234
|
+
* `kinesis:DescribeStreamConsumer`,
|
|
235
|
+
* `kinesis:SubscribeToShard`,
|
|
190
236
|
|
|
191
|
-
|
|
237
|
+
## Resource Policy
|
|
238
|
+
|
|
239
|
+
You can create a resource policy for a data stream or a stream consumer.
|
|
192
240
|
For more information, see [Controlling access to Amazon Kinesis Data Streams resources using IAM](https://docs.aws.amazon.com/streams/latest/dev/controlling-access.html).
|
|
193
241
|
|
|
194
242
|
A resource policy is automatically created when `addToResourcePolicy` is called, if one doesn't already exist.
|
|
@@ -197,13 +245,24 @@ Using `addToResourcePolicy` is the simplest way to add a resource policy:
|
|
|
197
245
|
|
|
198
246
|
```python
|
|
199
247
|
stream = kinesis.Stream(self, "MyStream")
|
|
248
|
+
stream_consumer = kinesis.StreamConsumer(self, "MyStreamConsumer",
|
|
249
|
+
stream_consumer_name="MyStreamConsumer",
|
|
250
|
+
stream=stream
|
|
251
|
+
)
|
|
200
252
|
|
|
201
|
-
# create a resource policy via addToResourcePolicy method
|
|
253
|
+
# create a stream resource policy via addToResourcePolicy method
|
|
202
254
|
stream.add_to_resource_policy(iam.PolicyStatement(
|
|
203
255
|
resources=[stream.stream_arn],
|
|
204
256
|
actions=["kinesis:GetRecords"],
|
|
205
257
|
principals=[iam.AnyPrincipal()]
|
|
206
258
|
))
|
|
259
|
+
|
|
260
|
+
# create a stream consumer resource policy via addToResourcePolicy method
|
|
261
|
+
stream_consumer.add_to_resource_policy(iam.PolicyStatement(
|
|
262
|
+
resources=[stream.stream_arn],
|
|
263
|
+
actions=["kinesis:DescribeStreamConsumer"],
|
|
264
|
+
principals=[iam.AnyPrincipal()]
|
|
265
|
+
))
|
|
207
266
|
```
|
|
208
267
|
|
|
209
268
|
You can create a resource manually by using `ResourcePolicy`.
|
|
@@ -212,6 +271,10 @@ If not, a blank policy document will be set.
|
|
|
212
271
|
|
|
213
272
|
```python
|
|
214
273
|
stream = kinesis.Stream(self, "MyStream")
|
|
274
|
+
stream_consumer = kinesis.StreamConsumer(self, "MyStreamConsumer",
|
|
275
|
+
stream_consumer_name="MyStreamConsumer",
|
|
276
|
+
stream=stream
|
|
277
|
+
)
|
|
215
278
|
|
|
216
279
|
# create a custom policy document
|
|
217
280
|
policy_document = iam.PolicyDocument(
|
|
@@ -225,11 +288,17 @@ policy_document = iam.PolicyDocument(
|
|
|
225
288
|
]
|
|
226
289
|
)
|
|
227
290
|
|
|
228
|
-
# create a resource policy manually
|
|
291
|
+
# create a stream resource policy manually
|
|
229
292
|
kinesis.ResourcePolicy(self, "ResourcePolicy",
|
|
230
293
|
stream=stream,
|
|
231
294
|
policy_document=policy_document
|
|
232
295
|
)
|
|
296
|
+
|
|
297
|
+
# create a stream consumer resource policy manually
|
|
298
|
+
kinesis.ResourcePolicy(self, "ResourcePolicy",
|
|
299
|
+
stream_consumer=stream_consumer,
|
|
300
|
+
policy_document=policy_document
|
|
301
|
+
)
|
|
233
302
|
```
|
|
234
303
|
'''
|
|
235
304
|
from pkgutil import extend_path
|
|
@@ -3089,6 +3158,158 @@ class _IStreamProxy(
|
|
|
3089
3158
|
typing.cast(typing.Any, IStream).__jsii_proxy_class__ = lambda : _IStreamProxy
|
|
3090
3159
|
|
|
3091
3160
|
|
|
3161
|
+
@jsii.interface(jsii_type="aws-cdk-lib.aws_kinesis.IStreamConsumer")
|
|
3162
|
+
class IStreamConsumer(_IResource_c80c4260, typing_extensions.Protocol):
|
|
3163
|
+
'''A Kinesis Stream Consumer.'''
|
|
3164
|
+
|
|
3165
|
+
@builtins.property
|
|
3166
|
+
@jsii.member(jsii_name="stream")
|
|
3167
|
+
def stream(self) -> IStream:
|
|
3168
|
+
'''The stream associated with this consumer.
|
|
3169
|
+
|
|
3170
|
+
:attribute: true
|
|
3171
|
+
'''
|
|
3172
|
+
...
|
|
3173
|
+
|
|
3174
|
+
@builtins.property
|
|
3175
|
+
@jsii.member(jsii_name="streamConsumerArn")
|
|
3176
|
+
def stream_consumer_arn(self) -> builtins.str:
|
|
3177
|
+
'''The ARN of the stream consumer.
|
|
3178
|
+
|
|
3179
|
+
:attribute: true
|
|
3180
|
+
'''
|
|
3181
|
+
...
|
|
3182
|
+
|
|
3183
|
+
@builtins.property
|
|
3184
|
+
@jsii.member(jsii_name="streamConsumerName")
|
|
3185
|
+
def stream_consumer_name(self) -> builtins.str:
|
|
3186
|
+
'''The name of the stream consumer.
|
|
3187
|
+
|
|
3188
|
+
:attribute: true
|
|
3189
|
+
'''
|
|
3190
|
+
...
|
|
3191
|
+
|
|
3192
|
+
@jsii.member(jsii_name="addToResourcePolicy")
|
|
3193
|
+
def add_to_resource_policy(
|
|
3194
|
+
self,
|
|
3195
|
+
statement: _PolicyStatement_0fe33853,
|
|
3196
|
+
) -> _AddToResourcePolicyResult_1d0a53ad:
|
|
3197
|
+
'''Adds a statement to the IAM resource policy associated with this stream consumer.
|
|
3198
|
+
|
|
3199
|
+
If this stream consumer was created in this stack (``new StreamConsumer``), a resource policy
|
|
3200
|
+
will be automatically created upon the first call to ``addToResourcePolicy``. If
|
|
3201
|
+
the stream consumer is imported (``StreamConsumer.from``), then this is a no-op.
|
|
3202
|
+
|
|
3203
|
+
:param statement: -
|
|
3204
|
+
'''
|
|
3205
|
+
...
|
|
3206
|
+
|
|
3207
|
+
@jsii.member(jsii_name="grant")
|
|
3208
|
+
def grant(
|
|
3209
|
+
self,
|
|
3210
|
+
grantee: _IGrantable_71c4f5de,
|
|
3211
|
+
*actions: builtins.str,
|
|
3212
|
+
) -> _Grant_a7ae64f8:
|
|
3213
|
+
'''Grant the indicated permissions on this stream consumer to the provided IAM principal.
|
|
3214
|
+
|
|
3215
|
+
:param grantee: -
|
|
3216
|
+
:param actions: -
|
|
3217
|
+
'''
|
|
3218
|
+
...
|
|
3219
|
+
|
|
3220
|
+
@jsii.member(jsii_name="grantRead")
|
|
3221
|
+
def grant_read(self, grantee: _IGrantable_71c4f5de) -> _Grant_a7ae64f8:
|
|
3222
|
+
'''Grant read permissions for this stream consumer and its associated stream to an IAM principal (Role/Group/User).
|
|
3223
|
+
|
|
3224
|
+
:param grantee: -
|
|
3225
|
+
'''
|
|
3226
|
+
...
|
|
3227
|
+
|
|
3228
|
+
|
|
3229
|
+
class _IStreamConsumerProxy(
|
|
3230
|
+
jsii.proxy_for(_IResource_c80c4260), # type: ignore[misc]
|
|
3231
|
+
):
|
|
3232
|
+
'''A Kinesis Stream Consumer.'''
|
|
3233
|
+
|
|
3234
|
+
__jsii_type__: typing.ClassVar[str] = "aws-cdk-lib.aws_kinesis.IStreamConsumer"
|
|
3235
|
+
|
|
3236
|
+
@builtins.property
|
|
3237
|
+
@jsii.member(jsii_name="stream")
|
|
3238
|
+
def stream(self) -> IStream:
|
|
3239
|
+
'''The stream associated with this consumer.
|
|
3240
|
+
|
|
3241
|
+
:attribute: true
|
|
3242
|
+
'''
|
|
3243
|
+
return typing.cast(IStream, jsii.get(self, "stream"))
|
|
3244
|
+
|
|
3245
|
+
@builtins.property
|
|
3246
|
+
@jsii.member(jsii_name="streamConsumerArn")
|
|
3247
|
+
def stream_consumer_arn(self) -> builtins.str:
|
|
3248
|
+
'''The ARN of the stream consumer.
|
|
3249
|
+
|
|
3250
|
+
:attribute: true
|
|
3251
|
+
'''
|
|
3252
|
+
return typing.cast(builtins.str, jsii.get(self, "streamConsumerArn"))
|
|
3253
|
+
|
|
3254
|
+
@builtins.property
|
|
3255
|
+
@jsii.member(jsii_name="streamConsumerName")
|
|
3256
|
+
def stream_consumer_name(self) -> builtins.str:
|
|
3257
|
+
'''The name of the stream consumer.
|
|
3258
|
+
|
|
3259
|
+
:attribute: true
|
|
3260
|
+
'''
|
|
3261
|
+
return typing.cast(builtins.str, jsii.get(self, "streamConsumerName"))
|
|
3262
|
+
|
|
3263
|
+
@jsii.member(jsii_name="addToResourcePolicy")
|
|
3264
|
+
def add_to_resource_policy(
|
|
3265
|
+
self,
|
|
3266
|
+
statement: _PolicyStatement_0fe33853,
|
|
3267
|
+
) -> _AddToResourcePolicyResult_1d0a53ad:
|
|
3268
|
+
'''Adds a statement to the IAM resource policy associated with this stream consumer.
|
|
3269
|
+
|
|
3270
|
+
If this stream consumer was created in this stack (``new StreamConsumer``), a resource policy
|
|
3271
|
+
will be automatically created upon the first call to ``addToResourcePolicy``. If
|
|
3272
|
+
the stream consumer is imported (``StreamConsumer.from``), then this is a no-op.
|
|
3273
|
+
|
|
3274
|
+
:param statement: -
|
|
3275
|
+
'''
|
|
3276
|
+
if __debug__:
|
|
3277
|
+
type_hints = typing.get_type_hints(_typecheckingstub__37c37a05c26ce89345f11707cf8d0c79c7d0abfdb26093c52bdf5503d8f1d7d3)
|
|
3278
|
+
check_type(argname="argument statement", value=statement, expected_type=type_hints["statement"])
|
|
3279
|
+
return typing.cast(_AddToResourcePolicyResult_1d0a53ad, jsii.invoke(self, "addToResourcePolicy", [statement]))
|
|
3280
|
+
|
|
3281
|
+
@jsii.member(jsii_name="grant")
|
|
3282
|
+
def grant(
|
|
3283
|
+
self,
|
|
3284
|
+
grantee: _IGrantable_71c4f5de,
|
|
3285
|
+
*actions: builtins.str,
|
|
3286
|
+
) -> _Grant_a7ae64f8:
|
|
3287
|
+
'''Grant the indicated permissions on this stream consumer to the provided IAM principal.
|
|
3288
|
+
|
|
3289
|
+
:param grantee: -
|
|
3290
|
+
:param actions: -
|
|
3291
|
+
'''
|
|
3292
|
+
if __debug__:
|
|
3293
|
+
type_hints = typing.get_type_hints(_typecheckingstub__cf3550b30daa1ef048e2fefa63cc0765dc59458fde35eb1301476a6b6c3ac2e9)
|
|
3294
|
+
check_type(argname="argument grantee", value=grantee, expected_type=type_hints["grantee"])
|
|
3295
|
+
check_type(argname="argument actions", value=actions, expected_type=typing.Tuple[type_hints["actions"], ...]) # pyright: ignore [reportGeneralTypeIssues]
|
|
3296
|
+
return typing.cast(_Grant_a7ae64f8, jsii.invoke(self, "grant", [grantee, *actions]))
|
|
3297
|
+
|
|
3298
|
+
@jsii.member(jsii_name="grantRead")
|
|
3299
|
+
def grant_read(self, grantee: _IGrantable_71c4f5de) -> _Grant_a7ae64f8:
|
|
3300
|
+
'''Grant read permissions for this stream consumer and its associated stream to an IAM principal (Role/Group/User).
|
|
3301
|
+
|
|
3302
|
+
:param grantee: -
|
|
3303
|
+
'''
|
|
3304
|
+
if __debug__:
|
|
3305
|
+
type_hints = typing.get_type_hints(_typecheckingstub__ce58f2c46edcaa40f59d7e5fc1f893d206283c930800a7814a6a4e0636aa7638)
|
|
3306
|
+
check_type(argname="argument grantee", value=grantee, expected_type=type_hints["grantee"])
|
|
3307
|
+
return typing.cast(_Grant_a7ae64f8, jsii.invoke(self, "grantRead", [grantee]))
|
|
3308
|
+
|
|
3309
|
+
# Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
|
|
3310
|
+
typing.cast(typing.Any, IStreamConsumer).__jsii_proxy_class__ = lambda : _IStreamConsumerProxy
|
|
3311
|
+
|
|
3312
|
+
|
|
3092
3313
|
class ResourcePolicy(
|
|
3093
3314
|
_Resource_45bc6135,
|
|
3094
3315
|
metaclass=jsii.JSIIMeta,
|
|
@@ -3112,6 +3333,10 @@ class ResourcePolicy(
|
|
|
3112
3333
|
Example::
|
|
3113
3334
|
|
|
3114
3335
|
stream = kinesis.Stream(self, "MyStream")
|
|
3336
|
+
stream_consumer = kinesis.StreamConsumer(self, "MyStreamConsumer",
|
|
3337
|
+
stream_consumer_name="MyStreamConsumer",
|
|
3338
|
+
stream=stream
|
|
3339
|
+
)
|
|
3115
3340
|
|
|
3116
3341
|
# create a custom policy document
|
|
3117
3342
|
policy_document = iam.PolicyDocument(
|
|
@@ -3125,11 +3350,17 @@ class ResourcePolicy(
|
|
|
3125
3350
|
]
|
|
3126
3351
|
)
|
|
3127
3352
|
|
|
3128
|
-
# create a resource policy manually
|
|
3353
|
+
# create a stream resource policy manually
|
|
3129
3354
|
kinesis.ResourcePolicy(self, "ResourcePolicy",
|
|
3130
3355
|
stream=stream,
|
|
3131
3356
|
policy_document=policy_document
|
|
3132
3357
|
)
|
|
3358
|
+
|
|
3359
|
+
# create a stream consumer resource policy manually
|
|
3360
|
+
kinesis.ResourcePolicy(self, "ResourcePolicy",
|
|
3361
|
+
stream_consumer=stream_consumer,
|
|
3362
|
+
policy_document=policy_document
|
|
3363
|
+
)
|
|
3133
3364
|
'''
|
|
3134
3365
|
|
|
3135
3366
|
def __init__(
|
|
@@ -3137,20 +3368,26 @@ class ResourcePolicy(
|
|
|
3137
3368
|
scope: _constructs_77d1e7e8.Construct,
|
|
3138
3369
|
id: builtins.str,
|
|
3139
3370
|
*,
|
|
3140
|
-
stream: IStream,
|
|
3141
3371
|
policy_document: typing.Optional[_PolicyDocument_3ac34393] = None,
|
|
3372
|
+
stream: typing.Optional[IStream] = None,
|
|
3373
|
+
stream_consumer: typing.Optional[IStreamConsumer] = None,
|
|
3142
3374
|
) -> None:
|
|
3143
3375
|
'''
|
|
3144
3376
|
:param scope: -
|
|
3145
3377
|
:param id: -
|
|
3146
|
-
:param stream: The stream this policy applies to.
|
|
3147
3378
|
:param policy_document: IAM policy document to apply to a data stream. Default: - empty policy document
|
|
3379
|
+
:param stream: The stream this policy applies to. Note: only one of ``stream`` and ``streamConsumer`` must be set. Default: - policy is not associated to a stream
|
|
3380
|
+
:param stream_consumer: The stream consumer this policy applies to. Note: only one of ``stream`` and ``streamConsumer`` must be set. Default: - policy is not associated to a consumer
|
|
3148
3381
|
'''
|
|
3149
3382
|
if __debug__:
|
|
3150
3383
|
type_hints = typing.get_type_hints(_typecheckingstub__4488fc34b1387c696011cd138108f10e13139cd2d56365a8ba9602ad6ba244f0)
|
|
3151
3384
|
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
3152
3385
|
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
3153
|
-
props = ResourcePolicyProps(
|
|
3386
|
+
props = ResourcePolicyProps(
|
|
3387
|
+
policy_document=policy_document,
|
|
3388
|
+
stream=stream,
|
|
3389
|
+
stream_consumer=stream_consumer,
|
|
3390
|
+
)
|
|
3154
3391
|
|
|
3155
3392
|
jsii.create(self.__class__, self, [scope, id, props])
|
|
3156
3393
|
|
|
@@ -3164,25 +3401,35 @@ class ResourcePolicy(
|
|
|
3164
3401
|
@jsii.data_type(
|
|
3165
3402
|
jsii_type="aws-cdk-lib.aws_kinesis.ResourcePolicyProps",
|
|
3166
3403
|
jsii_struct_bases=[],
|
|
3167
|
-
name_mapping={
|
|
3404
|
+
name_mapping={
|
|
3405
|
+
"policy_document": "policyDocument",
|
|
3406
|
+
"stream": "stream",
|
|
3407
|
+
"stream_consumer": "streamConsumer",
|
|
3408
|
+
},
|
|
3168
3409
|
)
|
|
3169
3410
|
class ResourcePolicyProps:
|
|
3170
3411
|
def __init__(
|
|
3171
3412
|
self,
|
|
3172
3413
|
*,
|
|
3173
|
-
stream: IStream,
|
|
3174
3414
|
policy_document: typing.Optional[_PolicyDocument_3ac34393] = None,
|
|
3415
|
+
stream: typing.Optional[IStream] = None,
|
|
3416
|
+
stream_consumer: typing.Optional[IStreamConsumer] = None,
|
|
3175
3417
|
) -> None:
|
|
3176
3418
|
'''Properties to associate a data stream with a policy.
|
|
3177
3419
|
|
|
3178
|
-
:param stream: The stream this policy applies to.
|
|
3179
3420
|
:param policy_document: IAM policy document to apply to a data stream. Default: - empty policy document
|
|
3421
|
+
:param stream: The stream this policy applies to. Note: only one of ``stream`` and ``streamConsumer`` must be set. Default: - policy is not associated to a stream
|
|
3422
|
+
:param stream_consumer: The stream consumer this policy applies to. Note: only one of ``stream`` and ``streamConsumer`` must be set. Default: - policy is not associated to a consumer
|
|
3180
3423
|
|
|
3181
3424
|
:exampleMetadata: infused
|
|
3182
3425
|
|
|
3183
3426
|
Example::
|
|
3184
3427
|
|
|
3185
3428
|
stream = kinesis.Stream(self, "MyStream")
|
|
3429
|
+
stream_consumer = kinesis.StreamConsumer(self, "MyStreamConsumer",
|
|
3430
|
+
stream_consumer_name="MyStreamConsumer",
|
|
3431
|
+
stream=stream
|
|
3432
|
+
)
|
|
3186
3433
|
|
|
3187
3434
|
# create a custom policy document
|
|
3188
3435
|
policy_document = iam.PolicyDocument(
|
|
@@ -3196,28 +3443,30 @@ class ResourcePolicyProps:
|
|
|
3196
3443
|
]
|
|
3197
3444
|
)
|
|
3198
3445
|
|
|
3199
|
-
# create a resource policy manually
|
|
3446
|
+
# create a stream resource policy manually
|
|
3200
3447
|
kinesis.ResourcePolicy(self, "ResourcePolicy",
|
|
3201
3448
|
stream=stream,
|
|
3202
3449
|
policy_document=policy_document
|
|
3203
3450
|
)
|
|
3451
|
+
|
|
3452
|
+
# create a stream consumer resource policy manually
|
|
3453
|
+
kinesis.ResourcePolicy(self, "ResourcePolicy",
|
|
3454
|
+
stream_consumer=stream_consumer,
|
|
3455
|
+
policy_document=policy_document
|
|
3456
|
+
)
|
|
3204
3457
|
'''
|
|
3205
3458
|
if __debug__:
|
|
3206
3459
|
type_hints = typing.get_type_hints(_typecheckingstub__b4f61add9bc5e3d367f841a39ff9a752c7eed270f05849d0b5f9dc5e5ad3382a)
|
|
3207
|
-
check_type(argname="argument stream", value=stream, expected_type=type_hints["stream"])
|
|
3208
3460
|
check_type(argname="argument policy_document", value=policy_document, expected_type=type_hints["policy_document"])
|
|
3209
|
-
|
|
3210
|
-
"
|
|
3211
|
-
}
|
|
3461
|
+
check_type(argname="argument stream", value=stream, expected_type=type_hints["stream"])
|
|
3462
|
+
check_type(argname="argument stream_consumer", value=stream_consumer, expected_type=type_hints["stream_consumer"])
|
|
3463
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {}
|
|
3212
3464
|
if policy_document is not None:
|
|
3213
3465
|
self._values["policy_document"] = policy_document
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
result = self._values.get("stream")
|
|
3219
|
-
assert result is not None, "Required property 'stream' is missing"
|
|
3220
|
-
return typing.cast(IStream, result)
|
|
3466
|
+
if stream is not None:
|
|
3467
|
+
self._values["stream"] = stream
|
|
3468
|
+
if stream_consumer is not None:
|
|
3469
|
+
self._values["stream_consumer"] = stream_consumer
|
|
3221
3470
|
|
|
3222
3471
|
@builtins.property
|
|
3223
3472
|
def policy_document(self) -> typing.Optional[_PolicyDocument_3ac34393]:
|
|
@@ -3228,6 +3477,28 @@ class ResourcePolicyProps:
|
|
|
3228
3477
|
result = self._values.get("policy_document")
|
|
3229
3478
|
return typing.cast(typing.Optional[_PolicyDocument_3ac34393], result)
|
|
3230
3479
|
|
|
3480
|
+
@builtins.property
|
|
3481
|
+
def stream(self) -> typing.Optional[IStream]:
|
|
3482
|
+
'''The stream this policy applies to.
|
|
3483
|
+
|
|
3484
|
+
Note: only one of ``stream`` and ``streamConsumer`` must be set.
|
|
3485
|
+
|
|
3486
|
+
:default: - policy is not associated to a stream
|
|
3487
|
+
'''
|
|
3488
|
+
result = self._values.get("stream")
|
|
3489
|
+
return typing.cast(typing.Optional[IStream], result)
|
|
3490
|
+
|
|
3491
|
+
@builtins.property
|
|
3492
|
+
def stream_consumer(self) -> typing.Optional[IStreamConsumer]:
|
|
3493
|
+
'''The stream consumer this policy applies to.
|
|
3494
|
+
|
|
3495
|
+
Note: only one of ``stream`` and ``streamConsumer`` must be set.
|
|
3496
|
+
|
|
3497
|
+
:default: - policy is not associated to a consumer
|
|
3498
|
+
'''
|
|
3499
|
+
result = self._values.get("stream_consumer")
|
|
3500
|
+
return typing.cast(typing.Optional[IStreamConsumer], result)
|
|
3501
|
+
|
|
3231
3502
|
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
3232
3503
|
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
3233
3504
|
|
|
@@ -3254,12 +3525,17 @@ class Stream(
|
|
|
3254
3525
|
|
|
3255
3526
|
Example::
|
|
3256
3527
|
|
|
3257
|
-
|
|
3528
|
+
lambda_role = iam.Role(self, "Role",
|
|
3529
|
+
assumed_by=iam.ServicePrincipal("lambda.amazonaws.com"),
|
|
3530
|
+
description="Example role..."
|
|
3531
|
+
)
|
|
3258
3532
|
|
|
3259
|
-
kinesis.Stream(self, "MyEncryptedStream",
|
|
3260
|
-
encryption=kinesis.StreamEncryption.KMS
|
|
3261
|
-
encryption_key=key
|
|
3533
|
+
stream = kinesis.Stream(self, "MyEncryptedStream",
|
|
3534
|
+
encryption=kinesis.StreamEncryption.KMS
|
|
3262
3535
|
)
|
|
3536
|
+
|
|
3537
|
+
# give lambda permissions to read stream
|
|
3538
|
+
stream.grant_read(lambda_role)
|
|
3263
3539
|
'''
|
|
3264
3540
|
|
|
3265
3541
|
def __init__(
|
|
@@ -3355,7 +3631,7 @@ class Stream(
|
|
|
3355
3631
|
) -> _AddToResourcePolicyResult_1d0a53ad:
|
|
3356
3632
|
'''Adds a statement to the IAM resource policy associated with this stream.
|
|
3357
3633
|
|
|
3358
|
-
If this stream was created in this stack (``new
|
|
3634
|
+
If this stream was created in this stack (``new Stream``), a resource policy
|
|
3359
3635
|
will be automatically created upon the first call to ``addToResourcePolicy``. If
|
|
3360
3636
|
the stream is imported (``Stream.import``), then this is a no-op.
|
|
3361
3637
|
|
|
@@ -4468,6 +4744,293 @@ class StreamAttributes:
|
|
|
4468
4744
|
)
|
|
4469
4745
|
|
|
4470
4746
|
|
|
4747
|
+
@jsii.implements(IStreamConsumer)
|
|
4748
|
+
class StreamConsumer(
|
|
4749
|
+
_Resource_45bc6135,
|
|
4750
|
+
metaclass=jsii.JSIIMeta,
|
|
4751
|
+
jsii_type="aws-cdk-lib.aws_kinesis.StreamConsumer",
|
|
4752
|
+
):
|
|
4753
|
+
'''A Kinesis Stream Consumer.
|
|
4754
|
+
|
|
4755
|
+
:exampleMetadata: infused
|
|
4756
|
+
|
|
4757
|
+
Example::
|
|
4758
|
+
|
|
4759
|
+
lambda_role = iam.Role(self, "Role",
|
|
4760
|
+
assumed_by=iam.ServicePrincipal("lambda.amazonaws.com"),
|
|
4761
|
+
description="Example role..."
|
|
4762
|
+
)
|
|
4763
|
+
|
|
4764
|
+
stream = kinesis.Stream(self, "MyEncryptedStream",
|
|
4765
|
+
encryption=kinesis.StreamEncryption.KMS
|
|
4766
|
+
)
|
|
4767
|
+
stream_consumer = kinesis.StreamConsumer(self, "MyStreamConsumer",
|
|
4768
|
+
stream_consumer_name="MyStreamConsumer",
|
|
4769
|
+
stream=stream
|
|
4770
|
+
)
|
|
4771
|
+
|
|
4772
|
+
# give lambda permissions to read stream via the stream consumer
|
|
4773
|
+
stream_consumer.grant_read(lambda_role)
|
|
4774
|
+
'''
|
|
4775
|
+
|
|
4776
|
+
def __init__(
|
|
4777
|
+
self,
|
|
4778
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
4779
|
+
id: builtins.str,
|
|
4780
|
+
*,
|
|
4781
|
+
stream: IStream,
|
|
4782
|
+
stream_consumer_name: builtins.str,
|
|
4783
|
+
) -> None:
|
|
4784
|
+
'''
|
|
4785
|
+
:param scope: -
|
|
4786
|
+
:param id: -
|
|
4787
|
+
:param stream: The Kinesis data stream to associate this consumer with.
|
|
4788
|
+
:param stream_consumer_name: The name of the stream consumer.
|
|
4789
|
+
'''
|
|
4790
|
+
if __debug__:
|
|
4791
|
+
type_hints = typing.get_type_hints(_typecheckingstub__92f5f01a78ec0e2889ff9d24638f94bc34cb2e1cb6e828df5ba3bd88446ef982)
|
|
4792
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
4793
|
+
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
4794
|
+
props = StreamConsumerProps(
|
|
4795
|
+
stream=stream, stream_consumer_name=stream_consumer_name
|
|
4796
|
+
)
|
|
4797
|
+
|
|
4798
|
+
jsii.create(self.__class__, self, [scope, id, props])
|
|
4799
|
+
|
|
4800
|
+
@jsii.member(jsii_name="fromStreamConsumerArn")
|
|
4801
|
+
@builtins.classmethod
|
|
4802
|
+
def from_stream_consumer_arn(
|
|
4803
|
+
cls,
|
|
4804
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
4805
|
+
id: builtins.str,
|
|
4806
|
+
stream_consumer_arn: builtins.str,
|
|
4807
|
+
) -> IStreamConsumer:
|
|
4808
|
+
'''Imports an existing Kinesis Stream Consumer by its arn.
|
|
4809
|
+
|
|
4810
|
+
:param scope: the Construct scope.
|
|
4811
|
+
:param id: the ID of the construct.
|
|
4812
|
+
:param stream_consumer_arn: the arn of the existing stream consumer.
|
|
4813
|
+
'''
|
|
4814
|
+
if __debug__:
|
|
4815
|
+
type_hints = typing.get_type_hints(_typecheckingstub__5f0b7b629c1bc39d17d380fd07a1480ffe6bd762ae9db4936b106fe46cafc6aa)
|
|
4816
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
4817
|
+
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
4818
|
+
check_type(argname="argument stream_consumer_arn", value=stream_consumer_arn, expected_type=type_hints["stream_consumer_arn"])
|
|
4819
|
+
return typing.cast(IStreamConsumer, jsii.sinvoke(cls, "fromStreamConsumerArn", [scope, id, stream_consumer_arn]))
|
|
4820
|
+
|
|
4821
|
+
@jsii.member(jsii_name="fromStreamConsumerAttributes")
|
|
4822
|
+
@builtins.classmethod
|
|
4823
|
+
def from_stream_consumer_attributes(
|
|
4824
|
+
cls,
|
|
4825
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
4826
|
+
id: builtins.str,
|
|
4827
|
+
*,
|
|
4828
|
+
stream_consumer_arn: builtins.str,
|
|
4829
|
+
) -> IStreamConsumer:
|
|
4830
|
+
'''Imports an existing Kinesis Stream Consumer by its attributes.
|
|
4831
|
+
|
|
4832
|
+
:param scope: the Construct scope.
|
|
4833
|
+
:param id: the ID of the construct.
|
|
4834
|
+
:param stream_consumer_arn: The Amazon Resource Name (ARN) of the stream consumer.
|
|
4835
|
+
'''
|
|
4836
|
+
if __debug__:
|
|
4837
|
+
type_hints = typing.get_type_hints(_typecheckingstub__f17e059f4c9c80a17ccaf154600fcef4fb1d6913f82f8c94fa23e8d4ba96b253)
|
|
4838
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
4839
|
+
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
4840
|
+
attrs = StreamConsumerAttributes(stream_consumer_arn=stream_consumer_arn)
|
|
4841
|
+
|
|
4842
|
+
return typing.cast(IStreamConsumer, jsii.sinvoke(cls, "fromStreamConsumerAttributes", [scope, id, attrs]))
|
|
4843
|
+
|
|
4844
|
+
@jsii.member(jsii_name="addToResourcePolicy")
|
|
4845
|
+
def add_to_resource_policy(
|
|
4846
|
+
self,
|
|
4847
|
+
statement: _PolicyStatement_0fe33853,
|
|
4848
|
+
) -> _AddToResourcePolicyResult_1d0a53ad:
|
|
4849
|
+
'''Adds a statement to the IAM resource policy associated with this stream consumer.
|
|
4850
|
+
|
|
4851
|
+
If this stream consumer was created in this stack (``new StreamConsumer``), a resource policy
|
|
4852
|
+
will be automatically created upon the first call to ``addToResourcePolicy``. If
|
|
4853
|
+
the stream is imported (``StreamConsumer.from``), then this is a no-op.
|
|
4854
|
+
|
|
4855
|
+
:param statement: -
|
|
4856
|
+
'''
|
|
4857
|
+
if __debug__:
|
|
4858
|
+
type_hints = typing.get_type_hints(_typecheckingstub__106f9684fefb675b40f61d28d1dda945ae52717ea3b5e7e128cfc0199ddead44)
|
|
4859
|
+
check_type(argname="argument statement", value=statement, expected_type=type_hints["statement"])
|
|
4860
|
+
return typing.cast(_AddToResourcePolicyResult_1d0a53ad, jsii.invoke(self, "addToResourcePolicy", [statement]))
|
|
4861
|
+
|
|
4862
|
+
@jsii.member(jsii_name="grant")
|
|
4863
|
+
def grant(
|
|
4864
|
+
self,
|
|
4865
|
+
grantee: _IGrantable_71c4f5de,
|
|
4866
|
+
*actions: builtins.str,
|
|
4867
|
+
) -> _Grant_a7ae64f8:
|
|
4868
|
+
'''Grant the indicated permissions on this stream consumer to the given IAM principal (Role/Group/User).
|
|
4869
|
+
|
|
4870
|
+
:param grantee: -
|
|
4871
|
+
:param actions: -
|
|
4872
|
+
'''
|
|
4873
|
+
if __debug__:
|
|
4874
|
+
type_hints = typing.get_type_hints(_typecheckingstub__ea5ac90fc600673df96ac4c0dfcc78a85073a04b78101720e951e1ad1275947a)
|
|
4875
|
+
check_type(argname="argument grantee", value=grantee, expected_type=type_hints["grantee"])
|
|
4876
|
+
check_type(argname="argument actions", value=actions, expected_type=typing.Tuple[type_hints["actions"], ...]) # pyright: ignore [reportGeneralTypeIssues]
|
|
4877
|
+
return typing.cast(_Grant_a7ae64f8, jsii.invoke(self, "grant", [grantee, *actions]))
|
|
4878
|
+
|
|
4879
|
+
@jsii.member(jsii_name="grantRead")
|
|
4880
|
+
def grant_read(self, grantee: _IGrantable_71c4f5de) -> _Grant_a7ae64f8:
|
|
4881
|
+
'''Grant read permissions for this stream consumer and its associated stream to an IAM principal (Role/Group/User).
|
|
4882
|
+
|
|
4883
|
+
:param grantee: -
|
|
4884
|
+
'''
|
|
4885
|
+
if __debug__:
|
|
4886
|
+
type_hints = typing.get_type_hints(_typecheckingstub__21b7fc951011e7e3fc14b6da5ab3310f7cb75cec5142637f1f3948367f34ac02)
|
|
4887
|
+
check_type(argname="argument grantee", value=grantee, expected_type=type_hints["grantee"])
|
|
4888
|
+
return typing.cast(_Grant_a7ae64f8, jsii.invoke(self, "grantRead", [grantee]))
|
|
4889
|
+
|
|
4890
|
+
@builtins.property
|
|
4891
|
+
@jsii.member(jsii_name="autoCreatePolicy")
|
|
4892
|
+
def _auto_create_policy(self) -> builtins.bool:
|
|
4893
|
+
'''Indicates if a resource policy should automatically be created upon the first call to ``addToResourcePolicy``.
|
|
4894
|
+
|
|
4895
|
+
Set by subclasses.
|
|
4896
|
+
'''
|
|
4897
|
+
return typing.cast(builtins.bool, jsii.get(self, "autoCreatePolicy"))
|
|
4898
|
+
|
|
4899
|
+
@builtins.property
|
|
4900
|
+
@jsii.member(jsii_name="stream")
|
|
4901
|
+
def stream(self) -> IStream:
|
|
4902
|
+
'''The Kinesis data stream this consumer is associated with.'''
|
|
4903
|
+
return typing.cast(IStream, jsii.get(self, "stream"))
|
|
4904
|
+
|
|
4905
|
+
@builtins.property
|
|
4906
|
+
@jsii.member(jsii_name="streamConsumerArn")
|
|
4907
|
+
def stream_consumer_arn(self) -> builtins.str:
|
|
4908
|
+
'''The Amazon Resource Name (ARN) of the stream consumer.'''
|
|
4909
|
+
return typing.cast(builtins.str, jsii.get(self, "streamConsumerArn"))
|
|
4910
|
+
|
|
4911
|
+
@builtins.property
|
|
4912
|
+
@jsii.member(jsii_name="streamConsumerName")
|
|
4913
|
+
def stream_consumer_name(self) -> builtins.str:
|
|
4914
|
+
'''The name of the stream consumer.'''
|
|
4915
|
+
return typing.cast(builtins.str, jsii.get(self, "streamConsumerName"))
|
|
4916
|
+
|
|
4917
|
+
|
|
4918
|
+
@jsii.data_type(
|
|
4919
|
+
jsii_type="aws-cdk-lib.aws_kinesis.StreamConsumerAttributes",
|
|
4920
|
+
jsii_struct_bases=[],
|
|
4921
|
+
name_mapping={"stream_consumer_arn": "streamConsumerArn"},
|
|
4922
|
+
)
|
|
4923
|
+
class StreamConsumerAttributes:
|
|
4924
|
+
def __init__(self, *, stream_consumer_arn: builtins.str) -> None:
|
|
4925
|
+
'''A reference to a StreamConsumer, which can be imported using ``StreamConsumer.fromStreamConsumerAttributes``.
|
|
4926
|
+
|
|
4927
|
+
:param stream_consumer_arn: The Amazon Resource Name (ARN) of the stream consumer.
|
|
4928
|
+
|
|
4929
|
+
:exampleMetadata: fixture=_generated
|
|
4930
|
+
|
|
4931
|
+
Example::
|
|
4932
|
+
|
|
4933
|
+
# The code below shows an example of how to instantiate this type.
|
|
4934
|
+
# The values are placeholders you should change.
|
|
4935
|
+
from aws_cdk import aws_kinesis as kinesis
|
|
4936
|
+
|
|
4937
|
+
stream_consumer_attributes = kinesis.StreamConsumerAttributes(
|
|
4938
|
+
stream_consumer_arn="streamConsumerArn"
|
|
4939
|
+
)
|
|
4940
|
+
'''
|
|
4941
|
+
if __debug__:
|
|
4942
|
+
type_hints = typing.get_type_hints(_typecheckingstub__20c23f144f51a3022c363961c4f41ecf0c94178d27a73de9a47005ed26d27e2f)
|
|
4943
|
+
check_type(argname="argument stream_consumer_arn", value=stream_consumer_arn, expected_type=type_hints["stream_consumer_arn"])
|
|
4944
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
4945
|
+
"stream_consumer_arn": stream_consumer_arn,
|
|
4946
|
+
}
|
|
4947
|
+
|
|
4948
|
+
@builtins.property
|
|
4949
|
+
def stream_consumer_arn(self) -> builtins.str:
|
|
4950
|
+
'''The Amazon Resource Name (ARN) of the stream consumer.'''
|
|
4951
|
+
result = self._values.get("stream_consumer_arn")
|
|
4952
|
+
assert result is not None, "Required property 'stream_consumer_arn' is missing"
|
|
4953
|
+
return typing.cast(builtins.str, result)
|
|
4954
|
+
|
|
4955
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
4956
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
4957
|
+
|
|
4958
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
4959
|
+
return not (rhs == self)
|
|
4960
|
+
|
|
4961
|
+
def __repr__(self) -> str:
|
|
4962
|
+
return "StreamConsumerAttributes(%s)" % ", ".join(
|
|
4963
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
4964
|
+
)
|
|
4965
|
+
|
|
4966
|
+
|
|
4967
|
+
@jsii.data_type(
|
|
4968
|
+
jsii_type="aws-cdk-lib.aws_kinesis.StreamConsumerProps",
|
|
4969
|
+
jsii_struct_bases=[],
|
|
4970
|
+
name_mapping={"stream": "stream", "stream_consumer_name": "streamConsumerName"},
|
|
4971
|
+
)
|
|
4972
|
+
class StreamConsumerProps:
|
|
4973
|
+
def __init__(self, *, stream: IStream, stream_consumer_name: builtins.str) -> None:
|
|
4974
|
+
'''Properties for a Kinesis Stream Consumer.
|
|
4975
|
+
|
|
4976
|
+
:param stream: The Kinesis data stream to associate this consumer with.
|
|
4977
|
+
:param stream_consumer_name: The name of the stream consumer.
|
|
4978
|
+
|
|
4979
|
+
:exampleMetadata: infused
|
|
4980
|
+
|
|
4981
|
+
Example::
|
|
4982
|
+
|
|
4983
|
+
lambda_role = iam.Role(self, "Role",
|
|
4984
|
+
assumed_by=iam.ServicePrincipal("lambda.amazonaws.com"),
|
|
4985
|
+
description="Example role..."
|
|
4986
|
+
)
|
|
4987
|
+
|
|
4988
|
+
stream = kinesis.Stream(self, "MyEncryptedStream",
|
|
4989
|
+
encryption=kinesis.StreamEncryption.KMS
|
|
4990
|
+
)
|
|
4991
|
+
stream_consumer = kinesis.StreamConsumer(self, "MyStreamConsumer",
|
|
4992
|
+
stream_consumer_name="MyStreamConsumer",
|
|
4993
|
+
stream=stream
|
|
4994
|
+
)
|
|
4995
|
+
|
|
4996
|
+
# give lambda permissions to read stream via the stream consumer
|
|
4997
|
+
stream_consumer.grant_read(lambda_role)
|
|
4998
|
+
'''
|
|
4999
|
+
if __debug__:
|
|
5000
|
+
type_hints = typing.get_type_hints(_typecheckingstub__9f73c02253aa03618517236d4d9c34ae8992a4074435af984a475dc83cc0adf8)
|
|
5001
|
+
check_type(argname="argument stream", value=stream, expected_type=type_hints["stream"])
|
|
5002
|
+
check_type(argname="argument stream_consumer_name", value=stream_consumer_name, expected_type=type_hints["stream_consumer_name"])
|
|
5003
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
5004
|
+
"stream": stream,
|
|
5005
|
+
"stream_consumer_name": stream_consumer_name,
|
|
5006
|
+
}
|
|
5007
|
+
|
|
5008
|
+
@builtins.property
|
|
5009
|
+
def stream(self) -> IStream:
|
|
5010
|
+
'''The Kinesis data stream to associate this consumer with.'''
|
|
5011
|
+
result = self._values.get("stream")
|
|
5012
|
+
assert result is not None, "Required property 'stream' is missing"
|
|
5013
|
+
return typing.cast(IStream, result)
|
|
5014
|
+
|
|
5015
|
+
@builtins.property
|
|
5016
|
+
def stream_consumer_name(self) -> builtins.str:
|
|
5017
|
+
'''The name of the stream consumer.'''
|
|
5018
|
+
result = self._values.get("stream_consumer_name")
|
|
5019
|
+
assert result is not None, "Required property 'stream_consumer_name' is missing"
|
|
5020
|
+
return typing.cast(builtins.str, result)
|
|
5021
|
+
|
|
5022
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
5023
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
5024
|
+
|
|
5025
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
5026
|
+
return not (rhs == self)
|
|
5027
|
+
|
|
5028
|
+
def __repr__(self) -> str:
|
|
5029
|
+
return "StreamConsumerProps(%s)" % ", ".join(
|
|
5030
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
5031
|
+
)
|
|
5032
|
+
|
|
5033
|
+
|
|
4471
5034
|
@jsii.enum(jsii_type="aws-cdk-lib.aws_kinesis.StreamEncryption")
|
|
4472
5035
|
class StreamEncryption(enum.Enum):
|
|
4473
5036
|
'''What kind of server-side encryption to apply to this stream.
|
|
@@ -4476,12 +5039,17 @@ class StreamEncryption(enum.Enum):
|
|
|
4476
5039
|
|
|
4477
5040
|
Example::
|
|
4478
5041
|
|
|
4479
|
-
|
|
5042
|
+
lambda_role = iam.Role(self, "Role",
|
|
5043
|
+
assumed_by=iam.ServicePrincipal("lambda.amazonaws.com"),
|
|
5044
|
+
description="Example role..."
|
|
5045
|
+
)
|
|
4480
5046
|
|
|
4481
|
-
kinesis.Stream(self, "MyEncryptedStream",
|
|
4482
|
-
encryption=kinesis.StreamEncryption.KMS
|
|
4483
|
-
encryption_key=key
|
|
5047
|
+
stream = kinesis.Stream(self, "MyEncryptedStream",
|
|
5048
|
+
encryption=kinesis.StreamEncryption.KMS
|
|
4484
5049
|
)
|
|
5050
|
+
|
|
5051
|
+
# give lambda permissions to read stream
|
|
5052
|
+
stream.grant_read(lambda_role)
|
|
4485
5053
|
'''
|
|
4486
5054
|
|
|
4487
5055
|
UNENCRYPTED = "UNENCRYPTED"
|
|
@@ -4682,10 +5250,14 @@ __all__ = [
|
|
|
4682
5250
|
"CfnStreamConsumerProps",
|
|
4683
5251
|
"CfnStreamProps",
|
|
4684
5252
|
"IStream",
|
|
5253
|
+
"IStreamConsumer",
|
|
4685
5254
|
"ResourcePolicy",
|
|
4686
5255
|
"ResourcePolicyProps",
|
|
4687
5256
|
"Stream",
|
|
4688
5257
|
"StreamAttributes",
|
|
5258
|
+
"StreamConsumer",
|
|
5259
|
+
"StreamConsumerAttributes",
|
|
5260
|
+
"StreamConsumerProps",
|
|
4689
5261
|
"StreamEncryption",
|
|
4690
5262
|
"StreamMode",
|
|
4691
5263
|
"StreamProps",
|
|
@@ -4914,20 +5486,41 @@ def _typecheckingstub__bd578f4ca8facd0463f7e56d3d2cea7e56ba9ad274338af8f84fa661d
|
|
|
4914
5486
|
"""Type checking stubs"""
|
|
4915
5487
|
pass
|
|
4916
5488
|
|
|
5489
|
+
def _typecheckingstub__37c37a05c26ce89345f11707cf8d0c79c7d0abfdb26093c52bdf5503d8f1d7d3(
|
|
5490
|
+
statement: _PolicyStatement_0fe33853,
|
|
5491
|
+
) -> None:
|
|
5492
|
+
"""Type checking stubs"""
|
|
5493
|
+
pass
|
|
5494
|
+
|
|
5495
|
+
def _typecheckingstub__cf3550b30daa1ef048e2fefa63cc0765dc59458fde35eb1301476a6b6c3ac2e9(
|
|
5496
|
+
grantee: _IGrantable_71c4f5de,
|
|
5497
|
+
*actions: builtins.str,
|
|
5498
|
+
) -> None:
|
|
5499
|
+
"""Type checking stubs"""
|
|
5500
|
+
pass
|
|
5501
|
+
|
|
5502
|
+
def _typecheckingstub__ce58f2c46edcaa40f59d7e5fc1f893d206283c930800a7814a6a4e0636aa7638(
|
|
5503
|
+
grantee: _IGrantable_71c4f5de,
|
|
5504
|
+
) -> None:
|
|
5505
|
+
"""Type checking stubs"""
|
|
5506
|
+
pass
|
|
5507
|
+
|
|
4917
5508
|
def _typecheckingstub__4488fc34b1387c696011cd138108f10e13139cd2d56365a8ba9602ad6ba244f0(
|
|
4918
5509
|
scope: _constructs_77d1e7e8.Construct,
|
|
4919
5510
|
id: builtins.str,
|
|
4920
5511
|
*,
|
|
4921
|
-
stream: IStream,
|
|
4922
5512
|
policy_document: typing.Optional[_PolicyDocument_3ac34393] = None,
|
|
5513
|
+
stream: typing.Optional[IStream] = None,
|
|
5514
|
+
stream_consumer: typing.Optional[IStreamConsumer] = None,
|
|
4923
5515
|
) -> None:
|
|
4924
5516
|
"""Type checking stubs"""
|
|
4925
5517
|
pass
|
|
4926
5518
|
|
|
4927
5519
|
def _typecheckingstub__b4f61add9bc5e3d367f841a39ff9a752c7eed270f05849d0b5f9dc5e5ad3382a(
|
|
4928
5520
|
*,
|
|
4929
|
-
stream: IStream,
|
|
4930
5521
|
policy_document: typing.Optional[_PolicyDocument_3ac34393] = None,
|
|
5522
|
+
stream: typing.Optional[IStream] = None,
|
|
5523
|
+
stream_consumer: typing.Optional[IStreamConsumer] = None,
|
|
4931
5524
|
) -> None:
|
|
4932
5525
|
"""Type checking stubs"""
|
|
4933
5526
|
pass
|
|
@@ -5021,6 +5614,67 @@ def _typecheckingstub__91a6150e079b5a451763b8bb3f2235aa5c667a527f0d1c95510199368
|
|
|
5021
5614
|
"""Type checking stubs"""
|
|
5022
5615
|
pass
|
|
5023
5616
|
|
|
5617
|
+
def _typecheckingstub__92f5f01a78ec0e2889ff9d24638f94bc34cb2e1cb6e828df5ba3bd88446ef982(
|
|
5618
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
5619
|
+
id: builtins.str,
|
|
5620
|
+
*,
|
|
5621
|
+
stream: IStream,
|
|
5622
|
+
stream_consumer_name: builtins.str,
|
|
5623
|
+
) -> None:
|
|
5624
|
+
"""Type checking stubs"""
|
|
5625
|
+
pass
|
|
5626
|
+
|
|
5627
|
+
def _typecheckingstub__5f0b7b629c1bc39d17d380fd07a1480ffe6bd762ae9db4936b106fe46cafc6aa(
|
|
5628
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
5629
|
+
id: builtins.str,
|
|
5630
|
+
stream_consumer_arn: builtins.str,
|
|
5631
|
+
) -> None:
|
|
5632
|
+
"""Type checking stubs"""
|
|
5633
|
+
pass
|
|
5634
|
+
|
|
5635
|
+
def _typecheckingstub__f17e059f4c9c80a17ccaf154600fcef4fb1d6913f82f8c94fa23e8d4ba96b253(
|
|
5636
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
5637
|
+
id: builtins.str,
|
|
5638
|
+
*,
|
|
5639
|
+
stream_consumer_arn: builtins.str,
|
|
5640
|
+
) -> None:
|
|
5641
|
+
"""Type checking stubs"""
|
|
5642
|
+
pass
|
|
5643
|
+
|
|
5644
|
+
def _typecheckingstub__106f9684fefb675b40f61d28d1dda945ae52717ea3b5e7e128cfc0199ddead44(
|
|
5645
|
+
statement: _PolicyStatement_0fe33853,
|
|
5646
|
+
) -> None:
|
|
5647
|
+
"""Type checking stubs"""
|
|
5648
|
+
pass
|
|
5649
|
+
|
|
5650
|
+
def _typecheckingstub__ea5ac90fc600673df96ac4c0dfcc78a85073a04b78101720e951e1ad1275947a(
|
|
5651
|
+
grantee: _IGrantable_71c4f5de,
|
|
5652
|
+
*actions: builtins.str,
|
|
5653
|
+
) -> None:
|
|
5654
|
+
"""Type checking stubs"""
|
|
5655
|
+
pass
|
|
5656
|
+
|
|
5657
|
+
def _typecheckingstub__21b7fc951011e7e3fc14b6da5ab3310f7cb75cec5142637f1f3948367f34ac02(
|
|
5658
|
+
grantee: _IGrantable_71c4f5de,
|
|
5659
|
+
) -> None:
|
|
5660
|
+
"""Type checking stubs"""
|
|
5661
|
+
pass
|
|
5662
|
+
|
|
5663
|
+
def _typecheckingstub__20c23f144f51a3022c363961c4f41ecf0c94178d27a73de9a47005ed26d27e2f(
|
|
5664
|
+
*,
|
|
5665
|
+
stream_consumer_arn: builtins.str,
|
|
5666
|
+
) -> None:
|
|
5667
|
+
"""Type checking stubs"""
|
|
5668
|
+
pass
|
|
5669
|
+
|
|
5670
|
+
def _typecheckingstub__9f73c02253aa03618517236d4d9c34ae8992a4074435af984a475dc83cc0adf8(
|
|
5671
|
+
*,
|
|
5672
|
+
stream: IStream,
|
|
5673
|
+
stream_consumer_name: builtins.str,
|
|
5674
|
+
) -> None:
|
|
5675
|
+
"""Type checking stubs"""
|
|
5676
|
+
pass
|
|
5677
|
+
|
|
5024
5678
|
def _typecheckingstub__88629f78086711b76f550ae13e14f2db1429deb350aa5b10b7073d5852dadfcc(
|
|
5025
5679
|
*,
|
|
5026
5680
|
encryption: typing.Optional[StreamEncryption] = None,
|