(aws-lambda-event-sources): S3EventSource
should take IBucket
instead of Bucket
#4323
Closed
Description
Reproduction Steps
Cannot import an existing s3 bucket when creating Lambda s3 events:
aws_s3.Bucket.from_bucket_name(...)
oraws_s3.Bucket.from_bucket_arn(...)
, etc. returnsaws_s3.IBucket
type- However,
aws_lambda_event_sources.S3EventSource
only takesaws_s3.Bucket
type as a parameter - Note:
aws_s3.Bucket
implementsaws_s3.IBucket
Error Log
File "/usr/local/lib/python3.6/site-packages/jsii/_runtime.py", line 66, in __call__
inst = super().__call__(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/aws_cdk/aws_lambda_event_sources/__init__.py", line 199, in __init__
jsii.create(S3EventSource, self, [bucket, props])
File "/usr/local/lib/python3.6/site-packages/jsii/_kernel/__init__.py", line 208, in create
overrides=overrides,
File "/usr/local/lib/python3.6/site-packages/jsii/_kernel/providers/process.py", line 331, in create
return self._process.send(request, CreateResponse)
File "/usr/local/lib/python3.6/site-packages/jsii/_kernel/providers/process.py", line 316, in send
raise JSIIError(resp.error) from JavaScriptError(resp.stack)
jsii.errors.JSIIError: Object of type @aws-cdk/aws-s3.IBucket is not convertible to @aws-cdk/aws-s3.Bucket
Environment
- CLI Version : v1.10.1
- Framework Version: v1.10.1
- OS : Mac OS
- Language : Python
Other
aws_lambda_event_sources.S3EventSource
should take aws_s3.IBucket
as a parameter's type.
This is 🐛 Bug Report