Thiago's Space Blog

Just another blog, this one about my learnings as I join the Space Industry as a software engineer.

View on GitHub
15 January 2022

Expose Grpc

Expose the gRPC service at api.thiago.pub:8080

Finally, we are now able to access the gRPC service in our example code via api.thiago.pub:8080!

> grpcurl \
    -d '{"message": "greetings grpcurl"}' \
    api.thiago.pub:8080 \
    grpc_example_proto.Unary/GetServerResponse

{
  "message": "Hello I am up and running received \"greetings grpcurl\" message from you",
  "received": true
}

In order to enable that, I had to create an HTTPS listener for the Application Load Balancer, which required creating a new ACM certificate for the subdomain.

AWS makes it easy to validate the certificate using DNS, as long as your domain is managed via Route 53.

After that is done, you’ll need a new Target Group using Protocol Version gRPC. Note that, again, I hacked the Target Group health checking, configuring it to accept any gRPC status codes (including 12 for UNIMPLEMENTED). I should really configure this properly since our example code now supports gRPC Health Checks, but I’ll leave that for some other day.

After that, connect the Application Load Balancer to the Target Group…

and configure the Certificate.

Voilà! To be honest, this was a bit more difficult than you might imagine by reading the explanation above. I definitely hit some snags along the way, but I feel like I learned a TON getting it to work. This was a really helpful doc I consulted - thank you to the author!

Next up: forking the gRPC example code into a new repository that I’ll use to implement a useful (or at least interesting) Space-related set of APIs!