Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (5.6k points)

I'm trying to write an SES TypeScript client, Here is what I have tried:

/// <reference path="../typings/aws-sdk.d.ts" />

var AWS = require('aws-sdk'); 

var ses:SES = new AWS.SES();

And here is the error that I'm getting:

/usr/local/bin/tsc --sourcemap SesTest.ts

SesTest.ts(3,9): error TS2304: Cannot find name 'SES'.

Process finished with exit code 2

I cannot find any documentation on how to make this work.

1 Answer

0 votes
by (12.4k points)

I think a more appropriate way to do this would be:

import { <ServiceName> } from 'aws-sdk';

for instance

import { DynamoDB } from 'aws-sdk';

followed by

this.client = new DynamoDB(); in the class.

It's more appropriate because it uses TypeScript's import syntax.

Here is a clear explanation by AWS on how to use TypeScript with AWS SDK.   

Interested to know about AWS? Come & join AWS Training provided by Intellipaat

Related questions

0 votes
1 answer
asked Oct 3, 2019 in AWS by yuvraj (19.1k points)
Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...