I am trying to launch EKS with Karpenter through Terraform using this template: https://github.com/aws-ia/terraform-aws-eks-blueprints/tree/main/patterns/karpenter
Since the public ECR repo needs to be accessed on us-east-1 (aws ecr-public is region specific · Issue #5917 · aws/aws-cli · GitHub and amazon web services - Could not connect to the endpoint URL: "https://api.ecr-public.xxxxxxxxx.amazonaws.com/" - Stack Overflow), I need to add an additional provider into my main.tf folder specifiying us-east-1 and calling that when trying to pull the image.
provider "aws" {
region = local.region
}
provider "aws" {
region = "us-east-1"
alias = "virginia"
}
Without this other “virginia” alias, GitLab runs the CI/CD pipeline fine using my IAM access key credentials in a different region. However it doesnt get past the build stage here when I have this extra provider since I do not have us-east-1 access and secret keys. Moving regions is unfortunately not an option.
The specific error is a No Valid Credentials Found error similar to one when access keys aren’t set up correctly.