theam / aws-lambda-haskell-runtime

⚡Haskell runtime for AWS Lambda
https://theam.github.io/aws-lambda-haskell-runtime/
Other
269 stars 48 forks source link

[Question] Fetching values from SSM from Haskell Lambda #94

Closed EncodePanda closed 3 years ago

EncodePanda commented 3 years ago

Hi,

we are trying to retrieve a value from SSM within a Haskell Lambda (aws-lambda-haskell-runtime). If we were writing this lambda using JavaScript we would do something like this:

(...)
const AWS = require('aws-sdk');
const SSM = new AWS.SSM({
  httpOptions: {
    connectTimeout: parseInt(process.env.CONNECT_TIMEOUT),
    timeout: parseInt(process.env.REQUEST_TIMEOUT),
  },
});
const response = await SSM.getParameter({
      Name: name,
      WithDecryption: true,
 }).promise();
(....)

Is there an equivalent call that we could run on the aws-lambda-haskell-runtime?

andys8 commented 3 years ago

In my project we use amazonka in general for any aws service like dynamodb. So my first guess would be to use amazonka-ssm.

http://hackage.haskell.org/package/amazonka-ssm

Would that achieve what you want or is there a cause it needs to be lambda specific, is coupled to requests or can't be used?

NickSeagull commented 3 years ago

Yes, for calls to AWS services one would use amazonka. The runtime only should provide the events and so