in lambda/src/cloudrack-lambda-core/db/db.go [29:43]
func Init(tn string, pk string, sk string) DBConfig{
// Initialize a session that the SDK will use to load
// credentials from the shared credentials file ~/.aws/credentials
// and region from the shared configuration file ~/.aws/config.
dbSession := session.Must(session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,
}))
// Create DynamoDB client
return DBConfig{
DbService : dynamodb.New(dbSession),
PrimaryKey : pk,
SortKey : sk,
TableName : tn,
}
}