Open ItielOlenick opened 1 year ago
Thanks for your report. Which aws region were you deploying to? cn-north-1
or cn-northwest-1
?
I think either cn-north-1 or cn-northwest-1 for China partition is not work for the default IAM policy, as the policy document is come from this line https://github.com/aws/aws-cdk/blob/33ee4de185fc966ab27de35b7abd98862f04b852/packages/%40aws-cdk/aws-eks/lib/alb-controller.ts#L216 And all these version policy documents are come from ALB ingress repo for this file, they are all for global partition not for GOV or China partitions. There have another policy document in the repo is for the China partition.
Same issue for #22520
For me this happened in cn-northwest-1, But like @zorrofox said, this has to do with the use of the wrong partition in the alb policy.
Taking a quick look at https://github.com/aws/aws-cdk/search?q=arn%3Aaws%3Aec2%3A*%3A*%3Asecurity-group%2F* shows that nothing is done to check the partition in the alb-iam_policy
files which results in the use of the wrong one.
Can we just use the commercial partition policy files to substitute with China or GOV partitions? Or we just like commercial partition to host all the policy files for China and GOV partitions?
Describe the bug
When using the CDK to create a EKS cluster and specifying the use of alb controller, upon the creation of the IAM policy for alb controller the following error arises:
A quick search for
"arn:aws:ec2:*:*:security-group/*"
in the repo shows a few pages where this is used.Expected Behavior
A EKS cluster should be successfully created when using CDK to create in China
Current Behavior
Reproduction Steps
Try to create a EKS cluster in China with the ALB controller enabled:
Possible Solution
Check if the region is in China, and if so change the partition to aws-cn
Additional Information/Context
No response
CDK CLI Version
2.37.1
Framework Version
No response
Node.js Version
15
OS
Linux
Language
Python
Language Version
No response
Other information
No response