Terraform module to provision a custom domain for AWS ECR.
module "aws_ecr_custom_domain" {
source = "pinge/ecr-custom-domain/aws"
domain_name = "ecr.example.com"
zone_id = aws_route53_zone.some_zone.id
tags = {
Terraform = "true"
Environment = "dev"
}
}AWS ECR does not support custom domain names. This module provisions a custom domain for your container registry so you don't have to deal with a 987654321.dkr.ecr.eu-east-1.amazonaws.com registry path.
When running docker pull the Docker Registry returns 307 Temporary Redirects to the actual image content.
This module creates a "registry facade" on the custom domain by provisioning an API Gateway that returns a 307 Temporary Redirect when executing docker pull or docker push.
For docker pull/push to work, you will need to authenticate with docker login ecr.example.com
Report issues/questions/feature requests on in the issues section.
| Name | Version |
|---|---|
| terraform | >= 1.0 |
| archive | >= 2.0 |
| aws | >= 5.0 |
| Name | Version |
|---|---|
| archive | >= 2.0 |
| aws | >= 5.0 |
No modules.
| Name | Type |
|---|---|
| aws_acm_certificate.this | resource |
| aws_acm_certificate_validation.this | resource |
| aws_apigatewayv2_api.this | resource |
| aws_apigatewayv2_api_mapping.this | resource |
| aws_apigatewayv2_domain_name.this | resource |
| aws_apigatewayv2_integration.this | resource |
| aws_apigatewayv2_route.this | resource |
| aws_apigatewayv2_stage.this | resource |
| aws_iam_role.this | resource |
| aws_lambda_function.this | resource |
| aws_lambda_permission.this | resource |
| aws_route53_record.certificate_validation | resource |
| aws_route53_record.this | resource |
| archive_file.this | data source |
| aws_caller_identity.current | data source |
| aws_region.current | data source |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| domain_name | The custom domain for AWS ECR | string |
n/a | yes |
| lambda_name | The name of the Lambda function | string |
null |
no |
| region | The default AWS region | string |
null |
no |
| tags | A map of tags to add to all resources | map(string) |
{} |
no |
| zone_id | The AWS Route 53 zone id of the ECR custom domain | string |
n/a | yes |
| Name | Description |
|---|---|
| api_gateway_arn | n/a |
| aws_lambda_function_arn | n/a |
| certificate_arn | n/a |
| records | n/a |
This Terraform module is maintained by Nuno Pinge.
Apache 2 Licensed. See LICENSE for full details.