Skip to content

Commit

Permalink
Merge pull request #369 from amdonov/custom-ec2-endpoint
Browse files Browse the repository at this point in the history
enable users to set ec2-endpoint for nonstandard regions
  • Loading branch information
Cheng Pan authored Sep 15, 2019
2 parents e9a3017 + 6f8e3b4 commit e4569c3
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 e4569c3

Please sign in to comment.