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

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
a2345sooted
  • 569
  • 5
  • 20
  • Can you compare the SDK versions on local and in lambda.Issue might be happening because of version mismatch as explained in https://stackoverflow.com/a/53902879/4326922 – Prabhakar Reddy Feb 10 '19 at 03:45

1 Answers1

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.

a2345sooted
  • 569
  • 5
  • 20