ECR Repository
ECR repo with lifecycle rules, scan-on-push, immutable tags, and cross-account/replication policies.
Compare Container Registry across clouds →
Part of: AWS Container Platform (EKS)
Verification
Live-testedReally deployed to a cloud sandbox, verified against its outputs and assertions, then destroyed - with the teardown confirmed.
Conformance
- Static validation (fmt · validate · tflint)
- Security scan clean (Checkov)
- Plan test superseded by live test
Provenance
- SHA-256 checksum
- Cosign signature
Functional
- Live-tested - applied, verified, destroyed
Last verified 2026-06-11 · how we verify
Verify this download
cosign · sha-256Don't take our word for it. Every release is signed with cosign - check the bytes against our pinned public key before you trust them.
# 1. Our pinned public key - fetch once, trust out-of-band
curl -O https://www.iac-bazaar.com/cosign.pub
# 2. This module's Sigstore bundle
curl -o aws-ecr-1.0.0.sigstore.json \
https://www.iac-bazaar.com/api/artifacts/aws-ecr/signature
# 3. Verify the tarball you downloaded
cosign verify-blob \
--key cosign.pub \
--bundle aws-ecr-1.0.0.sigstore.json \
aws-ecr-1.0.0.tar.gz
# → Verified OK
# 4. (optional) confirm the checksum too
echo "3a4588f15fb261ae0db75a1d69fc5190302c58f63b004546ca2fb698b630b950 aws-ecr-1.0.0.tar.gz" | sha256sum -cUse it from the registry
terraform · opentofumodule "ecr" {
source = "www.iac-bazaar.com/iac-bazaar/aws-ecr/aws"
version = "1.0.0"
}Needs a registry token from /account/tokens. The module itself is free; the account is what identifies you. Full setup: registry docs.
Cite it in your README
badge · attributionPaste this beside the module in the repository that uses it. The badge is rendered from this artifact's verification record, so it reads live-tested because the record says so, and the link lands on this page.
[](https://www.iac-bazaar.com/catalog/aws-ecr?utm_source=syndication&utm_medium=readme&utm_campaign=artifact)
Terraform module 1.0.0, live-tested on IaC Bazaar: [ECR Repository](https://www.iac-bazaar.com/catalog/aws-ecr?utm_source=syndication&utm_medium=readme&utm_campaign=artifact)
```hcl
module "ecr" {
source = "www.iac-bazaar.com/iac-bazaar/aws-ecr/aws"
version = "1.0.0"
}
```Preview:
Inputs & outputs
Create a free account to read this module's contract
The declared contract - every input name, type, default and description, plus every output - is shown to signed-in accounts, not to anonymous visitors.
A free account sees the contract of every module in the catalogue. There is no subscription and nothing to buy - the modules are free to download, and they run under Vizier.
Documentation
aws-ecr
ECR repository with lifecycle rules, scan-on-push, immutable tags, and
cross-account/replication policies — the lifecycle-policy JSON and
least-privilege repository policy are generated for you from typed inputs.
Works with Terraform and OpenTofu (>= 1.6), AWS provider >= 6.0, < 7.0.
Secure defaults:
- Immutable tags — pushed tags can never be silently overwritten
- Scan on push enabled
- Images always encrypted at rest (AES256, or your CMK via
kms_key_arn) force_delete = false— Terraform refuses to destroy a repository that still holds images- Untagged images (superseded layers, failed pushes) expire after 14 days
Lifecycle presets compose into one correctly-prioritized policy:
tagged_image_retention— keep-last-N rules per tag-prefix setuntagged_expiry_days— age out untagged imagesmax_image_count— hard cap on total images (ECR requires thistagStatus=anyrule to carry the highest priority — handled for you)
Cross-account access is least-privilege: pull_principal_arns get exactly the
three pull actions, push_principal_arns add the four push actions, and
allow_lambda_pull grants the Lambda service principal scoped to functions in
your own account. Pass repository_policy / lifecycle_policy JSON to take
full manual control.
Requirements
- Terraform or OpenTofu
>= 1.6 hashicorp/aws>= 6.0, < 7.0
License
Commercial — IaC Bazaar EULA. © IaC Bazaar. Original work (not derived from a third-party module).
Usage code & full reference need an account
The complete copy-paste usage, the full input/output reference, and operational notes are free with an account - shown here and bundled in the download. Sign in and this section fills in.
- Usage
- Inputs
- Outputs
Related modules
ibm-container-registry
An IBM Cloud Container Registry namespace in the provider's region, with a retention policy that keeps the last ten images per repository and drops untagged ones, because without one every CI run adds an image until the account's storage quota refuses the next push. Quotas and the plan are account-wide and not managed here.
do-container-registry
Docker credentials for the registry never expire unless told to, so the login a CI job wrote to disk two years ago still pushes today; there is one registry per account; and the tier is a storage ceiling that turns into a failed push far from the cause. The registry, read-only credentials that live a day and read-write ones that live an hour, both re-issued on the next apply after expiry.
scaleway-container-registry
is_public makes every image in the namespace pullable by anyone, and the key CI pushes with is usually a person's API key with every permission that person has and no expiry. Private unless public is accepted by name, and on request an IAM application whose only permission is registry access in one project, with an API key that expires on the date you set.
ovh-container-registry
A registry's endpoint is public and every address may try a login until an IP restriction exists; the registry user is the credential and its password lands in state; and the plan is the storage ceiling. Allowed ranges expected with none accepted by name, one user created for the pipeline with its password as a sensitive output, and the plan looked up by name.
vultr-container-registry
A Vultr container registry that is private (public, which lets anyone pull every image, is accepted by name), on the plan you chose (start_up is free and small; the paid plans bill monthly from creation), in the region your clusters are in. The root user Vultr creates is not output; a robot user per cluster is the credential to hand out.
alicloud-container-registry
Namespaces, repositories, VPC access and an internet allowlist on an Alibaba Cloud Container Registry Enterprise Edition instance. Repositories are private and their tags immutable unless set otherwise, auto-create is off, and the internet endpoint is only switched on - by the resource existing - when you give it CIDRs. Image cleanup is deliberately not managed.