Skip to content

Commit

Permalink
Enable AWS ENV VAR key auth
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
  • Loading branch information
ArangoGutierrez committed Feb 13, 2024
1 parent 5611b08 commit 8d9ac35
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/provider/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ type Client struct {

func New(log *logger.FunLogger, env v1alpha1.Environment, cacheFile string) (*Client, error) {
// Create an AWS session and configure the EC2 client
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion(env.Spec.Region))
region := env.Spec.Region
if envRegion := os.Getenv("AWS_REGION"); envRegion != "" {
region = envRegion
}
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion(region))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 8d9ac35

Please sign in to comment.