---
title: "PUT /PutComponentPolicy"
method: PUT
path: "/PutComponentPolicy"
---

# PUT /PutComponentPolicy

`PUT /PutComponentPolicy`

Applies a policy to a component. We recommend that you call the RAM API <a href="https://docs.aws.amazon.com/ram/latest/APIReference/API_CreateResourceShare.html">CreateResourceShare</a> to share resources. If you call the Image Builder API <code>PutComponentPolicy</code>, you must also call the RAM API <a href="https://docs.aws.amazon.com/ram/latest/APIReference/API_PromoteResourceShareCreatedFromPolicy.html">PromoteResourceShareCreatedFromPolicy</a> in order for the resource to be visible to all principals with whom the resource is shared.

## Request body

- object
  - `componentArn` string, required — The Amazon Resource Name (ARN) of the component that this policy should be applied to.
  - `policy` string, required — The policy to apply.

## Response `200`

Success

- PutComponentPolicyResponse
  - `requestId` string — The request ID that uniquely identifies this request.
  - `componentArn` string — The Amazon Resource Name (ARN) of the component that this policy was applied to.

## Other responses

- `480` — ServiceException
- `481` — ClientException
- `482` — ServiceUnavailableException
- `483` — InvalidRequestException
- `484` — InvalidParameterValueException
- `485` — ResourceNotFoundException
- `486` — ForbiddenException
- `487` — CallRateLimitExceededException

---

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