Skip to content

Commit ab5c45e

Browse files
committed
Upgrade to AWS SDK for Javascript V3
1 parent a45f2e6 commit ab5c45e

13 files changed

+2741
-897
lines changed

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 9.0.0
4+
5+
- Removes: aws-sdk as a runtime dependency
6+
- Adds: `@aws-sdk/client-cloudformation` as a runtime dependency
7+
- Updates: bin/validate-template to use `@aws-sdk/client-cloudformation`.
8+
39
## 8.4.0
410

511
- Support `ImageConfig` property for Lambda

lib/validate.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

3-
require('aws-sdk/lib/maintenance_mode_message').suppress = true;
4-
const AWS = require('aws-sdk');
3+
const { CloudFormationClient, ValidateTemplateCommand } = require('@aws-sdk/client-cloudformation');
54
const build = require('./build');
65

76
/**
@@ -16,9 +15,9 @@ const build = require('./build');
1615
* reject if it is not.
1716
*/
1817
module.exports = (templatePath, region) => {
19-
const cfn = new AWS.CloudFormation({ region: region || 'us-east-1' });
18+
const cfn = new CloudFormationClient({ region: region || 'us-east-1' });
2019

2120
return build(templatePath, { region: region || 'us-east-1' }).then((template) => {
22-
return cfn.validateTemplate({ TemplateBody: JSON.stringify(template) }).promise();
21+
return cfn.send(new ValidateTemplateCommand({ TemplateBody: JSON.stringify(template) }));
2322
});
2423
};

0 commit comments

Comments
 (0)