Deploying Savings Pot Microservices on AWS

This section explains how to deploy the Savings Pot Microservice on the AWS. To do so, you need to perform the following tasks:

Deployment of Savings Pot Microservice in AWS

MongoDB

To deploy the Savings Pot Microservice on AWS, following are steps:

  1. Obtain the generated zip file (from target folder) in the installation directory and unzip it.
  2. In AWS command line, navigate to the installation directory.
  3. Modify the region information in the install-aws-mongo.sh script specific to your installation

    Examples,

    • --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
  4. Similarly, modify the following parameters in install-aws-mongo.sh and destroy-aws-mongo.sh accordingly:
    • MONGODB_CONNECTIONSTR
    • MONGOSHELL_CONNECTIONSTR
    • MONGODB_DBNAME
  5. For processing multiple deployment, provide unique value to DEPLOYMENT_ENVIRONMENT in install-aws-mongo.sh that creates unique S3 Bucket, Lamda functions, API Gateway, and database name.
  6. If DEPLOYMENT_ENVIRONMENT is not provided with any value then the default value of S3 Bucket, Lamda functions, API Gateway, and database name are considered.
  7. To enable the in-house authentication in addition to the default option (using x-api-key parameter) in aws, perform the JWT Authentication in the installation scripts.
  8. Perform the XACML configurations in the installation scripts to enable security policies and access rights based authorization check for accessing the APIs,
  9. To deploy the Microservice, execute install-aws-mongo.sh shell script to create the resources.
  10. Post-deployment sign into AWS portal and verify the lambda and API gateways.
  11. Lambda functions

    API Gateway

  12. 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.
  13. Following is APIs URL base path 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 savings pot can be https://0mnkccy9mh.execute-api.eu-west-2.amazonaws.com/ms-savingspot-api/api/v1.0.0/holdings/savingPots.
    • 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.

PostgreSQL

To deploy the Savings Pot Microservice on AWS, following steps:

  1. Obtain the generated zip file (from target folder) in the installation directory. Unzip it.
  2. In command prompt, navigate to the installation directory
  3. Modify the region information in the install-aws-postgresql.sh script specific to your installation.

    For Example:

    • --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
  4. For processing multiple deployment, provide unique value to DEPLOYMENT_ENVIRONMENT in install-aws-postgresql.sh which creates unique S3 Bucket, Lamda functions, API Gateway and database name.
  5. If DEPLOYMENT_ENVIRONMENT is not provided with any value then default value of S3 Bucket, Lamda functions, API Gateway and database name will be considered.
  6. To enable the in-house authentication in addition to the default option (using x-api-key parameter) in aws, perform the JWT Authentication in the installation scripts.
  7. Perform the XACML configurations in the installation scripts to enable security policies and access rights based authorization check for accessing the APIs,
  8. To deploy the Microservice, execute install-aws-postgresql.sh shell script to create the resources.
  9. Post-deployment sign into AWS portal and verify the lambda and API gateways.
  10. To obtain the API key for all the endpoints in AWS, navigate to API Key section under the Amazon API gateway and select the corresponding API key, then click on show. The API key has to be a part of header (x-api-key) in all the requests.
  11. Following is API's URL structure.

    https://<REST-API-ID>.execute-api.<LOCATION>.amazonaws.com/<DEPLOYMENT_ID>

    Rest API Id can be obtained from Amazon API Gateway.

    Location and deployment Id should 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:

MongoDB

  1. Modify the parameter named MONGOSHELL_CONNECTIONSTR in the destroy-aws-mongo.sh file as indicated earlier in the deployment steps.
  2. Provide value for DEPLOYMENT_ENVIRONMENT in destroy-aws-mongo.sh as mentioned during deployment steps for undeployment.
  3. If DEPLOYMENT_ENVIRONMENT is not provided with any value during deployment process then no need to provide any value during undeployment as well.
  4. Execute the destroy-aws-mongo.sh file.

PostgreSQL

  1. Provide value for DEPLOYMENT_ENVIRONMENT in destroy-aws-postgresql.sh as mentioned during deployment steps for undeployment.
  2. If DEPLOYMENT_ENVIRONMENT is not provided with any value during deployment process then no need to provide any value during undeployment as well.
  3. Execute the destroy-aws-postgresql.sh accordingly to release the resources created in AWS environment.

The database user credentials must have the admin access.


Field Name
|
Application/Table name

Temenos Headquarters SA
2 Rue de l'Ecole-de-Chimie
CH - 1205 Geneva
Switzerland

Copyright © 2020- Temenos Headquarters SA

Published on :
Tuesday, May 23, 2023 9:34:19 PM IST