ThomasRones
ThomasRones

Reputation: 683

Deploy Simple Go Webapp to Elastic Beanstalk

I am trying to deploy a Go app to Elastic beanstalk (through the UI)

What I've done:

For development I'm using go version go1.18.1 windows/amd64

Under Platform in Elastic Beanstalk I see: Go 1 running on 64bit Amazon Linux 2/3.5.1

According to https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html#platforms-supported.go go v. 1.18.1 is supported

My Code:

package main
import (
    "fmt"
    "net/http"
    "time"
)
func main() {
    http.HandleFunc("/", index)
    fmt.Println("Now serving!!!")
    http.ListenAndServe(":5000", nil)
}
func index(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "My Res !!! %s", time.Now())
}

The Application health is "no data".

With the most recent event of "Environment health has transitioned from Pending to No Data. None of the instances are sending data."

When I look in chrome dev tools and try to open the link, I just get (failed) net:ERR_CONNECTION_RESET. "Failed to load response data: No Resource with given identifier found"

Potential Issues:

Some Potential Next Steps:

Upvotes: 2

Views: 575

Answers (1)

Marcin
Marcin

Reputation: 238397

I tried to replicate your issue using your code, but everything is fine. My EB environment works and deploys perfectly with your code.

The only thing I can think of is that I used linux to create my binary, while you've used windows/amd64. I don't think those binaries are interchangeable.

Upvotes: 1

Related Questions