ECR · Data

ECRRepository

Manage container registries, encryption, scanning, and tags.

Generic driverUniform lifecycle
Scope
Regional
Spec fields
7
Outputs
4
Lookup
Supported

Resource definition

What this resource looks like

This is the CUE shape a Praxis template uses to declare a ECRRepository. The resource key is local to the template; metadata.name supplies its stable Praxis identity.

CUE example
resources: images: {
  apiVersion: "praxis.io/alpha"
  kind: "ECRRepository"
  metadata: {name: "payments", labels: {}}
  spec: {
    region: "us-west-2"
    imageTagMutability: "IMMUTABLE"
    imageScanningConfiguration: scanOnPush: true
    tags: environment: "prod"
  }
}
Complete examples in the repository

Desired state

Configuration

The spec block accepts 7 fields. 1 is required by the schema; fields with defaults can be omitted.

regionRequired

Region.

string
String
imageTagMutabilityOptional

Image Tag Mutability.

"MUTABLE" | "IMMUTABLE" | *"MUTABLE"
EnumDefault "MUTABLE"
imageScanningConfigurationOptional

Image Scanning Configuration.

scanOnPush: bool | *false
ObjectDefault false
encryptionConfigurationOptional

Encryption Configuration.

{ encryptionType: "AES256" | "KMS" | *"AES256" kmsKey?: string }
Object
repositoryPolicyOptional

Repository Policy.

string
String
forceDeleteOptional

Force Delete.

bool | *false
BooleanDefault false
tagsOptional

Tags.

[string]: string
Map

Observed values

Outputs

Praxis records these values after observation. A dependent resource can read one with ${resources.<name>.outputs.<field>}.

repositoryArnString
repositoryNameString
repositoryUriString
registryIdString

Read without ownership

Data-source lookup

A data block reads an existing ECRRepository and exposes its outputs without storing lifecycle state. The generic filter surface accepts id, name, and tag; supported combinations depend on the AWS identity used by this resource.

CUE data source
data: existing: {
  kind: "ECRRepository"
  region: "us-west-2"
  filter: {
    name: "replace-with-provider-name"
  }
}
Documented selectorsidnameid/name + tag

Understand data sources and filters →

Adopt existing infrastructure

Import

Import persists Praxis state for an existing AWS resource. For this kind, supply: Repository name and region. The example starts in observed mode so Praxis reports drift without correcting it.

CLI
praxis import ECRRepository \
  --id <provider-identifier> \
  --region us-west-2 \
  --account production \
  --observe

Choose managed or observed ownership →

Canonical contract

Complete CUE schema

The field guide above is derived from this definition. The schema remains the source of truth for accepted values, defaults, validation constraints, and outputs in the current alpha revision.

Show the complete schema
schemas/aws/ecr/repository.cue
package ecr

#ECRRepository: {
	apiVersion: "praxis.io/alpha"
	kind:       "ECRRepository"

	metadata: {
		name: string & =~"^[a-z0-9][a-z0-9/_.-]{1,255}$"
		labels: [string]: string
	}

	spec: {
		region: string

		imageTagMutability?: "MUTABLE" | "IMMUTABLE" | *"MUTABLE"

		imageScanningConfiguration?: scanOnPush: bool | *false

		encryptionConfiguration?: {
			encryptionType: "AES256" | "KMS" | *"AES256"
			kmsKey?:        string
		}

		repositoryPolicy?: string
		forceDelete?:      bool | *false
		tags?: [string]: string
	}

	outputs?: {
		repositoryArn:  string
		repositoryName: string
		repositoryUri:  string
		registryId:     string
	}
}

View this schema on GitHub →