Skip to content

Commit

Permalink
✨ feat(aws-provider-6.0): update helm chart and provider for upstream…
Browse files Browse the repository at this point in the history
… changes
  • Loading branch information
morga471 committed Oct 21, 2025
1 parent 6a3e25f commit 0c9eb12
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 32 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ The module deploys Karpenter needed AWS resources, namely in IAM. It copies the

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.100.0 |
| <a name="provider_aws.eecr"></a> [aws.eecr](#provider\_aws.eecr) | 5.100.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 6.15.0 |
| <a name="provider_helm"></a> [helm](#provider\_helm) | 3.0.2 |
| <a name="provider_null"></a> [null](#provider\_null) | 3.2.4 |

Expand All @@ -36,7 +35,7 @@ The module deploys Karpenter needed AWS resources, namely in IAM. It copies the
| Name | Source | Version |
|------|--------|---------|
| <a name="module_images"></a> [images](#module\_images) | git::https://github.e.it.census.gov/terraform-modules/aws-ecr-copy-images.git | tf-upgrade |
| <a name="module_karpenter_resources"></a> [karpenter\_resources](#module\_karpenter\_resources) | git::https://github.e.it.census.gov/SCT-Engineering/terraform-aws-eks.git//modules/karpenter | v20.37.2 |
| <a name="module_karpenter_resources"></a> [karpenter\_resources](#module\_karpenter\_resources) | git::https://github.e.it.census.gov/SCT-Engineering/terraform-aws-eks.git//modules/karpenter | v21.4.0 |

## Resources

Expand All @@ -47,8 +46,6 @@ The module deploys Karpenter needed AWS resources, namely in IAM. It copies the
| [null_resource.git_version](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
| [aws_arn.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/arn) | data source |
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
| [aws_ecr_authorization_token.ecr_token](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ecr_authorization_token) | data source |
| [aws_ecr_authorization_token.token](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ecr_authorization_token) | data source |
| [aws_ecr_image.karpenter_image](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ecr_image) | data source |

## Inputs
Expand Down
43 changes: 22 additions & 21 deletions copy_images.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
locals {
karpenter_key = format("%v#%v", "karpenter/controller", var.karpenter_tag)
ent_ecr_source = format("%v.%v.%v.%v", var.eecr_info.account_id, "dkr.ecr", var.region, "amazonaws.com/ent-images")
karpenter_key = format("%v#%v", "karpenter/controller", var.karpenter_tag)
# ent_ecr_source = format("%v.%v.%v.%v", var.eecr_info.account_id, "dkr.ecr", var.region, "amazonaws.com/ent-images")

image_config = [
{
enabled = true
dest_path = null
name = "karpenter/controller"
source_image = "karpenter/controller"
source_registry = format("%v/%v", local.ent_ecr_source, "public-ecr")
source_tag = var.karpenter_tag
tag = var.karpenter_tag
source_registry = "public.ecr.aws"
# source_registry = format("%v/%v", local.ent_ecr_source, "public-ecr")
source_tag = var.karpenter_tag
tag = var.karpenter_tag
},
]
}
Expand All @@ -28,27 +29,27 @@ module "images" {
force_delete = true
lifecycle_policy_keep_count = 5

source_username = data.aws_ecr_authorization_token.ecr_token.user_name
source_password = data.aws_ecr_authorization_token.ecr_token.password
# source_username = data.aws_ecr_authorization_token.ecr_token.user_name
# source_password = data.aws_ecr_authorization_token.ecr_token.password

destination_username = data.aws_ecr_authorization_token.token.user_name
destination_password = data.aws_ecr_authorization_token.token.password
# destination_username = data.aws_ecr_authorization_token.token.user_name
# destination_password = data.aws_ecr_authorization_token.token.password
}

data "aws_ecr_authorization_token" "token" {
registry_id = var.account_id
}
# data "aws_ecr_authorization_token" "token" {
# registry_id = var.account_id
# }

data "aws_ecr_authorization_token" "ecr_token" {
provider = aws.eecr
registry_id = var.eecr_info.account_id
}
# data "aws_ecr_authorization_token" "ecr_token" {
# provider = aws.eecr
# registry_id = var.eecr_info.account_id
# }

provider "aws" {
alias = "eecr"
profile = var.eecr_info.profile
region = var.eecr_info.region
}
# provider "aws" {
# alias = "eecr"
# profile = var.eecr_info.profile
# region = var.eecr_info.region
# }

output "image_config" {
description = "Map of image references to their full source paths"
Expand Down
8 changes: 2 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,14 @@ locals {
# Replicating from here: https://github.e.it.census.gov/SCT-Engineering/terraform-aws-eks/tree/master/modules/karpenter
# Karpenter IRSA roles and policies
module "karpenter_resources" {
source = "git::https://github.e.it.census.gov/SCT-Engineering/terraform-aws-eks.git//modules/karpenter?ref=v20.37.2"
source = "git::https://github.e.it.census.gov/SCT-Engineering/terraform-aws-eks.git//modules/karpenter?ref=v21.4.0"

cluster_name = var.cluster_name
create_access_entry = true
create_instance_profile = true
create_node_iam_role = true
create_pod_identity_association = true
enable_irsa = true
irsa_namespace_service_accounts = ["${var.namespace}:karpenter"]
irsa_oidc_provider_arn = var.oidc_provider_arn
enable_pod_identity = true
enable_v1_permissions = true
namespace = var.namespace
node_iam_role_name = local.node_iam_role_name
queue_name = local.queue_name
rule_name_prefix = local.rule_name_prefix
Expand Down
2 changes: 2 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# tflint-ignore: terraform_unused_declarations
variable "account_id" {
description = "aws account number"
type = string
Expand All @@ -14,6 +15,7 @@ variable "cluster_name" {
type = string
}

# tflint-ignore: terraform_unused_declarations
variable "eecr_info" {
description = "Enterprise ECR source information"
type = object({
Expand Down

0 comments on commit 0c9eb12

Please sign in to comment.