Skip to content

feat: Support private ecr pull through cache #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.61 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.93 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.61 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.93 |

## Modules

Expand Down
4 changes: 2 additions & 2 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Note that this example may create resources which will incur monetary charges on
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.61 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.93 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.61 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.93 |

## Modules

Expand Down
5 changes: 5 additions & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ module "ecr_registry" {
upstream_registry_url = "registry-1.docker.io"
credential_arn = module.secrets_manager_dockerhub_credentials.secret_arn
}
priv = {
ecr_repository_prefix = local.name
upstream_registry_url = "${data.aws_caller_identity.current.account_id}.dkr.ecr.us-west-2.amazonaws.com"
upstream_repository_prefix = "myapp"
}
}

# Registry Scanning Configuration
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.61"
version = ">= 5.93"
}
}
}
4 changes: 2 additions & 2 deletions examples/repository-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ If you validate the example by using the pull-through cache, you will need to ma
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.61 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.93 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.61 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.93 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/repository-template/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.61"
version = ">= 5.93"
}
}
}
8 changes: 5 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,11 @@ resource "aws_ecr_registry_policy" "this" {
resource "aws_ecr_pull_through_cache_rule" "this" {
for_each = { for k, v in var.registry_pull_through_cache_rules : k => v if var.create }

ecr_repository_prefix = each.value.ecr_repository_prefix
upstream_registry_url = each.value.upstream_registry_url
credential_arn = try(each.value.credential_arn, null)
ecr_repository_prefix = each.value.ecr_repository_prefix
upstream_registry_url = each.value.upstream_registry_url
credential_arn = try(each.value.credential_arn, null)
custom_role_arn = try(each.value.custom_role_arn, null)
upstream_repository_prefix = try(each.value.upstream_repository_prefix, null)
}

################################################################################
Expand Down
4 changes: 2 additions & 2 deletions modules/repository-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.61 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.93 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.61 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.93 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion modules/repository-template/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.61"
version = ">= 5.93"
}
}
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.61"
version = ">= 5.93"
}
}
}
2 changes: 1 addition & 1 deletion wrappers/repository-template/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.61"
version = ">= 5.93"
}
}
}
2 changes: 1 addition & 1 deletion wrappers/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.61"
version = ">= 5.93"
}
}
}