-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(aws-eks): Unable to deploy cluster in regions that are not enabled by default #13748
Comments
|
In some AWS regions, such as aws-sdk and aws-cli behave differently when calling STS endpoints. To fix this to do the same in all the regions, lambda functions used in cluster-resource-provider in cdk should have an environment variable:
aws-cdk/packages/@aws-cdk/aws-eks/lib/cluster-resource-provider.ts Lines 61 to 70 in 77ce45d
aws-cdk/packages/@aws-cdk/aws-eks/lib/cluster-resource-provider.ts Lines 71 to 80 in 77ce45d
To be:
|
@civilizeddev Thanks for reporting this. You can workaround this issue for now by applying an aspect that injects that environment variable to all lambda functions associated with the cluster: const cluster = new eks.Cluster(...)
cdk.Aspects.of(Stack.of(cluster)).add({
visit: (node: cdk.IConstruct) => {
if (node instanceof lambda.CfnFunction) {
node.addPropertyOverride('Environment.Variables.AWS_STS_REGIONAL_ENDPOINTS', 'regional')
}
}
}) Another option, though less recommended, is enabling global STS endpoints for all regions in your account. |
The default STS endpoint of the v2 JS SDK is the global endpoint, which does not work in opt-in regions: it has to be the regional endpoint. Fix this by setting a global environment variable for the custom resource Lambdas. Fixes #13748, fixes #15579. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
The default STS endpoint of the v2 JS SDK is the global endpoint, which does not work in opt-in regions: it has to be the regional endpoint. Fix this by setting a global environment variable for the custom resource Lambdas. Fixes aws#13748, fixes aws#15579. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
In AWS Bahrain region (me-south-1), establishing an EKS cluster with cdk has been failed,
with this error message:
"AWS was not able to validate the provided access credentials"
While it succeeded in AWS Seoul region (ap-northeast-2)
It seems to be related to the STS endpoint problem.
Reproduction Steps
My Stack contains:
When I run it:
It is aborted with an error like:
What did you expect to happen?
The stack should be successfully deployed.
What actually happened?
The stack deployment was aborted at this stage:
aws-cdk/packages/@aws-cdk/aws-eks/lib/cluster.ts
Lines 1007 to 1030 in 77ce45d
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: