aws / aws/aws-cli

Improve "region" validation

Open
#2,266 8 comments 7 reactions 0 assignees View on GitHub
codedeploy feature-request p3
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

HI,

I got stuck in a pretty bad debugging loop based on a very misleading error message.

I had set my region as us-east-1d, not us-east-1. Somehow this resulted in an SSL Protocol Unknown exception (requests.exceptions.args SSL UNKNOWN_PROTOCOL). This led me down a rabbit hole of installing certifi, wondering if the python3 vs python2 version was an issue, etc etc.

I see there is even a stub which is supposed to do some region validation, but it only checks that the region exists:

https://github.com/aws/aws-cli/blob/develop/awscli/customizations/codedeploy/utils.py#L48

Is there a way to make this more robust? I don't know what patterns are valid regions, or if there is a way to check at runtime, but there must be a better way to handle an error like mine.

I'm game to try to help improve this so others don't get stuck like I do, but I am not certain how.

tnx

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.