Skip to content
v2.278.0

RepositoryProps Struct ​

Example ​

ts
const repository = new ecr.Repository(this, 'TestRepository', {
  repositoryName: 'test-agent-runtime',
});

const agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, 'v1.0.0');

new agentcore.Runtime(this, 'test-runtime', {
  runtimeName: 'test_runtime',
  agentRuntimeArtifact: agentRuntimeArtifact,
  platformVersion: agentcore.PlatformVersion.V2,
  minimumMemory: cdk.Size.gibibytes(4),
});
python
repository = ecr.Repository(self, "TestRepository",
    repository_name="test-agent-runtime"
)

agent_runtime_artifact = agentcore.AgentRuntimeArtifact.from_ecr_repository(repository, "v1.0.0")

agentcore.Runtime(self, "test-runtime",
    runtime_name="test_runtime",
    agent_runtime_artifact=agent_runtime_artifact,
    platform_version=agentcore.PlatformVersion.V2,
    minimum_memory=cdk.Size.gibibytes(4)
)
java
Repository repository = Repository.Builder.create(this, "TestRepository")
        .repositoryName("test-agent-runtime")
        .build();

AgentRuntimeArtifact agentRuntimeArtifact = AgentRuntimeArtifact.fromEcrRepository(repository, "v1.0.0");

Runtime.Builder.create(this, "test-runtime")
        .runtimeName("test_runtime")
        .agentRuntimeArtifact(agentRuntimeArtifact)
        .platformVersion(PlatformVersion.V2)
        .minimumMemory(Size.gibibytes(4))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var repository = new Repository(this, "TestRepository", new RepositoryProps {
    RepositoryName = "test-agent-runtime"
});

var agentRuntimeArtifact = AgentRuntimeArtifact.FromEcrRepository(repository, "v1.0.0");

new Runtime(this, "test-runtime", new RuntimeProps {
    RuntimeName = "test_runtime",
    AgentRuntimeArtifact = agentRuntimeArtifact,
    PlatformVersion = PlatformVersion.V2,
    MinimumMemory = Size.Gibibytes(4)
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
repository := ecr.NewRepository(this, jsii.String("TestRepository"), &RepositoryProps{
	RepositoryName: jsii.String("test-agent-runtime"),
})

agentRuntimeArtifact := agentcore.AgentRuntimeArtifact_FromEcrRepository(repository, jsii.String("v1.0.0"))

agentcore.NewRuntime(this, jsii.String("test-runtime"), &RuntimeProps{
	RuntimeName: jsii.String("test_runtime"),
	AgentRuntimeArtifact: agentRuntimeArtifact,
	PlatformVersion: agentcore.PlatformVersion_V2(),
	MinimumMemory: cdk.Size_Gibibytes(jsii.Number(4)),
})

Properties ​

autoDeleteImagesoptionalbooleanauto_delete_imagesoptionalboolautoDeleteImagesoptionalBooleanAutoDeleteImagesoptionalboolAutoDeleteImagesoptional*bool = false deprecated #
Use `emptyOnDelete` instead.

Requires the removalPolicy to be set to RemovalPolicy.DESTROY.

emptyOnDeleteoptionalbooleanempty_on_deleteoptionalboolemptyOnDeleteoptionalBooleanEmptyOnDeleteoptionalboolEmptyOnDeleteoptional*bool = 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.

encryptionoptionalRepositoryEncryptionencryptionoptionalRepositoryEncryptionencryptionoptionalRepositoryEncryptionEncryptionoptionalRepositoryEncryptionEncryptionoptionalRepositoryEncryption #
The kind of server-side encryption to apply to this repository.

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

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

encryptionKeyoptionalIKeyRefencryption_keyoptionalIKeyRefencryptionKeyoptionalIKeyRefEncryptionKeyoptionalIKeyRefEncryptionKeyoptionalIKeyRef #
External KMS key to use for repository encryption.

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

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

imageScanOnPushoptionalbooleanimage_scan_on_pushoptionalboolimageScanOnPushoptionalBooleanImageScanOnPushoptionalboolImageScanOnPushoptional*bool = false #
Enable the scan on push when creating the repository.
imageTagMutabilityoptionalTagMutabilityimage_tag_mutabilityoptionalTagMutabilityimageTagMutabilityoptionalTagMutabilityImageTagMutabilityoptionalTagMutabilityImageTagMutabilityoptionalTagMutability = 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.

imageTagMutabilityExclusionFiltersoptionalImageTagMutabilityExclusionFilter[]image_tag_mutability_exclusion_filtersoptionaltyping.List[ImageTagMutabilityExclusionFilter]imageTagMutabilityExclusionFiltersoptionalList<ImageTagMutabilityExclusionFilter>ImageTagMutabilityExclusionFiltersoptionalImageTagMutabilityExclusionFilter[]ImageTagMutabilityExclusionFiltersoptional*[]ImageTagMutabilityExclusionFilter #
The image tag mutability exclusion filters for the repository.

Default: undefined - AWS ECR default is no exclusion filters

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

lifecycleRegistryIdoptionalstringlifecycle_registry_idoptionalstrlifecycleRegistryIdoptionalStringLifecycleRegistryIdoptionalstringLifecycleRegistryIdoptional*string #
The AWS account ID associated with the registry that contains the repository.

Default: The default registry is assumed.

lifecycleRulesoptionalLifecycleRule[]lifecycle_rulesoptionaltyping.List[LifecycleRule]lifecycleRulesoptionalList<LifecycleRule>LifecycleRulesoptionalLifecycleRule[]LifecycleRulesoptional*[]LifecycleRule #
Life cycle rules to apply to this registry.

Default: No life cycle rules

removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy = RemovalPolicy.Retain #
Determine what happens to the repository when the resource/stack is deleted.
repositoryNameoptionalstringrepository_nameoptionalstrrepositoryNameoptionalStringRepositoryNameoptionalstringRepositoryNameoptional*string #
Name for this repository.

Default: Automatically generated name.

notes

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.