From 1e10765d59b787ba8a5eabb0e33fe117744d6fdb Mon Sep 17 00:00:00 2001 From: rddimon Date: Wed, 24 Jan 2024 16:31:54 +0200 Subject: [PATCH 1/2] Fixed EC2Client initialization --- CHANGELOG.md | 6 ++++++ package.json | 2 +- src/aws/ec2-wrapper.ts | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3b99d3..fe83e52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [5.0.2] - 2024-01-19 + +### Fixed + +- Fixed EC2 client credentials initialization + ## [5.0.1] - 2024-01-19 ### Changed diff --git a/package.json b/package.json index c5946ad..5f87f2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "serverless-vpc-discovery", - "version": "5.0.1", + "version": "5.0.2", "engines": { "node": ">=14" }, diff --git a/src/aws/ec2-wrapper.ts b/src/aws/ec2-wrapper.ts index ddabe10..3b1f045 100644 --- a/src/aws/ec2-wrapper.ts +++ b/src/aws/ec2-wrapper.ts @@ -12,11 +12,11 @@ export class EC2Wrapper { public ec2: EC2Client constructor (credentials: any) { - this.ec2 = new EC2Client([{ + this.ec2 = new EC2Client({ credentials, region: Globals.getRegion(), retryStrategy: Globals.getRetryStrategy() - }]); + }); } /** @@ -24,6 +24,7 @@ export class EC2Wrapper { * @returns {Promise.} */ public async getVpcs (): Promise { + console.log(await this.ec2.config.region()); return await getAWSPagedResults( this.ec2, "Vpcs", From e3ffd5cfd48733624d3216e298cae4ab2473367e Mon Sep 17 00:00:00 2001 From: rddimon Date: Wed, 24 Jan 2024 16:32:57 +0200 Subject: [PATCH 2/2] remove debug line --- src/aws/ec2-wrapper.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/aws/ec2-wrapper.ts b/src/aws/ec2-wrapper.ts index 3b1f045..4ff68c1 100644 --- a/src/aws/ec2-wrapper.ts +++ b/src/aws/ec2-wrapper.ts @@ -24,7 +24,6 @@ export class EC2Wrapper { * @returns {Promise.} */ public async getVpcs (): Promise { - console.log(await this.ec2.config.region()); return await getAWSPagedResults( this.ec2, "Vpcs",