Python AWS Helper Library
Project description
PyAwsHelper
Python AWS Helper Library
AWS Region Helper
Get AWS region from region suffix
from PyAwsHelper.region import Region
aws_region = Region.get_region("va")
>>> aws_region
'us-east-1'
Also supports providing default value
from PyAwsHelper.region import Region
aws_region = Region.get_region("foo", default_region="bar")
>>> aws_region
'bar'
Get region suffix from AWS region
from PyAwsHelper.region import Region
aws_region = Region.get_region_suffix("us-east-1")
>>> aws_region
'va'
Also supports providing default value
from PyAwsHelper.region import Region
aws_region = Region.get_region_suffix("foo", default_region_suffix="bar")
>>> aws_region
'bar'
Regions Config
{
"hk": "ap-east-1", # Hong Kong
"tk": "ap-northeast-1", # Tokyo
"se": "ap-northeast-2", # Seoul
"os": "ap-northeast-3", # Osaka-Local
"mu": "ap-south-1", # Mumbai
"sg": "ap-southeast-1", # Singapore
"sy": "ap-southeast-2", # Sydney
"au": "ap-southeast-2", # Sydney
"ce": "ca-central-1", # Central
"be": "cn-north-1", # Beijing
"ni": "cn-northwest-1", # Ningxia
"fr": "eu-central-1", # Frankfurt
"st": "eu-north-1", # Stockholm
"ir": "eu-west-1", # Ireland
"lo": "eu-west-2", # London
"pa": "eu-west-3", # Paris
"ba": "me-south-1", # Bahrain
"sp": "sa-east-1", # São Paulo
"va": "us-east-1", # N. Virginia
"va-gov": "us-gov-east-1",
"oh": "us-east-2", # Ohio
"ca": "us-west-1", # N. California
"nc": "us-west-1", # N. California
"ca-gov": "us-gov-west-1",
"nc-gov": "us-gov-west-1",
"or": "us-west-2", # Oregon
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
PyAwsHelper-0.0.2.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for PyAwsHelper-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca2acd0d50043d2cc2b2b15c04025d0e511506c4be01ac6e190663c273c4abd1 |
|
MD5 | a81b65a9995fc4200fbffab191727f7f |
|
BLAKE2b-256 | d9c4ab69513c7da10b5f5debbd8204243512f5696ca407a2ec0c40039c0fe9f7 |