Skip to content

Use moto to run functional tests #464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
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