diff --git a/pkg/cloud/cloud.go b/pkg/cloud/cloud.go index 155d627274..ba5d53dacb 100644 --- a/pkg/cloud/cloud.go +++ b/pkg/cloud/cloud.go @@ -20,6 +20,7 @@ import ( "context" "errors" "fmt" + "os" "time" "github.com/aws/aws-sdk-go/aws" @@ -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(),