Deploying Campaign Microservice on AWS
This section explains how to deploy the Campaign Microservice on the AWS cloud. To do so, you need to perform the following tasks:
For MYSQL
Deployment Artefacts
Campaign Microservice for AWS deployment is available as single release bundle, which is ms-campaign-package-aws-<release_number>.zip.
The zip file contains the ms-campaign-package-aws-<release_number>.jar file and the following AWS script files:
- The install-aws.sh script is used to deploy the Campaign Microservices in the AWS environment.
- The destroy-aws.sh script to stop AWS services and delete those services in the AWS environment.
The following screen displays the folder view of the AWS package.
The OAS Swagger json document is available at the location: /ms-campaign-package-aws-<release no>.jar/api.
Installing Campaign Microservice on AWS
Prerequisites
Before deploying Campaign Microservice on AWS, ensure to meet the following prerequisites:
- Install the AWS CLI. For more information about the installation, click here.
- Install the Python 2.7.x. For more information about the installation, click here.
- An active connection of MySQL database is required.
- For running the script, you must have the necessary permissions to access or manage cloud resources such as Lambda functions, api-gateway, S3 bucket, Event streams, and databases.
To deploy the Campaign Microservice on AWS, follow these steps.
- Extract the generated AWS package contents into the installation directory.
- To enable the in-house authentication in addition to API key, perform the JWT Authentication in the installation scripts.
- In AWS command line, go to the installation directory and modify the region information in the install-aws.sh script specific to your installation.
--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
- To create the resources, run install-aws.sh.
- Post-deployment, sign in to AWS portal and check if the following are created properly.
Lamda Functions

API Gateway


- To obtain the API key for all the endpoints in AWS, go to the 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.

- After the successful deployment, the collections and the reference data(master data) are loaded into the MySQL database.
- The base path of the API Gateway URL is as follows.
Base Path: https://<REST-API-ID>.execute-api.<LOCATION>.amazonaws.com/<DEPLOYMENT_ID>
For example, https://samplehost.execute-api.eu-west-2.amazonaws.com/ms-campaign-api
The resource path of the endpoint is available in the swagger document of the respective APIs.
A sample endpoint of Campaign Microservice could be https://samplehost.execute-api.eu-west-2.amazonaws.com/ms-campaign-api/v1.0.0/origination/campaigns.

You can obtain the Rest API ID from the Amazon API Gateway. Ensure to replace the location and deployment ID with appropriate values that are provided in the script during deployment.
For MSSQL
Deployment Artefacts
Campaign Microservice for AWS deployment is available as single release bundle, which is ms-campaign-package-aws-<release_number>.zip.
The zip file contains the ms-campaign-package-aws-<release_number>.jar file and the following AWS script files:
- The install-aws-mssql.sh script is used to deploy the Campaign Microservices in the AWS environment.
- The destroy-aws-mssql.sh script to stop AWS services and delete those services in the AWS environment.
The following screen displays the folder view of the AWS package.
The OAS Swagger json document is available at the location: /ms-campaign-package-aws-<release no>.jar/api.
Installing Campaign Microservice on AWS
Prerequisites
Before deploying Campaign Microservice on AWS, ensure to meet the following prerequisites:
- Install the AWS CLI. For more information about the installation, click here.
- Install the Python 2.7.x. For more information about the installation, click here.
- An active connection of MSSQL database is required.
- For running the script, you must have the necessary permissions to access or manage cloud resources such as Lambda functions, api-gateway, S3 bucket, Event streams, and databases.
To deploy the Campaign Microservice on AWS, follow these steps.
- Extract the generated AWS package contents into the installation directory.
- To enable the in-house authentication in addition to API key, perform the JWT Authentication in the installation scripts.
- In AWS command line, go to the installation directory and modify the region information in the install-aws-mssql.sh script specific to your installation.
--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
- To create the resources, run install-aws-mssql.sh.
- Post-deployment, sign in to AWS portal and check if the following are created properly.
Lamda Functions

API Gateway


- To obtain the API key for all the endpoints in AWS, go to the 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.

- After the successful deployment, the collections and the reference data(master data) are loaded into the mssql database.
- The base path of the API Gateway URL is as follows.
Base Path: https://<REST-API-ID>.execute-api.<LOCATION>.amazonaws.com/<DEPLOYMENT_ID>
For example, https://samplehost.execute-api.eu-west-2.amazonaws.com/ms-campaign-api
The resource path of the endpoint is available in the swagger document of the respective APIs.
A sample endpoint of Campaign Microservice could be https://samplehost.execute-api.eu-west-2.amazonaws.com/ms-campaign-api/v1.0.0/origination/campaigns.

You can obtain the Rest API ID from the Amazon API Gateway. Ensure to replace the location and deployment ID with appropriate values that are provided in the script during deployment.
In this topic