# IResourceWithPolicyV2

A resource with a resource policy that can be added to.

Extends: IResourceWithPolicyV2
Extends: IEnvironmentAware
Implemented by: LambdaRestApi, RestApi, RestApiBase, SpecRestApi, StepFunctionsRestApi, Table, TableBase, TableBaseV2, TableV2, TableV2MultiAccountReplica, FileSystem, EventBus, LogGroup

- Source: [`aws-iam/lib/grant.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-iam/lib/grant.ts#L559)
- Type last changed: v2.224.0 · 13 Nov 2025

## Properties

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) — The environment this resource belongs to.

  For resources that are created and managed in a Stack (those created by
  creating new class instances like `new Role()`, `new Bucket()`, etc.), this
  is always the same as the environment of the stack they belong to.

  For referenced resources (those obtained from referencing methods like
  `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
  different than the stack they were imported into.

## Methods

- `addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResult` — Add a statement to the resource's resource policy.
