Module library

ECR

Terraform module to create AWS ECR resources

Version
Submodules
repository-template

Inputs

30
attach_repository_policyoptionalbool

Determines whether a repository policy will be attached to the repository

Defaulttrue
createoptionalbool

Determines whether resources will be created (affects all resources)

Defaulttrue
create_lifecycle_policyoptionalbool

Determines whether a lifecycle policy will be created

Defaulttrue
create_registry_policyoptionalbool

Determines whether a registry policy will be created

Defaultfalse
create_registry_replication_configurationoptionalbool

Determines whether a registry replication configuration will be created

Defaultfalse
create_repositoryoptionalbool

Determines whether a repository will be created

Defaulttrue
create_repository_policyoptionalbool

Determines whether a repository policy will be created

Defaulttrue
manage_registry_scanning_configurationoptionalbool

Determines whether the registry scanning configuration will be managed

Defaultfalse
public_repository_catalog_dataoptionalobject({ about_text = optional(string) architectures = optional(list(string)) de…

Catalog data configuration for the repository

Defaultnull
regionoptionalstring

Region where this resource will be managed. Defaults to the Region set in the provider configuration.

Defaultnull
registry_policyoptionalstring

The policy document. This is a JSON formatted string

Defaultnull
registry_pull_through_cache_rulesoptionalmap(object({ ecr_repository_prefix = string upstream_registry_url = string crede…

List of pull through cache rules to create

Default{}
registry_replication_rulesoptionallist(object({ destinations = list(object({ region = string registry_id = string …

The replication rules for a replication configuration. A maximum of 10 are allowed

Defaultnull
registry_scan_rulesoptionallist(object({ scan_frequency = string filter = list(object({ filter = string fil…

One or multiple blocks specifying scanning rules to determine which repository filters are used and at what frequency scanning will occur

Defaultnull
registry_scan_typeoptionalstring

the scanning type to set for the registry. Can be either `ENHANCED` or `BASIC`

DefaultENHANCED
repository_encryption_typeoptionalstring

The encryption type for the repository. Must be one of: `KMS` or `AES256`. Defaults to `AES256`

Defaultnull
repository_force_deleteoptionalbool

If `true`, will delete the repository even if it contains images. Defaults to `false`

Defaultnull
repository_image_scan_on_pushoptionalbool

Indicates whether images are scanned after being pushed to the repository (`true`) or not scanned (`false`)

Defaulttrue
repository_image_tag_mutabilityoptionalstring

The tag mutability setting for the repository. Must be one of: `MUTABLE`, `MUTABLE_WITH_EXCLUSION`, `IMMUTABLE`, or `IMMUTABLE_WITH_EXCLUSION`. Defaults to `IMMUTABLE`

DefaultIMMUTABLE
repository_image_tag_mutability_exclusion_filteroptionallist(object({ filter = string filter_type = string }))

Configuration block that defines filters to specify which image tags can override the default tag mutability setting. Only applicable when image_tag_mutability is set to IMMUTABLE_WITH_EXCLUSION or MUTABLE_WITH_EXCLUSION.

Defaultnull
repository_kms_keyoptionalstring

The ARN of the KMS key to use when encryption_type is `KMS`. If not specified, uses the default AWS managed key for ECR

Defaultnull
repository_lambda_read_access_arnsoptionallist(string)

The ARNs of the Lambda service roles that have read access to the repository

Default[]
repository_lifecycle_policyoptionalstring

The policy document. This is a JSON formatted string. See more details about [Policy Parameters](http://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html#lifecycle_policy_parameters) in the official AWS docs

Default""
repository_nameoptionalstring

The name of the repository

Default""
repository_policyoptionalstring

The JSON policy to apply to the repository. If not specified, uses the default policy

Defaultnull
repository_policy_statementsoptionalmap(object({ sid = optional(string) actions = optional(list(string)) not_actions…

A map of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for custom permission usage

Defaultnull
repository_read_access_arnsoptionallist(string)

The ARNs of the IAM users/roles that have read access to the repository

Default[]
repository_read_write_access_arnsoptionallist(string)

The ARNs of the IAM users/roles that have read/write access to the repository

Default[]
repository_typeoptionalstring

The type of repository to create. Either `public` or `private`

Defaultprivate
tagsoptionalmap(string)

A map of tags to add to all resources

Default{}

All 30 are optional — the module deploys with none of them set.

Outputs

4
repository_arn

Full ARN of the repository

repository_name

Name of the repository

repository_registry_id

The registry ID where the repository was created

repository_url

The URL of the repository

What the agent wires into the next module. An edge on the architecture diagram is one of these consumed by something else.