CloudFormation is not a constructor
Carloss616 opened this issue · comments
I am trying to get cloudformation outputs, but it seems CloudFormation
does not work.
I tested other services such as s3 and it works.
Also, I tested both versions: as library and copying the dist files. In both cases happen the same.
Here is my code:
function syncCfnOutputs() {
AWSSDK.initConfig(AWS_CONFIG);
const client = new AWSSDK.AWS.CloudFormation();
client.listExports({}, (error, data) => {
if (error) {
throw `Error listing CloudFormation exports: ${error.message}`;
} else {
Logger.log(data.Exports)
}
})
}
Got this error:
TypeError: AWSSDK.AWS.CloudFormation is not a constructor
Any idea why or how can I fix it?
@Carloss616 did you build it with support for CF?
https://github.com/dxdc/aws-sdk-google-apps#customized-aws-sdk
The library was specifically created so that you can customize the list of services.
npm run sdk --sdk=ses,s3,ec2,lambda,cloudformation && npm run build
Oh, my bad, I may have misunderstood. I thought that by directly accessing AWS I could use all the services. Now I got it.
Thanks for the reply! 🚀