feat(apprunner): make Service implement IGrantable#26130
feat(apprunner): make Service implement IGrantable#26130mergify[bot] merged 9 commits intoaws:mainfrom
Service implement IGrantable#26130Conversation
| * This method exposes the Instance Role after creating it if not set. | ||
| * @returns iam.IRole | ||
| */ | ||
| public obtainInstanceRole(): iam.IRole { |
There was a problem hiding this comment.
What if we instead made Service implement IGrantable? Then we could just do
things like
bucket.grantRead(service);Service implement IGrantable
corymhall
left a comment
There was a problem hiding this comment.
Can you also add an addToRolePolicy method? I'm also going to change this to a feat. Adding the auto creation of the role should cause the integ test to update and we'll need a README update.
| this.props = props; | ||
|
|
||
| this.instanceRole = this.props.instanceRole; | ||
| this.grantPrincipal = this.instanceRole || new iam.UnknownPrincipal({ resource: this }); |
There was a problem hiding this comment.
I think we should just go ahead and create the role if the user doesn't provide it. I'm not sure why we try to only generate one if needed.
Service implement IGrantableService implement IGrantable
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
|
Exemption request. |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
|
This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week. |
@corymhall I've implemented the requested changes. |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Implementing `IGrantable` for cases when it's needed to grant permissions to a `Service` instance.
For example:
```
declare const bucket: IBucket;
const service = new apprunner.Service(this, 'Service', {
source: apprunner.Source.fromEcrPublic({
imageConfiguration: { port: 8000 },
imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
}),
});
bucket.grantRead(service);
```
Closes aws#26089.
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Implementing
IGrantablefor cases when it's needed to grant permissions to aServiceinstance.For example:
Closes #26089.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license