1

Inside a newly created lambda function (with all the permissions set up), I have:

const aws = require("aws-sdk");

aws.config.apiVersions = {
  rds: '2014-10-31'
};

const rds = new aws.RDS();

When I call rds.describeDBClusters({DBClusterIdentifier: 'mycluster'}), everything works as expected.

When I call rds.stopDBCluster({DBClusterIdentifier: 'mycluster'}), I get

TypeError: rds.stopDBCluster is not a function.

In the api docs here: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/RDS.html There is documented the stopDBCluster function. I also notice that if I look at the docs for an earlier version of the API, the stopDBCluster function is not there.

Has anybody else ran into this? Even though I am calling out the most recent api in the sdk config, is it possible that the function is still using an older one?

  • Runtime for lambda = Node 8.10

  • Permissions seems to be good since the describe function works and this is a runtime reference error anyhow.

  • Database is Aurora with Postgres(10 I think)

  • Same issue if I pass the api version into the RDS constructor

1
  • Can you compare the SDK versions on local and in lambda.Issue might be happening because of version mismatch as explained in stackoverflow.com/a/53902879/4326922 Commented Feb 10, 2019 at 3:45

1 Answer 1

0

This must be a bug with the aws-sdk on lambda. When I run all the same code locally with permissions, after doing an npm install of aws-sdk, everything works fine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.