Docker Hub to Amazon ECR
Terraform module that sends a docker image from Docker Hub to Amazon ECR using local-exec and null-resource.
You must have docker and bash installed because this module only executes it on your behalf.
Example
resource "aws_ecr_repository" "this" {
name = "my-nginx-copy"
image_tag_mutability = "MUTABLE"
force_delete = true
}
module "this" {
source = "../../"
dockerhub_repository_name = "nginx"
dockerhub_repository_tag = "latest"
ecr_repository_url = aws_ecr_repository.this.repository_url
}
Requirements
Name | Version |
---|---|
terraform | >= 1.0 |
aws | >= 3 |
null | >= 3 |
Providers
Name | Version |
---|---|
aws | >= 3 |
null | >= 3 |
Modules
No modules.
Resources
Name | Type |
---|---|
null_resource.this | resource |
aws_region.current | data source |
Inputs
Name | Description | Type | Default | Required |
---|---|---|---|---|
dockerhub_repository_name | Docker Hub source repository name. | string |
n/a | yes |
dockerhub_repository_tag | Docker Hub source/destination repository tag. | string |
n/a | yes |
ecr_repository_url | ECR destination repository name. | string |
n/a | yes |
Outputs
No outputs.
Docs made with terraform-docs!