`failed retrieving AWS identity` errors when running rpk byoc commands

Last updated: August 10, 2026

Problem

When creating or deleting an AWS BYOC cluster, it's possible to receive an error of the form:

  failed retrieving AWS identity: operation error STS: GetCallerIdentity, get identity: get credentials: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, exceeded maximum number of attempts, 3, request send failed, Get "http://169.254.169.254/latest/meta-data/iam/security-credentials/": dial tcp 169.254.169.254:80: connect: host is down

 

This is because, by the very nature of BYOC, the command is trying to interact with your AWS account, and as such needs to run in an environment where access to this account is configured. The error itself comes from the underlying AWS CLI attempting to find this access through fallback methods.

 

Solution

Configuring your local environment to have access to AWS, generally by setting either AWS_PROFILE or AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY will allow the command to proceed.