0

I was trying to follow the official AWS guide to connect to AWS Keyspaces using .Net Core. I tried to implement this code for a C# lambda function but I'm having trouble trying to add the Starfield X509 certificate to it in order to connect to my DB.

To the best of my knowledge AWS lambdas don't really have any sub folders to store files in correct? If that is the case, I was wondering how I can store a cert in the lambda or if there is a way to retrieve the cert for the lambda so that I can use it to connect to AWS Keyspaces.

Forgive me if my assumptions are all wrong. If there is a better way to connect to AWS Keyspaces using lambdas I'm always happy to try it.

user1842633
  • 305
  • 1
  • 4
  • 15

1 Answers1

0

You don't have to store the certification in a sub directory, you can accesses it from the root directory.

Amazon Keyspaces enables you to use the Cassandra Query Language (CQL) API code, Cassandra drivers, and developer tools that you already use. Encryption at rest is automatically enabled when you create a new Amazon Keyspaces table and all client connections require Transport Layer Security (TLS).

We have a working example for Keyspaces and lambda function here in AWS Keyspaces sample here and a link to the AWS keyspace sample code on Github:

amazon-keyspaces-examples/dotnet/datastax-v3/connection-lambda at main ยท aws-samples/amazon-keyspaces-examples

You can use AWS toolkit on Visual Studios here is a link: https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/lambda-index.html

 aws lambda update-function-configuration --function-name $FUNCTION \
    --environment "Variables={SERVICE_USER_NAME=ServiceUserName,SERVICE_PASSWORD=ServicePassword,CERTIFICATE_PATH=.}"
Autumn88
  • 351
  • 1
  • 11