aghadiry / serverless-cloudfront-invalidate

Serverless plugin that allows you to invalidate Cloudfront Cache
MIT License
29 stars 22 forks source link

Fix reference to AWS Credentials loaded from serverless config #18

Closed solgarius closed 4 years ago

solgarius commented 4 years ago

now supported for different versions of AWS SDK/serverless framework. Fix for #17

coyoteecd commented 4 years ago

@solgarius Another way to fix this is to change the plugin to use AwsProvider.request() function instead of instantiating AWS.CloudFormation directly. This way you'd be using the same mechanism as Serverless to interact with the AWS SDK, including handling of credentials,

solgarius commented 4 years ago

@coyoteecd Good point. I've reworked the plugin so that it now uses the aws provider using getProvider('aws'). Thanks for the suggestion.

williamsandonz commented 4 years ago

Can we please merge this ASAP @aghadiry ? This is currently broken for me. In master branch, there are no exceptions thrown when awsCredentials.credentials is empty and the AWS requests hang. Basically all the awsCredentials.credentials references should be awsCredentials, this is using the latest serverless version and aws-sdk ^2.700.0.