---
title: "POST /#X-Amz-Target=AmazonEC2ContainerRegistry_V20150921.CreatePullThroughCacheRule"
method: POST
path: "/#X-Amz-Target=AmazonEC2ContainerRegistry_V20150921.CreatePullThroughCacheRule"
---

# POST /#X-Amz-Target=AmazonEC2ContainerRegistry_V20150921.CreatePullThroughCacheRule

`POST /#X-Amz-Target=AmazonEC2ContainerRegistry_V20150921.CreatePullThroughCacheRule`

Creates a pull through cache rule. A pull through cache rule provides a way to cache images from an external public registry in your Amazon ECR private registry.

## Headers

- `X-Amz-Target` 'AmazonEC2ContainerRegistry_V20150921.CreatePullThroughCacheRule', required

## Request body

- CreatePullThroughCacheRuleRequest
  - `ecrRepositoryPrefix` string, required — The repository name prefix to use when caching images from the source registry.
  - `upstreamRegistryUrl` string, required — The registry URL of the upstream public registry to use as the source for the pull through cache rule.
  - `registryId` string — The Amazon Web Services account ID associated with the registry to create the pull through cache rule for. If you do not specify a registry, the default registry is assumed.

## Response `200`

Success

- CreatePullThroughCacheRuleResponse
  - `ecrRepositoryPrefix` string — The Amazon ECR repository prefix associated with the pull through cache rule.
  - `upstreamRegistryUrl` string — The upstream registry URL associated with the pull through cache rule.
  - `createdAt` string, date-time — The date and time, in JavaScript date format, when the pull through cache rule was created.
  - `registryId` string — The registry ID associated with the request.

## Other responses

- `480` — ServerException
- `481` — InvalidParameterException
- `482` — ValidationException
- `483` — PullThroughCacheRuleAlreadyExistsException
- `484` — UnsupportedUpstreamRegistryException
- `485` — LimitExceededException

---

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