Skip to content

Improve error UX when AWS creds or profile not found #42

@scottbrown

Description

@scottbrown

Currently, when you run beacon without access to AWS credentials or an AWS profile, a cryptic error message is printed.

$ beacon --info "test" --instance-id foo
operation error CloudWatch Events: PutEvents, exceeded maximum number of attempts, 3, 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: no route to host

A better error message should be shown to indicate to the user what steps to take. Something like:

AWS credentials not found. Please configure credentials using one of these methods:
1. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables
2. Configure ~/.aws/credentials file
3. Run on an EC2 instance with an IAM role
4. Use AWS_PROFILE environment variable to specify a profile

or, in the case of a permissions error:

AWS permissions error: you do not have access to perform the required actions.
Beacon requires the events:PutEvents permission.
Run 'beacon --permissions' to see the required IAM policy.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions