amplify-education / serverless-vpc-discovery

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

VPC discovery errors after upgrading to 5.0.0 #81

Closed umulmrum closed 8 months ago

umulmrum commented 8 months ago

Hi,

first of all, thank you for your work on this lib!

In my team we encountered a problem with VPC discovery after upgrading from 4.1.0 to 5.0.0, which led to lambdas no longer being able to access our database in the production system.

The following messages were displayed during serverless deploy:

Function 'MyLambda' VPC not configured based on the error: UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:sts::[] is not authorized to perform: ec2:DescribeVpcs because no identity-based policy allows the ec2:DescribeVpcs action

Unfortunately the deployment kept on running, leading to a non-functional state on AWS. So another suggestion/plea is to fail in case an error occurs, so that running applications are not affected.

Thank you for your support. Let me know if I can provide further details.

rddimon commented 8 months ago

Hi @umulmrum

Could you please try the 5.0.1 version and let us know if is it fixed or not for you?

umulmrum commented 8 months ago

@rddimon I'm afraid the same error still occurs.

Thanks for your efforts though :-)

rddimon commented 8 months ago

Does it work for you with the 4.x versions? How are the AWS credentials configured?

From the message error User: arn:aws:sts::[] is not authorized to perform: ec2:DescribeVpcs it could be 2 problems:

  1. Plugin credentials are not set properly
  2. Your AWS credentials are not allowing DescribeVpcs

Place make sure the AWS policy is configured properly for the plugin.

jvollmuller-risk commented 8 months ago

Got the same Error, did not change anything in my AWS credentials file. After downgrading to for example: 3.1.2 error immediately disappeared.

rddimon commented 8 months ago

Hi @umulmrum @jvollmuller-risk

Could you please try 5.0.2 and let us know if the issue is fixed for you?

umulmrum commented 8 months ago

@rddimon Works, thank you! :tada: