Domain App S3 Data Source Setup

Objective:

This document will help you to create json data source and upload in Amazon S3. These documents will be used as data source for “domain apps” in the VoiceWorx platform.

Create an account in Amazon Web Services

  1. Each user will need an account through Amazon Web Services. If already registered please log in. If not a current user, register at “https://console.aws.amazon.com/”. User will be directed to the registration page as shown below, click “Create a new AWS account” and follow the steps to register.

  1. Once registered, login to the AWS Management console “https://console.aws.amazon.com/”, by using the credentials from Step 1.

  1. Sign in will direct to the AWS Management Console.

  1. Create Policy

After you log into to the console, type IAM in the search bar and click IAM in the search result.

On the left navigation, click Policies, and click button Create Policy as shown in the screen below.

{

"Version": "2012-10-17",

"Statement": [

{

"Effect": "Allow",

"Action": [

"iam:ChangePassword"

],

"Resource": [

"arn:aws:iam::*:user/${aws:username}"

]

},

{

"Effect": "Allow",

"Action": [

"iam:GetAccountPasswordPolicy"

],

"Resource": "*"

},

{

"Effect": "Allow",

"Action": [

"logs:CreateLogGroup",

"logs:CreateLogStream",

"logs:PutLogEvents"

],

"Resource": "*"

},

{

"Sid": "ConsoleAccess",

"Effect": "Allow",

"Action": [

"s3:GetAccountPublicAccessBlock",

"s3:GetBucketAcl",

"s3:GetBucketLocation",

"s3:GetBucketPolicyStatus",

"s3:GetBucketPublicAccessBlock",

"s3:ListAllMyBuckets"

],

"Resource": "*"

},

{

"Sid": "ListObjectsInBucket",

"Effect": "Allow",

"Action": "s3:ListBucket",

"Resource": [

"arn:aws:s3:::INSERT_BUCKET_NAME"

]

},

{

"Sid": "AllObjectActions",

"Effect": "Allow",

"Action": "s3:*Object",

"Resource": [

"arn:aws:s3:::INSERT_BUCKET_NAME/*"

]

},

{

"Sid": "Lambda",

"Effect": "Allow",

"Action": [

"lambda:ListFunctions",

"lambda:InvokeFunction",

"lambda:ListVersionsByFunction",

"lambda:GetLayerVersion",

"lambda:GetEventSourceMapping",

"lambda:GetFunction",

"lambda:ListAliases",

"lambda:GetAccountSettings",

"lambda:InvokeAsync",

"lambda:GetFunctionConfiguration",

"lambda:GetLayerVersionPolicy",

"lambda:ListFunctionEventInvokeConfigs",

"lambda:ListProvisionedConcurrencyConfigs",

"lambda:GetProvisionedConcurrencyConfig",

"lambda:GetFunctionConcurrency",

"lambda:ListTags",

"lambda:GetFunctionEventInvokeConfig",

"lambda:ListEventSourceMappings",

"lambda:ListLayerVersions",

"lambda:ListLayers",

"lambda:GetAlias",

"lambda:GetPolicy"

],

"Resource": "*"

}

]

}Click the JSON tab replace the content with the above json content.

Replace the INSERT_BUCKET_NAME with the name of the bucket. And click button Review Policy.

Provide name, description and click button Create policy.

  1. Create IAM User

In AWS console, type IAM in the search bar and click on the IAM from the drop down.

On the left navigation, Click Users. Click button Add user as shown in the screen below.

Provide user name, enable check box for Programmatic Access and AWS management Console Access. Click radio button for Autogenerate password and check User must create a new password at next sign in. Please refer the screen below.

Click Next. And tags are optional, you can just click Next to get to the final screen to create user.

Click button Create user.

Success screen will be displayed.

Click button Download .csv and share the file with us.

  1. Click “Services” on the top left corner and type S3 in the “All services” filter. Amazon S3 (Simple Storage Service) has a web service interface which can be used to store and retrieve any amount of data, at any time on the web.

  1. Create bucket in S3 by clicking “Create Bucket”.

  • Enter Bucket Name: myawsbucket

  • Select Region: US East

  • Click: Create Bucket

  • Server Side Encryption: Choose disable

  1. For the data source, get sample data from here. You’ll get data like this, which you have to copy from the browser, paste it in a notepad and save it as a json file.

  1. Let’s put a name to the file as “Retail.json”.

  1. Now, upload the file in the bucket. Click bucket “Name” and click “Upload”.

  1. Files or folders can either be added or uploaded. To upload file, click “Add Files” and select the “Retail.json” (from Step 9) file from your PC.

  1. Select the file and click “upload”.

  1. Your data source is now ready for use. You can perform retrieval operation on the json data source by using a managed connection from the VoiceWorx platform.

  1. The name of the json file shall be used in the VoiceWorx platform to perform a query against the data source. Below is an example of a valid data sample on the json data source file. If your could not get the data sample from Step 8, you can use the following data and continue.

{

"customerAccountDetails": [

{

"id": "4DABC534-7744-4987-988A-5E0C4CF6762D",

"customerId": 512312,

"accountNo": 12589,

"registrationDate": "11-01-2020",

"expiryDate": "10-31-2022",

"accountBalance": 15000,

"accountDue": 70,

"isDueCleared": false,

"customerCode": 1001,

"email": "johndoe@company.com",

"fullName": "John Doe",

"address": "Bryant, AR",

"dob": "03-16-1975",

"idNumber": 53698,

"SSN": "173213211",

"zipcode": "72022"

}

],

"customerOrders": [

{

"id": "29A8BB59-82A1-45E6-A5DB-044CF987D659",

"customerId": 512312,

"orderNo": 10012,

"grossTotal": 120,

"discount": 5,

"tax": 5,

"netTotal": 120,

"orderDate": "11-01-2020",

"orderStatus": "Dispatched",

"products": "LV Bag, Nike runner pro",

"expectedDeliveryDate": "11-20-2020"

},

{

"id": "C270A981-BEF8-44F3-B71C-C923052BA64E",

"customerId": 512312,

"orderNo": 10014,

"grossTotal": 600,

"discount": 100,

"tax": 100,

"netTotal": 600,

"orderDate": "11-01-2020",

"orderStatus": "Dispatched",

"products": "iPhone, Apple Watch"

}

],

"productCatalog": [

{

"id": "03A60A7C-4488-41FD-B174-CC8C0A71223A",

"productSKU": 612312,

"productName": "apple watch",

"discount": 5,

"tax": 5,

"price": 350,

"restockAmount":120

},

{

"id": "03A60A7C-4488-41FD-B174-CC8C0A71223A",

"productSKU": 612312,

"productName": "Apple Watch",

"discount": 5,

"tax": 5,

"price": 350,

"restockAmount":120

},

{

"id": "03A60A7C-4488-41FD-B174-CC8C0A71223A",

"productSKU": 612312,

"productName": "Apple watch",

"discount": 5,

"tax": 5,

"price": 350,

"restockAmount":120

},

{

"id": "03A60A7C-4488-41FD-B174-CC8C0A71223A",

"productSKU": 612312,

"productName": "apple Watch",

"discount": 5,

"tax": 5,

"price": 350,

"restockAmount":120

},

{

"id": "830F1850-6C18-4EF1-A704-A8FA884FAB61",

"productSKU": 612313,

"productName": "iPhone",

"discount": 5,

"tax": 5,

"price": 900,

"restockAmount":120

}

],

"retailLocations": [

{

"id": "29A8BB59-82A1-45E6-A5DB-044CF987D651",

"locationId": "DD6B6FA0-DD14-4547-8554-5E562365444E",

"storeName": "Fairfield Discount Store",

"Street": "123 Main Street",

"City": "Fairfield",

"State": "GA",

"zip": 30339

},

{

"id": "C270A981-BEF8-44F3-B71C-C923052BA64E",

"locationId": "DD6B6FA0-DD14-4547-8554-5E562365555F",

"storeName": "Maryland Discount Store",

"Street": "192 Maryland Avenue",

"City": "Chicago",

"State": "IL",

"zip": 30338

}

]

}

Last updated