Skip to content

[BUG] DescribeKeyPairs — empty list / HTTP 200 instead of InvalidKeyPair.NotFound #1911

Description

@Leandro-ft

Service

EC2

AWS API Action

DescribeKeyPairs

AWS Documentation

https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeKeyPairs.html

https://docs.aws.amazon.com/ec2/latest/devguide/errors-overview.html

If KeyName does not exist → InvalidKeyPair.NotFound (the specified key pair name does not exist).

Expected behavior

aws ec2 describe-key-pairs --key-names does-not-exist

→ error InvalidKeyPair.NotFound, non-zero CLI exit code.

Actual behavior

Floci returns HTTP 200 / CLI exit 0 with empty (or without the requested name):

{
  "KeyPairs": []
}

Impact

Idempotent callers that treat describe-key-pairs --key-names X exit 0 as “present” skip ImportKeyPair / create and leave the account without the key.

Reproduction

export AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test AWS_DEFAULT_REGION=us-east-1
export AWS_ENDPOINT_URL=http://localhost:4566

# Fresh / empty account: no key pairs
aws ec2 describe-key-pairs --output json

# Missing name must fail like AWS (InvalidKeyPair.NotFound)
aws ec2 describe-key-pairs \
  --key-names fintree-production \
  --output json
echo "exit=$?"

Environment

  • Floci version / image tag: nightly
  • Running: Docker (port 4566)

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingec2Amazon Elastic Compute Cloud (EC2)released

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions