# PolicyResource

The resource a policy statement applies to.

AgentCore rejects a policy whose resource is an unconstrained wildcard, so a
statement must name either a resource type or a specific resource.

- Source: [`aws-bedrockagentcore/lib/policy/policy-statement.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-bedrockagentcore/lib/policy/policy-statement.ts#L569)
- Type last changed: v2.269.0 · 10 Sep 2026

## Example

```ts
import { PolicyResource } from 'aws-cdk-lib/aws-bedrockagentcore';
declare const gatewayArn: string;

PolicyResource.anyOfType('AgentCore::Gateway'); // resource is AgentCore::Gateway
PolicyResource.instance('AgentCore::Gateway', gatewayArn); // resource == AgentCore::Gateway::"<arn>"
```

## Methods

- `anyOfType(entityType: string): PolicyResource // chainable` (static) — Any resource of the given entity type.

  **Parameters**

  - `entityType` — - The entity type, for example 'AgentCore::Gateway'.

- `instance(entityType: string, entityArn: string): PolicyResource // chainable` (static) — One specific resource.

  AgentCore requires a specific resource when the statement names specific
  actions rather than any action.

  **Parameters**

  - `entityType` — - The entity type, for example 'AgentCore::Gateway'.
  - `entityArn` — - The resource ARN or identifier.
