Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting promise is not a function error on lambda execution logs #36

Closed
tlopo opened this issue Feb 12, 2024 · 2 comments
Closed

Getting promise is not a function error on lambda execution logs #36

tlopo opened this issue Feb 12, 2024 · 2 comments

Comments

@tlopo
Copy link
Contributor

tlopo commented Feb 12, 2024

Hi there,

I was getting error promise is not a function from https://github.com/disney/terraform-aws-kinesis-firehose-splunk/blob/master/files/kinesis-firehose-cloudwatch-logs-processor.js#L131:

const response = await client[methodName](args).promise()

While debugging I printed the return of client[methodName](args) and it was of type promise, so I changed it to:

const response = await client[methodName](args)

It solved my problem, so I thought I would let you guys know.

@tlopo
Copy link
Contributor Author

tlopo commented Feb 13, 2024

Digging deeper on this issue, this is happening because it's now using aws-sdk v3:

below a snippet of code using aws-sdk v2:

var AWS = require("aws-sdk")

AWS.config.update({region: "eu-west-2"})

client  = new AWS.Firehose();

(async function(){
  r = await client.listDeliveryStreams({}).promise()
  console.log(r)    
})()

Using aws-sdk v3:

const { Firehose } = require("@aws-sdk/client-firehose");

( async function(){
    client =  new Firehose({region: "eu-west-2"})
    r = await client.listDeliveryStreams({})
    console.log(r)
})()

@mlcooper
Copy link
Collaborator

Fixed in #38

@mlcooper mlcooper reopened this Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants