Skip to content

I<Resource> interfaces should have grants #36276

@Tietew

Description

@Tietew

Describe the feature

Now, most of L2 constructs introduce grants.
But grants are not included in I<Resoure> 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:

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-snsRelated to Amazon Simple Notification Serviceeffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions