Skip to content

Commit

Permalink
feat(cognito): make grant() available on IUserPool (#20799)
Browse files Browse the repository at this point in the history
Added in #20285 but missing on `IUserPool`

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
jogold authored Jun 29, 2022
1 parent 2566017 commit a1df570
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/@aws-cdk/aws-cognito/lib/user-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,12 @@ export interface IUserPool extends IResource {
* Register an identity provider with this user pool.
*/
registerIdentityProvider(provider: IUserPoolIdentityProvider): void;

/**
* Adds an IAM policy statement associated with this user pool to an
* IAM principal's policy.
*/
grant(grantee: IGrantable, ...actions: string[]): Grant;
}

abstract class UserPoolBase extends Resource implements IUserPool {
Expand Down Expand Up @@ -735,10 +741,6 @@ abstract class UserPoolBase extends Resource implements IUserPool {
this.identityProviders.push(provider);
}

/**
* Adds an IAM policy statement associated with this user pool to an
* IAM principal's policy.
*/
public grant(grantee: IGrantable, ...actions: string[]): Grant {
return Grant.addToPrincipal({
grantee,
Expand Down

0 comments on commit a1df570

Please sign in to comment.