# RepositoryProps

Extends: RepositoryProps
Used as props by: Repository

- Source: [`aws-ecr/lib/repository.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-ecr/lib/repository.ts#L536)
- Type last changed: v2.224.0 · 13 Nov 2025

## Example

```ts
const repository = new ecr.Repository(this, "TestRepository", {
  repositoryName: "test-agent-runtime",
});
const agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, "v1.0.0");

// Explicitly using public network (this is the default)
const runtime = new agentcore.Runtime(this, "MyAgentRuntime", {
  runtimeName: "myAgent",
  agentRuntimeArtifact: agentRuntimeArtifact,
  networkConfiguration: agentcore.RuntimeNetworkConfiguration.usingPublicNetwork(),
});
```

## Properties

- `autoDeleteImages`: boolean = false — Use `emptyOnDelete` instead.

  Requires the `removalPolicy` to be set to `RemovalPolicy.DESTROY`.

- `emptyOnDelete`: boolean = false — If true, deleting the repository force deletes the contents of the repository.

  If false, the repository must be empty before attempting to delete it.

- `encryption`: [RepositoryEncryption](/cdk/api/v2/docs/aws-cdk-lib.aws_ecr.RepositoryEncryption.html) = `KMS` if `encryptionKey` is specified, or `AES256` otherwise. — The kind of server-side encryption to apply to this repository.

  If you choose KMS, you can specify a KMS key via `encryptionKey`. If
  encryptionKey is not specified, an AWS managed KMS key is used.

  **Default:** `KMS` if `encryptionKey` is specified, or `AES256` otherwise.

- `encryptionKey`: [IKeyRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_kms.IKeyRef.html) = If encryption is set to `KMS` and this property is undefined, an AWS managed KMS key is used. — External KMS key to use for repository encryption.

  The 'encryption' property must be either not specified or set to "KMS".
  An error will be emitted if encryption is set to "AES256".

  **Default:** If encryption is set to `KMS` and this property is undefined, an AWS managed KMS key is used.

- `imageScanOnPush`: boolean = false — Enable the scan on push when creating the repository.

- `imageTagMutability`: [TagMutability](/cdk/api/v2/docs/aws-cdk-lib.aws_ecr.TagMutability.html) = TagMutability.MUTABLE — The tag mutability setting for the repository.

  If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.

- `imageTagMutabilityExclusionFilters`: [ImageTagMutabilityExclusionFilter](/cdk/api/v2/docs/aws-cdk-lib.aws_ecr.ImageTagMutabilityExclusionFilter.html)[] = undefined - AWS ECR default is no exclusion filters — The image tag mutability exclusion filters for the repository.

  These filters specify which image tags can override the repository's default image tag mutability setting.

  **Default:** undefined - AWS ECR default is no exclusion filters

- `lifecycleRegistryId`: string = The default registry is assumed. — The AWS account ID associated with the registry that contains the repository.

- `lifecycleRules`: [LifecycleRule](/cdk/api/v2/docs/aws-cdk-lib.aws_ecr.LifecycleRule.html)[] = No life cycle rules — Life cycle rules to apply to this registry.

- `removalPolicy`: [RemovalPolicy](/cdk/api/v2/docs/aws-cdk-lib.RemovalPolicy.html) = RemovalPolicy.Retain — Determine what happens to the repository when the resource/stack is deleted.

- `repositoryName`: string = Automatically generated name. — Name for this repository.

  The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes.

  > If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
