(aws-events): IApiDestination is missing grantInvokeApiDestination
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
The [IApiDestination](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.IApiDestination.html) provides currently no grant* method. This makes it harder/more cumbersome to invoke an API Destination from a given construct.
The permission needed to invoke an API Destination: `events:InvokeApiDestination`
### Use Case
I was building the solution for https://github.com/aws/aws-cdk/issues/29386 and when I wrote the grantPush functionality in there I was missing the `grantInvokeApiDestination` method of `IApiDestination`
### Proposed Solution
Add method `grantInvokeApiDestination` to `IApiDestination` and implement it in `ApiDestination`.
Method signature could look like that:
`public grantInvokeApiDestination(grantee: iam.IGrantable): iam.Grant`.
It will allow the action `events:InvokeApiDestination` for the grantee.
### Other Information
_No response_
### Acknowledgements
- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CDK version used
2.136.0
### Environment details (OS name and version, etc.)
windows 11
Contributor guide
Research direction
Start at the IApiDestination and ApiDestination entry points in the aws_events module, then inspect the existing grant* patterns they expose. Add the requested grantInvokeApiDestination signature and verify that it grants events:InvokeApiDestination to the supplied grantee; update or run the corresponding module tests if present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- authorization, cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100