Skip to content

AWS cli auto-prompt breaks kubectl with Amazon EKS #7862

@nicoaws

Description

@nicoaws

Describe the bug

When the AWS CLI has auto-prompt enabled by cli_auto_prompt = on, any kubectl commands against the control plane API of EKS clusters.
Kubectl obtains a cluster token by issuing the following CLI command aws eks get-token --region eu-west-1 --cluster-name my-cluster --output json (see below kubeconfig file).

    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - --region
      - eu-west-1
      - eks
      - get-token
      - --cluster-name
      - my-cluster
      - --output
      - json
      command: aws

This command stalls without erroring as it waits for a user prompt (because auto-prompt is enabled). It's something difficult to troubleshoot as it doesn't report any errors.

Expected Behavior

Auto-prompt is engaged just when commands are thrown in an interactive mode directly from the CLI and not from another executable/command.

Current Behavior

Kubectl hangs

Reproduction Steps

See description.

Possible Solution

No response

Additional Information/Context

No response

CLI version used

aws-cli/2.11.15 Python/3.11.3 Darwin/22.4.0 source/x86_64 prompt/off

Environment details (OS name and version, etc.)

MacOS Ventura

Metadata

Metadata

Assignees

Labels

auto-prompt-modeIssues related to CLI auto-prompt modeclosed-for-stalenesseksresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions