Skip to content

Instantly share code, notes, and snippets.

@monkut
Created September 20, 2019 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monkut/03c91b63044dee21a2a677969e64490d to your computer and use it in GitHub Desktop.
Save monkut/03c91b63044dee21a2a677969e64490d to your computer and use it in GitHub Desktop.
boto3 defined default service endpoints definition for use with localstack
import os
AWS_REGION = os.getenv('AWS_DEFAULT_REGION', 'ap-northeast-1')
DEFAULT_S3_SERVICE_ENDPOINT = f'https://s3.{AWS_REGION}.amazonaws.com'
DEFAULT_SQS_SERVICE_ENDPOINT = f'https://sqs.{AWS_REGION}.amazonaws.com'
DEFAULT_SNS_SERVICE_ENDPOINT = f'https://sns.{AWS_REGION}.amazonaws.com'
AWS_SERVICE_ENDPOINTS = {
's3': os.getenv('S3_SERVICE_ENDPOINT', DEFAULT_S3_SERVICE_ENDPOINT),
'sqs': os.getenv('SQS_SERVICE_ENDPOINT', DEFAULT_SQS_SERVICE_ENDPOINT),
'sns': os.getenv('SNS_SERVICE_ENDPOINT', DEFAULT_SNS_SERVICE_ENDPOINT),
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment