View info about AWS AMIs in Go

Mitch Turner
Aug 22, 2017 · 1 min read

This is a very short example showing how to interact with the AWS API via the AWS SDK for Go to find out details for a given AMI(Amazon Machine Image).

All of the code is on GitHub.

The first step is to get an AWS API Session, I have defined a helper function for my other projects to allow me to write less code while changing between regions. This function is not needed but it can reduce the clutter in main().

getSessionForRegion

Once you have a session struct you can setup your API client as follows

The result variable contains details about that AMI that you can use later.

The full code can be seen here

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade