Skip to content
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

ECR Repository link attribute #5518

Closed
ajcrites opened this issue Mar 8, 2016 · 6 comments
Closed

ECR Repository link attribute #5518

ajcrites opened this issue Mar 8, 2016 · 6 comments

Comments

@ajcrites
Copy link

ajcrites commented Mar 8, 2016

I am creating an ECR and then creating a task definition using an image in that ECR. I currently have to construct the repo url but it would be simpler to make this an attribute of the ECR.

resource "aws_ecr_repository" "ingest" {
  name = "ingest-repo"
  provisioner "local-exec" {
    command = "deploy-container.sh"
  }
}
resource "aws_ecs_task_definition" "ingest" {
    family = "ingest-task"
    container_definitions = <<EOF
[{
  "name": "ingest",
  "image": "https://${aws_ecr_repository.ingest.registry_id}.dkr.ecr.${var.aws_region}.amazonaws.com/ingest:latest"
}]
EOF
}

The image above could be replaced with ${aws_ecr_repository.ingest.link}/ingest:latest

@stack72
Copy link
Contributor

stack72 commented Mar 8, 2016

@ajcrites, I am trying to locate the docs that point to how that URL is formed - have you been able to find that?

@stack72
Copy link
Contributor

stack72 commented Mar 8, 2016

I guess this is what we need:

http://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-push-ecr-image.html

It specifically says the following:

The registry format is aws_account_id.dkr.ecr.us-east-1.amazonaws.com. 

What do you suggest the property name to be exposed as?

@ajcrites
Copy link
Author

ajcrites commented Mar 8, 2016

id is used as a property name for other URLs/ARNs such as those generated by SQS/SNS. Either this or registry_url would make sense to me.

I would expect it to look something like:

<AWS_ACCOUNT_ID>.dkr.ecr.<AWS_REGION>.amazonaws.com/<ECR_NAME>

I think the region can only be us-east-1 for now, but should still be something that's already known ahead of time.

EDIT: removing the https:// part; I actually don't think it belongs there and Docker doesn't like it either.

@stack72
Copy link
Contributor

stack72 commented Mar 8, 2016

@ajcrites PR open ad #5524 for this :)

@stack72
Copy link
Contributor

stack72 commented Mar 9, 2016

@ajcrites this has been added in #5524

@stack72 stack72 closed this as completed Mar 9, 2016
@ghost
Copy link

ghost commented Apr 27, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants