Skip to content

Commit cb49991

Browse files
committed
Fixing chores
1 parent 5100c2d commit cb49991

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/e2e/utils/utils.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,8 +1649,18 @@ func CreateRoute53Client() (*route53.Route53, error) {
16491649
return nil, fmt.Errorf("AWS credentials not found in environment variables")
16501650
}
16511651

1652+
// Get AWS region from environment variables
1653+
// Check AWS_REGION first, then AWS_DEFAULT_REGION
1654+
region := os.Getenv("AWS_REGION")
1655+
if region == "" {
1656+
region = os.Getenv("AWS_DEFAULT_REGION")
1657+
}
1658+
if region == "" {
1659+
return nil, fmt.Errorf("AWS region not found in environment variables (AWS_REGION or AWS_DEFAULT_REGION)")
1660+
}
1661+
16521662
sess, err := session.NewSession(&aws.Config{
1653-
Region: aws.String("us-east-1"), // Route53 is global, but SDK needs a region
1663+
Region: aws.String(region),
16541664
Credentials: credentials.NewStaticCredentials(
16551665
awsAccessKey,
16561666
awsSecretKey,

0 commit comments

Comments
 (0)