Getting Connection Refused Using HttpGet Method In Terratest Using Github Runner

I’m getting an error (connection refused) with HttpGet method when testing using Terratest on Github runner, however when running same testing code on my local machine it passes with no issues.

The url generated by the code is reachable without any issues and even the resolved IP with the correct port 80 is working! what could be the issue here? I believe port 80 should be open on the runner since it can fetch packages over http port.

Github Actions Error

2021/10/26 08:26:55 Get "http://xxxx-EPAJpE-12249xxxxx.us-west-1.elb.amazonaws.com": dial tcp 184.169.xxx.x:80: connect: connection refused
exit status 1

Terratest Code

package test

import (
...
)
    url := fmt.Sprintf("http://%s", albDNS)

    resp, err := http.Get(url)
    if err != nil {
        log.Fatalln(err)
    }

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        log.Fatalln(err)
    }

    sb := string(body)
    log.Printf(sb)

    assert.Equal(f, actualPublicIP_1, exptectedPublicIP_1)
    assert.Equal(f, actualPublicIP_2, exptectedPublicIP_2)
    assert.Equal(f, expectedBucketID, actualBucketId)
    assert.Contains(f, sb, "Hello EX!")

}


amazon-web-servicesterraformgithub-actions