I'm trying out Ballerina for a sample tool I'm writing. I want to periodically inject test data into a DynamoDB table. Started looking into aws.dynamodb module, however I can't find a way to avoid hard coding the credentials.
So far I've tried specifying an empty struct awsCredentials to see if standard environment variables are being looked up.
import ballerina/io;
import ballerinax/aws.dynamodb;
public function main() {
io:println("testing dynamodb connection...");
dynamodb:ConnectionConfig ddbConfig = {
awsCredentials: {},
region: "ap-southeast-2",
};
dynamodb:Client dbClient = check new(ddbConfig);
}
But I get the following error, which indicates that there is no such lookup?
ERROR [main.bal:(14:23,14:25)] incompatible mapping constructor expression for type '(ballerinax/aws.dynamodb:2.0.0:AwsCredentials|ballerinax/aws.dynamodb:2.0.0:AwsTemporaryCredentials)'
ERROR [main.bal:(16:1,16:1)] missing identifier
error: compilation contains errors
I've tried looking up lib.ballerina.io and just plain old googling, but I can't find a proper example on this scenario. Appreciate if some pointers can be provided.