Module aws.simpledb
![](https://bcentral-packageicons.azureedge.net/images/ballerinax_aws.simpledb_2.1.0.png)
ballerinax/aws.simpledb Ballerina library
Overview
The Ballerina AWS SimpleDB provides the capability to manage domains in AWS SimpleDB.
This module supports Amazon SimpleDB REST API 2009-04-15
version.
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create an AWS account
- Obtain tokens
Quickstart
To use the AWS SimpleDB connector in your Ballerina application, update the .bal file as follows:
Step 1: Import connector
Import the ballerinax/aws.simpledb
module into the Ballerina project.
import ballerinax/aws.simpledb;
Step 2: Create a new connector instance
You can now enter the credentials in the SimpleDB client configuration and create the SimpleDB client by passing the configuration as follows.
simpledb:AwsCredentials awsCredentials = { accessKeyId: "<ACCESS_KEY_ID>", secretAccessKey: "<SECRET_ACCESS_KEY>" }; simpledb:ConnectionConfig config = { credentials:awsCredentials, region: <REGION> }; simpledb:Client amazonSimpleDBClient = check new (config);
Step 3: Invoke connector operation
-
You can create a domain in Amazon SimpleDB as follows with
createDomain
method for a preferred domain name.simpledb:CreateDomainResponse response = check amazonSimpleDBClient->createDomain("NewTDomain"); log:printInfo("Created Domain: " + response.toString());
-
Use
bal run
command to compile and run the Ballerina program.