From 5d45b07b300721e62b6da4fbe815db4dd7bef8ba Mon Sep 17 00:00:00 2001 From: Edgar Costa Date: Tue, 6 Aug 2024 08:30:55 -0300 Subject: [PATCH] chore: Update AWS provider to 'ecr' for ECR authentication (#1992) --- patterns/bottlerocket/addons.tf | 2 +- patterns/bottlerocket/main.tf | 4 +++- patterns/karpenter-mng/main.tf | 7 ++++--- patterns/karpenter/main.tf | 7 ++++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/patterns/bottlerocket/addons.tf b/patterns/bottlerocket/addons.tf index 39450fc98f..f7af372b38 100644 --- a/patterns/bottlerocket/addons.tf +++ b/patterns/bottlerocket/addons.tf @@ -2,7 +2,7 @@ # EKS Blueprints Addons ################################################################################ data "aws_ecrpublic_authorization_token" "token" { - provider = aws.virginia + provider = aws.ecr } module "eks_blueprints_addons" { diff --git a/patterns/bottlerocket/main.tf b/patterns/bottlerocket/main.tf index 49bfc04633..f1ba263e21 100644 --- a/patterns/bottlerocket/main.tf +++ b/patterns/bottlerocket/main.tf @@ -18,9 +18,11 @@ provider "aws" { region = local.region } +# This provider is required for ECR to autheticate with public repos. Please note ECR authetication requires us-east-1 as region hence its hardcoded below. +# If your region is same as us-east-1 then you can just use one aws provider provider "aws" { + alias = "ecr" region = "us-east-1" - alias = "virginia" } provider "kubernetes" { diff --git a/patterns/karpenter-mng/main.tf b/patterns/karpenter-mng/main.tf index dd0fa19ea3..793addb446 100644 --- a/patterns/karpenter-mng/main.tf +++ b/patterns/karpenter-mng/main.tf @@ -24,10 +24,11 @@ provider "aws" { region = local.region } -# Required for public ECR where Karpenter artifacts are hosted +# This provider is required for ECR to autheticate with public repos. Please note ECR authetication requires us-east-1 as region hence its hardcoded below. +# If your region is same as us-east-1 then you can just use one aws provider provider "aws" { + alias = "ecr" region = "us-east-1" - alias = "virginia" } provider "helm" { @@ -49,7 +50,7 @@ provider "helm" { ################################################################################ data "aws_ecrpublic_authorization_token" "token" { - provider = aws.virginia + provider = aws.ecr } data "aws_availability_zones" "available" { diff --git a/patterns/karpenter/main.tf b/patterns/karpenter/main.tf index bd2f0177b5..e064902196 100644 --- a/patterns/karpenter/main.tf +++ b/patterns/karpenter/main.tf @@ -2,10 +2,11 @@ provider "aws" { region = local.region } -# Required for public ECR where Karpenter artifacts are hosted +# This provider is required for ECR to autheticate with public repos. Please note ECR authetication requires us-east-1 as region hence its hardcoded below. +# If your region is same as us-east-1 then you can just use one aws provider provider "aws" { + alias = "ecr" region = "us-east-1" - alias = "virginia" } provider "kubernetes" { @@ -35,7 +36,7 @@ provider "helm" { } data "aws_ecrpublic_authorization_token" "token" { - provider = aws.virginia + provider = aws.ecr } data "aws_availability_zones" "available" {}