File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments