-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
(kinesisfirehose): DeliveryStream creates useless role #26927
Comments
@peterwoodworth I'll take this. |
Thanks! |
const deliveryStream = new firehose.DeliveryStream(this, 'DeliveryStream', { // Check if encryptionKey, encryption, or sourceStream props are specified |
) When a DeliveryStream is created without `sourceStream` or `encryptionKey`, an extra role is being created that is unused. This PR removes creation of that role. I also learned that the role created for `encryptionKey` is used "indirectly" for a grant put on the KMS key...interesting. Closes #26927. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
) When a DeliveryStream is created without `sourceStream` or `encryptionKey`, an extra role is being created that is unused. This PR removes creation of that role. I also learned that the role created for `encryptionKey` is used "indirectly" for a grant put on the KMS key...interesting. Closes #26927. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This introduces a new error for existing components: It is because the role is being created again here while it was already created in the constructor here. The solution for now is to just specify the role explicitly, like: const deliveryStream = new kdfAlpha.DeliveryStream(this, idPrefix + 'Firehose', {
deliveryStreamName,
destinations: [destinationBucket],
role: new iam.Role(this, 'Service Role', {
assumedBy: new iam.ServicePrincipal('firehose.amazonaws.com'),
})
}) This workaround works for the current logic in the component. Just commenting for when others also experience it. Don't think it is high priority since no one has picked it up. Just happens that we do the logic paths that create the role twice. |
Describe the bug
The DeliveryStream construct always creates a role
aws-cdk/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/delivery-stream.ts
Line 325 in 724bd01
However, this role ends up with no permissions, and no reason to exist if no source stream or encryption key are used:
Expected Behavior
I expect no role to be created
Current Behavior
An unnecessary role is created
Reproduction Steps
Create a DeliveryStream without an
encryptionKey
,encryption
, orsourceStream
prop.Possible Solution
In this case, will need to check for appropriate props before creating the role
Additional Information/Context
No response
CDK CLI Version
current
Framework Version
No response
Node.js Version
16
OS
mac
Language
Typescript
Language Version
No response
Other information
Can workaround for now with the following escape hatch:
The text was updated successfully, but these errors were encountered: