Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(aws-events): use grantPutEventsTo on another eventBus #19034

Closed
khawarizmus opened this issue Feb 18, 2022 · 3 comments
Closed

(aws-events): use grantPutEventsTo on another eventBus #19034

khawarizmus opened this issue Feb 18, 2022 · 3 comments
Assignees
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@khawarizmus
Copy link

General Issue

I can find a way to grant put permissions to an eventBus from another eventBus

The Question

I have the following code:

const sourceBus = EventBus.fromEventBusArn(
                this,
                'CSSEventBus',
                props.sourceEventBusARN
            );
            if (props.crossAccountEventBridge.initializeNewBus) {
                bus = new EventBus(this, 'CrossAccountEventBus', {
                    eventBusName: props.crossAccountEventBridge.eventBusName,
                });
            } else {
                bus = EventBus.fromEventBusName(
                    this,
                    'UpdateTenantEventBus',
                    props.crossAccountEventBridge.eventBusName
                );
            }
            bus.grantPutEventsTo(sourceBus); // Error: Argument of type 'IEventBus' is not assignable to parameter of type 'IGrantable'. Property 'grantPrincipal' is missing in type 'IEventBus' but required in type 'IGrantable'.

and as highlighted I get the error Argument of type 'IEventBus' is not assignable to parameter of type 'IGrantable'. Property 'grantPrincipal' is missing in type 'IEventBus' but required in type 'IGrantable'.. but I can't find any workaround for this. not sure how I can implement that in a different way.

I have tried to do bus.grantPutEventsTo(new PrincipaleFronArn(sourceBus.eventBusArn)); but it didn't create any permessions.

CDK CLI Version

2.12.0

Framework Version

2.12.0

Node.js Version

14.19.0

OS

Mac

Language

Typescript

Language Version

4.5.5

Other information

No response

@khawarizmus khawarizmus added guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged. labels Feb 18, 2022
@peterwoodworth
Copy link
Contributor

Our IEventBus interface doesn't extend the IGrantable interface, so you cannot use this method on another Event Bus.

If you wish to have these permissions, you will need to configure the permissions a bit more manually. This is a pretty good guide for a similar scenario which should help you out 🙂

@peterwoodworth peterwoodworth added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Feb 22, 2022
@github-actions
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Feb 25, 2022
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

4 participants