Skip to content

(aws-eks): Unable to deploy cluster in regions that are not enabled by default #13748

@civilizeddev

Description

@civilizeddev

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:

import * as cdk from '@aws-cdk/core'
import * as eks from '@aws-cdk/aws-eks'

export class EksStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props: cdk.StackProps) {
    super(scope, id, props)
    new eks.Cluster(this, 'cluster', {})
  }
}

// ...

const app = new cdk.App()
new EksStack(app, 'eks', { env: { region: 'me-south-1' } })
app.synth()

When I run it:

$ cdk deploy eks

It is aborted with an error like:

ERROR: AWS was not able to validate the provided access credentials

What did you expect to happen?

The stack should be successfully deployed.

What actually happened?

Failed to create resource. The security token included in the request is invalid

Logs: /aws/lambda/eks-awscdkawseksClusterReso-OnEventHandler42BEBAE0-4QPUO1YX3M0U
Failed to delete resource. The security token included in the request is invalid

Logs: /aws/lambda/eks-awscdkawseksClusterRe-IsCompleteHandler7073F4D-ER83I62J68AJ

The stack deployment was aborted at this stage:

const resource = this._clusterResource = new ClusterResource(this, 'Resource', {
name: this.physicalName,
environment: props.clusterHandlerEnvironment,
roleArn: this.role.roleArn,
version: props.version.version,
resourcesVpcConfig: {
securityGroupIds: [securityGroup.securityGroupId],
subnetIds,
},
...(props.secretsEncryptionKey ? {
encryptionConfig: [{
provider: {
keyArn: props.secretsEncryptionKey.keyArn,
},
resources: ['secrets'],
}],
} : {} ),
endpointPrivateAccess: this.endpointAccess._config.privateAccess,
endpointPublicAccess: this.endpointAccess._config.publicAccess,
publicAccessCidrs: this.endpointAccess._config.publicCidrs,
secretsEncryptionKey: props.secretsEncryptionKey,
vpc: this.vpc,
subnets: placeClusterHandlerInVpc ? privateSubents : undefined,
});

Environment

  • CDK CLI Version : 1.94.1
  • Framework Version:
  • Node.js Version: 14.16.0
  • OS : macOS BigSur 11.2.3(20D91)
  • Language (Version): TypeScript 4.2.3

Other


This is 🐛 Bug Report

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-eksRelated to Amazon Elastic Kubernetes ServicebugThis issue is a bug.effort/mediumMedium work item – several days of effortp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions