| Bookmark Name | Actions |
|---|
Deploying Savings Pot Microservices on AWS
This section explains how to deploy the Party microservice on the AWS cloud. To do so, you need to perform the following tasks:
Deployment Artefacts
Savings Pot Microservice for AWS deployment is available as single release bundle. For example, ms-savingspot-package-aws-<release_number>.zip. It consists of the ms-savingspot-package-aws-<release_number>.jar file and AWS script files.
- The
install-aws.shscript is used to deploy the Savings Pot microservice in the Standalone mode. - Use the
destroy-aws.shscript to undeploy and delete the resources. The Swagger JSON document will be available in the location:/ms-savingspot-package-aws-<release no>.jar/api.
Deployment of Microservices on AWS
Prerequisite
- AWS CLI and Python 2.7.x must be installed prior to the deployment and an active connection string of Mongo Atlas cluster is required.NOTE:
- Mongo Atlas Connection string should be obtained for Java driver version 3.4.
- Download the Mongo Shell from Mongo Atlas under the tab named Connect with Mongo Shell by clicking Connect.
- Add the shell bin path to your system path and restart the system, if required. For example, C:\MSDownloads\mongodb-win32-x86_64-windows-4.4.0\bin.
To deploy the Savings Pot microsevice on AWS, follow these steps.
- Obtain the generated zip file (from target folder) in the installation directory and unzip it.
- In AWS command line, navigate to the installation directory.
- Modify the region information in the
install-aws.shscript specific to your installationExamples,
- --region us-west-2
- --event-source-arn arn:aws:kinesis:us-west-2
- --uri arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2
-
Similarly, modify the following parameters in install-aws.sh and destroy-aws.sh accordingly:
- MONGODB_CONNECTIONSTR
- MONGOSHELL_CONNECTIONSTR
- MONGODB_DBNAME
- To deploy the microservice, execute
install-aws.shshell script to create the resources. - Post-deployment sign into AWS portal and verify the lambda and API gateways.
- To obtain the API key for all the endpoints in AWS, navigate to API key section under the Amazon API gateway, select the corresponding API key, and click show. The API key has to be a part of header (x-api-key) in all the requests.
- The Base path of the API gateway URL follows the below structure
- Base URL. https://<REST-API-ID>.execute-api.<LOCATION>.amazonaws.com/<DEPLOYMENT_ID>
For example, https://0mnkccy9mh.execute-api.eu-west-2.amazonaws.com/ms-savingspot-api
- The Resource path of the endpoint can be found in the APIs.
- A sample endpoint of marketing catalog can be https://0mnkccy9mh.execute-api.eu-west-2.amazonaws.com/ms-savingspot-api/api/v1.0.0//holdings/savingPots.
Lambda functions
API Gateway
Rest API ID can be obtained from Amazon API Gateway.
Location and deployment ID must be replaced with the appropriate values provided in the script during deployment.
Undeployment
To undeploy the Savings Pot microservice from the AWS cloud, follow these steps.
- Modify the parameter named MONGOSHELL_CONNECTIONSTR in the destroy-aws.sh file as indicated earlier in the deployment steps.
- Execute the destroy-aws.sh file.
NOTE: The database user credentials must have the admin access.
Add Bookmark
save your best linksView Bookmarks
Visit your best linksIn this topic
Are you sure you want to log-off?