Skip to content

Karpenter module not compatible with AWS China #3650

@fitillo

Description

@fitillo

Description

Policy created for karpenter controller doesn't work for AWS China. The problem is inside controller's policy: https://github.com/terraform-aws-modules/terraform-aws-eks/blob/v21.15.1/modules/karpenter/policy.tf#L237

Code contemplates adding ec2.amazonaws.com.cn when executing in China. The problem is that aws_service_principal is not working as expected. There's an open issue for it here: hashicorp/terraform-provider-aws#46209 that I'm able to reproduce.

I propose reverting to previous code in v20. I've already tested it in my local setup and it works.

  1. Add local dns_suffix = data.aws_partition.current[0].dns_suffix in main.tf
  2. Modify line 237 in policy.tf to: values = distinct(["ec2.${local.dns_suffix}", "ec2.amazonaws.com"])

I'd be happy to add the PR for this one.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions