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

feat: Add ecr login #36

Merged
merged 25 commits into from
Dec 19, 2022
Merged
Changes from 20 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
13 changes: 12 additions & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@ data "aws_eks_cluster_auth" "this" {
name = module.eks_blueprints.eks_cluster_id
}

data "aws_ecr_authorization_token" "token" {}
# Equivalent of aws ecr get-login
data "aws_ecr_authorization_token" "ecr_token" {}
# Multiple docker push commands can be run against a single token
resource "null_resource" "renew_ecr_token" {
victorgu-github marked this conversation as resolved.
Show resolved Hide resolved
triggers = {
token_expired = data.aws_ecr_authorization_token.ecr_token.expires_at
}

provisioner "local-exec" {
command = "echo ${data.aws_ecr_authorization_token.ecr_token.password} | docker login --username ${data.aws_ecr_authorization_token.ecr_token.user_name} --password-stdin ${data.aws_ecr_authorization_token.ecr_token.proxy_endpoint}"
}
}

data "aws_availability_zones" "available" {}
data "aws_caller_identity" "current" {}
Expand Down