Skip to content

Commit

Permalink
enable users to set ec2-endpoint for nonstandard regions
Browse files Browse the repository at this point in the history
  • Loading branch information
amdonov committed Sep 11, 2019
1 parent ad0e4f5 commit 6f8e3b4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cloud/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"errors"
"fmt"
"os"
"time"

"github.com/aws/aws-sdk-go/aws"
Expand Down Expand Up @@ -224,6 +225,11 @@ func newEC2Cloud(metadata MetadataService, svc *ec2metadata.EC2Metadata) (Cloud,
CredentialsChainVerboseErrors: aws.Bool(true),
}

endpoint := os.Getenv("AWS_EC2_ENDPOINT")
if endpoint != "" {
awsConfig.Endpoint = aws.String(endpoint)
}

return &cloud{
metadata: metadata,
dm: dm.NewDeviceManager(),
Expand Down

0 comments on commit 6f8e3b4

Please sign in to comment.