AWS Parameter Store Accessor

What

Check out the code on GitHub

This is a small CLI script written in Golang to pull down all parameters stored in your AWS Parameter Store.

Why

I occasionally save common parameters I use for development in my AWS account and found myself frequently needing to go through the AWS console to get these values. So, I decided to write this script to gain some familiarity with Golang and have a more convenient way of getting the values.

How

The script utilizes the aws-sdk-go package provided by AWS. It simply establishes a connection to AWS and creates a session you can use to access AWS services. It then explicitly connects to the AWS parameter store in whatever region you have set via an environment variable (as described below) and pulls down your parameters. There's certainly a lot of room for improvement, but it does the job for now.

To use

To run the script, you need to set three environment variables:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_REGION

You'll also need to have Go installed on your machine, which you can get from go.dev

With that all set, you can simply run:

go build && ./awssecrets

What's next

Honestly probably nothing, it does what I need it to and I don't have any other use cases at the moment. If I were to continue building this script it'd probably be for the sole purpose of leveling up my Golang skills (which are pretty weak).

It would be cool though to introduce functionality that allowed the user to access more AWS services through this script, but I'd probably be re-inventing the wheel as AWS provides its own CLI which allows you to interact with pretty much everything.

← Back to home