diff --git a/localstack_client/config.py b/localstack_client/config.py index e609a58..2eb4149 100644 --- a/localstack_client/config.py +++ b/localstack_client/config.py @@ -1,5 +1,6 @@ import os import json +from six.moves.urllib.parse import urlparse _service_endpoints_template = { 'apigateway': '{proto}://{host}:4567', @@ -18,10 +19,12 @@ 'route53': '{proto}://{host}:4580', 'cloudformation': '{proto}://{host}:4581', 'cloudwatch': '{proto}://{host}:4582', + 'ssm': '{proto}://{host}:4583', 'cognito-idp': '{proto}://{host}:4590', 'cognito-identity': '{proto}://{host}:4591', 'sts': '{proto}://{host}:4592', - 'iam': '{proto}://{host}:4593' + 'iam': '{proto}://{host}:4593', + 'kms': '{proto}://{host}:4594' } @@ -37,3 +40,16 @@ def get_service_endpoints(localstack_host=None): return json.loads(json.dumps(_service_endpoints_template) .replace('{proto}', protocol).replace('{host}', localstack_host)) + + +def get_service_port(service): + ports = get_service_ports() + return ports.get(service) + + +def get_service_ports(): + endpoints = get_service_endpoints() + result = {} + for service, url in endpoints.items(): + result[service] = urlparse(url).port + return result diff --git a/setup.py b/setup.py index 1d3540b..694f14d 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='localstack-client', - version='0.3', + version='0.4', description='A lightweight python client for LocalStack.', author='Jeff Wu, Waldemar Hummer', author_email='jeffrey.yung.wu@gmail.com, waldemar.hummer@gmail.com',