Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion core/connections.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,20 @@ type connections struct {

func (c *connections) setSession(region string) {
c.session = session.Must(
session.NewSession(&aws.Config{Region: aws.String(region)}))
session.NewSession(&aws.Config{
Region: aws.String(region),
Endpoint: aws.String(os.Getenv("AWS_ENDPOINT_URL")),
}))
}

func (c *connections) connect(region, mainRegion string) {
// When using custom Endpoint Url, to avoid unwanted additional costs, enforce ALL AWS login/security variables.
if len(os.Getenv("AWS_ENDPOINT_URL")) > 0 {
os.Setenv("AWS_ACCESS_KEY_ID", "fake_testing_key")
os.Setenv("AWS_SECRET_ACCESS_KEY", "fake_testing_key")
os.Setenv("AWS_SECURITY_TOKEN", "fake_testing_key")
os.Setenv("AWS_SESSION_TOKEN", "fake_testing_key")
}

debug.Println("Creating service connections in", region)

Expand Down