

# Managing the state and products of a premium repository in Amazon ECR Public

To publish premium content, complete the following steps in order:

1. Meet the publisher prerequisites and create a premium repository. See [Considerations for listing premium repositories](public-repository-create.md#public-premium-create).

1. Push your images. See [Pushing an image to a premium repository](docker-push-ecr-image.md#public-premium-push).

1. Review the scan findings for your images. See [Review scan findings for your premium images](public-premium-scanning.md).

1. Set the repository state to `AVAILABLE`, and then make your AWS Marketplace product public. Repositories can take up to an hour for their data to be visible on the Amazon ECR Public Gallery.

1. For premium repositories that are associated with a new AWS Marketplace product, the product must be marked `PUBLIC` before the premium repository and the related product can be found on the Amazon ECR Public Gallery.

When your premium repository is ready for buyers, set its state to `AVAILABLE`. Amazon ECR Public then notifies AWS Marketplace that the associated products can be fulfilled. To stop listing the repository on the Amazon ECR Public Gallery without affecting existing buyers, set its state to `HIDDEN`.

A premium repository is listed on the Amazon ECR Public Gallery when both of the following are true:
+ The repository is in the `AVAILABLE` state.
+ At least one of its associated AWS Marketplace products is public.

After a repository meets these conditions, it can take up to an hour for it to appear in Amazon ECR Public Gallery search results and for its data to be visible globally.

**Important**  
You can't return a repository to the `DRAFT` state. Before you make a repository available, verify its images and associated products. We recommend that you set the repository to `AVAILABLE` before you make the associated AWS Marketplace product public.

**To set the state of a premium repository (AWS Management Console)**

1. Open the Amazon ECR console at [https://console.aws.amazon.com/ecr/](https://console.aws.amazon.com/ecr/).

1. From the navigation bar, choose the AWS Region that contains your premium repository.

1. In the navigation pane, choose **Repositories**.

1. On the **Repositories** page, choose the repository that you want to update the state for.

1. Choose **Actions**, and then choose **Change to hidden** or **Change to available**.

**To set the state of a premium repository (AWS CLI)**

1. Run the **set-repository-state** command with `--repository-type PREMIUM`, and specify `AVAILABLE` or `HIDDEN`.

   ```
   aws ecr-public set-repository-state \
        --repository-name {{my-premium-app}} \
        --repository-type PREMIUM \
        --state AVAILABLE \
        --region us-east-1
   ```

1. Verify the state, associated products, and associated repositories.

   ```
   aws ecr-public describe-premium-repositories \
        --repository-names {{my-premium-app}} \
        --region us-east-1
   ```

## Restrictions after the draft state
<a name="public-premium-restrictions"></a>

To protect buyers' access, Amazon ECR Public restricts changes to premium repositories after they leave the `DRAFT` state.


**Premium repository restrictions by state**  

| Action | `DRAFT` | `AVAILABLE` or `HIDDEN` | 
| --- | --- | --- | 
| Add AWS Marketplace products | Allowed, up to five | Allowed, up to five. See [Changing associated products](public-premium-products.md#public-premium-products-change). | 
| Remove AWS Marketplace products | Allowed | Not allowed. | 
| Delete images | Allowed | Not allowed. You must deprecate the image first. See [Deprecating an image in a premium repository](public-image-delete.md#public-premium-deprecate). | 
| Delete the repository | Allowed | Allowed only if the repository contains no images. See [Deleting a public repository in Amazon ECR public](public-repository-delete.md). | 