Skip to content

Commit 47c9d6a

Browse files
committed
fix: correctly assume credentials
1 parent 810b6ee commit 47c9d6a

File tree

4 files changed

+20
-25
lines changed

4 files changed

+20
-25
lines changed

index.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,11 @@ class SlsCloudformationResourceCounter {
9393
* Initializes plugin's variables
9494
*/
9595
public initializeVariables(): void {
96-
const credentials = this.serverless.providers.aws.getCredentials();
9796
if (this.serverless.service.custom) {
9897
this.warningThreshold = this.serverless.service.custom.warningThreshold;
9998
}
100-
this.awsRegion = this.serverless.providers.aws.getRegion();
101-
this.cloudformation = new this.serverless.providers.aws.sdk.CloudFormation({
102-
credentials,
103-
region: this.awsRegion,
104-
});
99+
const credentials = this.serverless.providers.aws.getCredentials();
100+
this.cloudformation = new this.serverless.providers.aws.sdk.CloudFormation(credentials);
105101
}
106102

107103
/**

package-lock.json

+16-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-cloudformation-resource-counter",
3-
"version": "0.4.0",
3+
"version": "0.3.0",
44
"description": "A Serverless plugin to count created resources after deployment.",
55
"keywords": [
66
"aws",
@@ -50,7 +50,7 @@
5050
},
5151
"homepage": "https://github.com/drexler/serverless-cloudformation-resource-counter#readme",
5252
"dependencies": {
53-
"aws-sdk": "^2.503.0",
53+
"aws-sdk": "^2.505.0",
5454
"chalk": "^2.4.1"
5555
},
5656
"devDependencies": {

test/unit-tests/index.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ describe('Resource Counter Plugin', () => {
7575

7676
const { credentials, region } = plugin.cloudformation.config;
7777
expect(credentials.accessKeyId).toEqual(testAwsCredentials.accessKeyId);
78-
expect(credentials.secretAccessKey).toEqual(testAwsCredentials.secretAccessKey);
7978
expect(credentials.sessionToken).toEqual(testAwsCredentials.sessionToken);
8079
expect(region).toEqual(testRegion);
8180
});

0 commit comments

Comments
 (0)