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

Added check for existing aws account before warning #872

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

commit111
Copy link
Collaborator

@commit111 commit111 commented Nov 19, 2024

Description

Added a check to see if AWS credentials can be found in config (not whether they are valid) before printing the warning that "AWS environment variables are not set"

Linked Issues

Fixes #850

Checklist

  • I have performed a self-review of my code
  • I have added appropriate tests
  • I have updated the Defang CLI docs and/or README to reflect my changes, if necessary

@commit111 commit111 marked this pull request as ready for review November 19, 2024 21:57
@@ -1113,7 +1114,7 @@ func getProvider(ctx context.Context, loader *compose.Loader) (cliClient.Provide
providerID = cliClient.ProviderDefang
}
case cliClient.ProviderAWS:
if !awsInEnv() {
if !awsInEnv() && !awsInConfig(ctx) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need awsInEnv()? I bet awsInConfig() covers that too.

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.

CLI warns "AWS environment variables are not set" when using default profile
2 participants