amplify-education / serverless-vpc-discovery

Serverless plugin for discovering VPC / Subnet / Security Group configuration by name.
MIT License
38 stars 15 forks source link

Doesn't work behind corporate proxy #33

Closed corydorning53 closed 3 years ago

corydorning53 commented 4 years ago

The fix is pretty straightforward and I'm happy to create a PR assuming it will be merged. Instead of using the aws-sdk to create the ec2 instance, it should be done via the serverless aws-sdk.

In updateVpcConfig() instead of having this:

const awsCreds = this.serverless.providers.aws.getCredentials();
awsCreds.region = this.serverless.providers.aws.getRegion();

AWS.config.update(awsCreds);
AWS.config.update({
  maxRetries: 20,
});

this.ec2 = new AWS.EC2();

it should be this:

this.ec2 = new this.serverless.providers.aws.sdk.EC2({
  maxRetries: 20,
  region: this.serverless.providers.aws.getRegion()
});
corydorning53 commented 4 years ago

This would also allow the removal of the aws-sdk dependency.

rddimon commented 3 years ago

@corydorning53 Could you please try the latest version?

rddimon commented 3 years ago

It has been fixed in version 2.0.0

corydorning commented 3 years ago

Happy to give this a go, but still need pr #19 and #30 for my use case.

Excellent work though. Glad to see this revived.

rddimon commented 3 years ago

@corydorning We are working on new features in this PR Going to release it by the end of this week