milliHQ/terraform-aws-next-js

Error: Authentication Failed Returns Status Code 0

larahroth opened this issue · 0 comments

Hello,

We are deploying via a bash script calling npx tf-next deploy --endpoint ${OUR ENDPOINT HERE}. Should our credentials not be set, or any other reason, the return status code is 0. This is the same behavior upon success.

Creds Set:

./deploy.sh         
+ npx tf-next deploy --endpoint https://**.execute-api.us-east-1.amazonaws.com
milliVolt CLI 1.0.0-canary.5

success Deployment package uploaded
success Deployment ready
> Available at: *** (copied to clipboard) 
+ echo return code: 0
return code: 0

Creds Not Set:

./deploy.sh                   
+ npx tf-next deploy --endpoint https://**.execute-api.us-east-1.amazonaws.com
milliVolt CLI 1.0.0-canary.5

Error: Authentication failed.
Make sure that the AWS user has the correct permissions.
Could not upload deployment package.
+ echo return code: 0
return code: 0

This has caused a bit of upset with our CI/CD integration and took time to debug. Is there any way to return a different status code on Authentication Failed?

Thank you in advance :D