Skip to content

apprunner: Allow instanceRole to be obtained from Service instances. #26089

@kmkhr

Description

@kmkhr

Describe the feature

Currently, instanceRole can only be set from the constructor.
If it is possible to retrieve it even after initialization like obtainExecutionRole in TaskDefinition of ECS, it would be useful to be able to grant privileges with the grant method.

Use Case

Use as follows:

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.obtainInstanceRole());

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.85.0

Environment details (OS name and version, etc.)

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-apprunnerRelated to the apprunner packageeffort/smallSmall work item – less than a day 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