fix(aws-kinesisfirehose-s3): Fix type of kinesisFirehoseProps prop.#1002
fix(aws-kinesisfirehose-s3): Fix type of kinesisFirehoseProps prop.#1002ScottRobinson03 wants to merge 1 commit intoawslabs:mainfrom
kinesisFirehoseProps prop.#1002Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Looks like there's something wrong with the build steps so the CodeBuild is failing... 🤔 |
|
Thanks! Unfortunately, the issue here is that Solutions Constructs uses JSII to publish the libraries for Java and Python projects (the same library used by CDK to support multiple clients). The benefit of this is being able to serve more clients, but the drawback is that this imposes limitations in how we manipulate types in Typescript. We want to allow users to specify any subset of properties on incoming props without having to fill in all required properties (which we will supply as defaults), hence our use of In this case, the build is working fine - but our build step is jsii rather than tsc. The first error that occurs in the log is: Which indicates to me that JSII cannot not process the |
Hmm, interesting, I see. Thanks for the response. After doing a little bit of research I came across aws/jsii#1707, which suggests using jsii-struct-builder to add support for utility types such as |
In V1.64.0 the type of the
kinesisFirehosePropsprop was adjusted fromkinesisfirehose.CfnDeliveryStreamPropstokinesisfirehose.CfnDeliveryStreamProps | any. I assume this was to prevent a type error aroundbucketArnandroleArnbeing required inkinesisfirehose.CfnDeliveryStreamProps, but not within the prop (since the construct handles setting these).This was a lazy solution that meant developers haven't been able to benefit from the autocompletion of the type. The type has been corrected in this PR so that people can get autocomplete on the properties again.
The type admittedly isn't the prettiest, but does work and is the best way I could find to achieve the correct type.
I'm not sure why there's a
| cdk.IResolvable;on the type originally, but I kept it here just in case.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.