sociableporcupine
sociableporcupine
CCoder.com
Created by JustATempest on 9/19/2024 in #help
aws_ecr_repository auth error on EC2 envbuilder
OK, I tried the following Terraform and works for me. I think you will probably have an easier time if you just use the aws provider to get the authorization token and then do the JSON/base64 encoding in Terraform. Relevant bits:
data "aws_ecr_authorization_token" "envbuilder_cache" {
...
dockerconfig_json = jsonencode({
"auths" : {
"${var.cache_repo}" : {
"auth" : data.aws_ecr_authorization_token.envbuilder_cache.authorization_token
}
}
})
...
"ENVBUILDER_DOCKER_CONFIG_BASE64" : base64encode(local.dockerconfig_json),

data "aws_ecr_authorization_token" "envbuilder_cache" {
...
dockerconfig_json = jsonencode({
"auths" : {
"${var.cache_repo}" : {
"auth" : data.aws_ecr_authorization_token.envbuilder_cache.authorization_token
}
}
})
...
"ENVBUILDER_DOCKER_CONFIG_BASE64" : base64encode(local.dockerconfig_json),

6 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
aws_ecr_repository auth error on EC2 envbuilder
I don’t see anything immediately jumping out at me there, I’ll try with my own setup and try to repro.
6 replies