---
title: "PUT /resourcepolicy/{resourceArn}"
method: PUT
path: "/resourcepolicy/{resourceArn}"
---

# PUT /resourcepolicy/{resourceArn}

`PUT /resourcepolicy/{resourceArn}`

Associates a resource policy with a knowledge base. A resource policy allows other AWS accounts to access the knowledge base. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-cross-account.html">Cross-account access for knowledge bases</a>.

## Path parameters

- `resourceArn` string, required

## Request body

- object
  - `policy` string, required — The JSON-formatted resource policy to associate with the knowledge base.
  - `expectedRevisionId` string — The expected revision identifier of the resource policy. Use this to prevent conflicts when multiple users update the same policy concurrently. Specify the <code>revisionId</code> from the most recent <code>GetResourcePolicy</code> or <code>PutResourcePolicy</code> response.

## Response `200`

Success

- PutResourcePolicyResponse
  - `resourceArn` string, required — The ARN of the knowledge base that the resource policy was attached to.
  - `revisionId` string, required — The revision identifier of the resource policy. Use this value in the <code>expectedRevisionId</code> field of a subsequent <code>PutResourcePolicy</code> or <code>DeleteResourcePolicy</code> request.

## Other responses

- `480` — ThrottlingException
- `481` — AccessDeniedException
- `482` — ValidationException
- `483` — InternalServerException
- `484` — ResourceNotFoundException
- `485` — ConflictException

---

[API](https://skmtc.net/aws/apis/bedrock-agent.md) · [All operations](https://skmtc.net/aws/apis/bedrock-agent/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/bedrock-agent/versions/a3b2356f17da/schema)
