48 days ago · Tech · hide · Fediverse post

I'm currently in the process of moving my site's media (under media.jvt.me) from Netlify to AWS S3. The underlying infrastructure for my site that writes this media is hosted on Fly.io, so needs a way to write to S3. I really wanted to avoid long-lived AWS credentials, and fortunately Fly supports OpenID Connect which integrates with AWS' OpenID Connect Federation to allow you to use short-lived OpenID Connect tokens to authenticate as a given IAM role, and then perform any necessary AWS actions. Although Fly has an example with curl, I wanted to blogument the "how to" with Go, as it wasn't super straightforward to do so. I've written this up in a sample repo on GitLab.com. Go code The core pieces are: // via https://gist.github.com/teknoraver/5ffacb8757330715bcbcc90e6d46ac74 var unixClient = http.Client{ Transport: &http.Transport{ DialContext: func(_ context.Context, _, _ string) (net.Conn, error) { return net.Dial("unix", "/.fly/api") }, }, } func getOIDCToken(unixClient…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town