Skip to content

Commit

Permalink
add Dockerfile and log message
Browse files Browse the repository at this point in the history
  • Loading branch information
leneffets committed Nov 14, 2024
1 parent 5acc600 commit 9785c18
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM golang AS builder
WORKDIR /app
COPY . .
RUN CGO_ENABLED=0 go build -ldflags '-extldflags "-static"' -o ./output/ssmserver ./cmd/server

FROM alpine
COPY --from=builder /app/output/ssmserver /usr/local/bin/ssmserver
EXPOSE 3000
ENTRYPOINT ["/usr/local/bin/ssmserver"]
7 changes: 7 additions & 0 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ func main() {

svc := ssm.New(sess)

creds, err := sess.Config.Credentials.Get()
if err != nil {
log.Fatalf("Failed to get credentials: %v", err)
}
log.Printf("Using credentials: %s/%s\n", creds.AccessKeyID, creds.SecretAccessKey)


http.HandleFunc("/ssm", func(w http.ResponseWriter, r *http.Request) {
// Validate input parameter
id := r.URL.Query().Get("name")
Expand Down

0 comments on commit 9785c18

Please sign in to comment.