Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning when no credentials found. #159

Merged
merged 1 commit into from Oct 8, 2017

Conversation

m5
Copy link
Contributor

@m5 m5 commented Oct 5, 2017

On a machine with no AWS credentials configured, each execution takes an additional 20 seconds to complete. This time is spent waiting for the connection to 169.254.169.254 to time out.

I believe this is the cause of issue #134

If aws-sam-local is rarely run on an ec2 instance, it may be better to disable the EC2RoleProvider by default.

env.go Outdated
if creds, err := sess.Config.Credentials.Get(); err == nil {
creds, err := sess.Config.Credentials.Get()
if err != nil {
log.Printf("WARNING: No AWS credentials found. Configure credentials to speed execution.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you be a bit more verbose here to say "Missing credentials may lead to low startup times as detailed in #134"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. Hopefully this is what you had in mind.

Copy link
Contributor

@sanathkr sanathkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this change! Ideally we will find a way to reduce the client timeout, but in the meanwhile this is a good start. I have a quick feedback

@m5 m5 force-pushed the credential-failure-warning branch from 60df459 to ceda0ed Compare October 5, 2017 17:04
…a very long time to fail.

Change copy as suggested by @sanathkr
@m5 m5 force-pushed the credential-failure-warning branch from ceda0ed to a670f47 Compare October 5, 2017 17:15
Copy link
Contributor

@sanathkr sanathkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants