aws / aws/aws-cdk

`I<Resource>` interfaces should have `grants`

Open
#36,276 1 comment 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-sns effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

Now, most of L2 constructs introduce `grants`.
But `grants` are not included in `I` interfaces, differ from `grantXxxx()` methods.
These interfaces should have `grants`.

### Use Case

Currently we can grant actions via both `grants` and `grantXxxx()` on concrete construct instance:
``` ts
const topic = new sns.Topic(this, 'Topic');
// OK - Topic has grantPublish() method
topic.grantPublish(grantee);
// OK - Topic has grants property
topic.grants.publish(grantee);
```

We cannot do via `grants` on resource interface:
``` ts
declare const topic: sns.ITopic;
// OK - ITopic has grantPublish() method
topic.grantPublish(grantee);
// ERROR - ITopic has no grants property
topic.grants.publish(grantee);
```

### Proposed Solution

_No response_

### Other Information

Related PR: #36124

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS CDK Library version (aws-cdk-lib)

2.231.0

### AWS CDK CLI version

2.1033.0

### Environment details (OS name and version, etc.)

Linux

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the L2 resource interfaces and the concrete construct grant APIs described in the issue, then compare the related PR #36124. Done means the applicable I interfaces expose grants consistently with their grantXxxx() methods, with the relevant tests updated and passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.