Skip to content

Commit b162889

Browse files
authored
Configure public.ecr.aws password in provider
This PR prevents `helm_release.karpenter` from being upgraded each time of `terraform apply` even when the `main.tf` is unchanged
1 parent 00d4cc1 commit b162889

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/karpenter/main.tf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ provider "helm" {
1919
args = ["eks", "get-token", "--cluster-name", module.eks.cluster_name]
2020
}
2121
}
22+
registry {
23+
url = "oci://public.ecr.aws/karpenter"
24+
username = data.aws_ecrpublic_authorization_token.token.user_name
25+
password = data.aws_ecrpublic_authorization_token.token.password
26+
}
2227
}
2328

2429
provider "kubectl" {
@@ -154,8 +159,6 @@ resource "helm_release" "karpenter" {
154159
namespace = "kube-system"
155160
name = "karpenter"
156161
repository = "oci://public.ecr.aws/karpenter"
157-
repository_username = data.aws_ecrpublic_authorization_token.token.user_name
158-
repository_password = data.aws_ecrpublic_authorization_token.token.password
159162
chart = "karpenter"
160163
version = "1.0.6"
161164
wait = false

0 commit comments

Comments
 (0)