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

Attribute to retrieve ECR login credentials #11332

Closed
Phat3 opened this issue Dec 17, 2019 · 3 comments · Fixed by #12395
Closed

Attribute to retrieve ECR login credentials #11332

Phat3 opened this issue Dec 17, 2019 · 3 comments · Fixed by #12395
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ecr Issues and PRs that pertain to the ecr service.
Milestone

Comments

@Phat3
Copy link

Phat3 commented Dec 17, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

During the creation of a repository on an Amazon Elastic Container Registry (ECR) it would be very helpful to have a way to retrieve the login credential for the newly created registry. I've noticed two related pull requests (#3145, #2824) that propose a new data source to retrieve this information, but they appeared to be closed without being merged to master.

What is the reason why those pull requests were closed? Is there a better way to retrieve the login credentials?

My use case is the following:

  1. Create a new repository using aws_ecr_repository
  2. Get the login credentials for the registry that contains the repository created above
  3. Pass the credential to external scripts that push some image to the repository

For now, as a workaround, I pass the registry id to my script and then I get the credentials using a library to interface with the API for AWS (boto3 in my case), I log in to the registry and finally push the image. The goal is to remove the needs to use AWS API in my script.

Thanks in advance.

New or Affected Resource(s)

  • aws_ecr_repository

Potential Terraform Configuration

resource "aws_ecr_repository" "dummy_repo" {
  name    = "dummy_repo"
  image_tag_mutability    = "MUTABLE"
}

output "ecr_login_credentials" {
  value    = "${aws_ecr_repository.dummy_repo.registry_credentials}"
  description    = "Returns the login credentials for the registry that contains the specified repository" 
}

References

@Phat3 Phat3 added the enhancement Requests to existing resources that expand the functionality or scope. label Dec 17, 2019
@ghost ghost added the service/ecr Issues and PRs that pertain to the ecr service. label Dec 17, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 17, 2019
@anGie44 anGie44 removed the needs-triage Waiting for first response or review from a maintainer. label May 28, 2020
@anGie44 anGie44 added this to the v2.67.0 milestone Jun 18, 2020
@anGie44
Copy link
Contributor

anGie44 commented Jun 18, 2020

This feature, coined aws_ecr_authorization_token, has been merged and will release with v2.67.0 of the Terraform AWS Provider, expected later in today's release.

@ghost
Copy link

ghost commented Jun 19, 2020

This has been released in version 2.67.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Jul 18, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Jul 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ecr Issues and PRs that pertain to the ecr service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants