March 2019
Intermediate to advanced
168 pages
4h 33m
English
We also want to be able to test that the serverless microservice API is working correctly after it is deployed. I use a mix of Python and bash to make it easier.
A Python script called serverless-microservice-data-api/bash/apigateway-lambda-dynamodb/get_apigateway_endpoint.py is first used to query AWS API Gateway to get the full endpoint and return a code 0 if it succeeds:
import argparseimport loggingimport boto3logging.getLogger('botocore').setLevel(logging.CRITICAL)logger = logging.getLogger(__name__)logging.basicConfig(format='%(asctime)s %(levelname)s %(name)-15s: %(lineno)d %(message)s', level=logging.INFO) logger.setLevel(logging.INFO) def get_apigateway_names(endpoint_name): client ...Read now
Unlock full access