Skip to content

A CLI that can get/set more than 10 SSM Parameters by path in a single command.

License

Notifications You must be signed in to change notification settings

unfor19/parzival

Repository files navigation

parzival

release-workflow release pre-release

A CLI that can get/set more than 10 SSM Parameters by path in a single command.

I wrote this project to solve the challenge of managing high number of SSM parameter values. I'll soon publish a blog post about the subject, meanwhile, you can check my unfor19/terraform-aws-ssm-parameters Terraform module. The Terraform module is used for creating/delete (schema) SSM Parameters, and this project, parzival, is used for managing the values of SSM Parameters.

Getting Started

  1. Download the binary file from the releases page, for example 0.0.3
    • macOS - Intel chips
    PARZIVAL_OS="darwin" && \
    PARZIVAL_ARCH="amd64" && \
    PARZIVAL_VERSION="0.0.3" && \
    curl -sL -o parzival "https://github.com/unfor19/parzival/releases/download/${PARZIVAL_VERSION}/parzival_${PARZIVAL_VERSION}_${PARZIVAL_OS}_${PARZIVAL_ARCH}"
    • macOS - M1 chips
    PARZIVAL_OS="darwin" && \
    PARZIVAL_ARCH="arm64" && \
    PARZIVAL_VERSION="0.0.3" && \
    curl -sL -o parzival "https://github.com/unfor19/parzival/releases/download/${PARZIVAL_VERSION}/parzival_${PARZIVAL_VERSION}_${PARZIVAL_OS}_${PARZIVAL_ARCH}"
    • Linux - amd64
    PARZIVAL_OS="linux" && \
    PARZIVAL_ARCH="amd64" && \
    PARZIVAL_VERSION="0.0.3" && \
    curl -sL -o parzival "https://github.com/unfor19/parzival/releases/download/${PARZIVAL_VERSION}/parzival_${PARZIVAL_VERSION}_${PARZIVAL_OS}_${PARZIVAL_ARCH}"
    PARZIVAL_OS="linux" && \
    PARZIVAL_ARCH="386" && \    
    PARZIVAL_VERSION="0.0.3" && \
    curl -sL -o parzival "https://github.com/unfor19/parzival/releases/download/${PARZIVAL_VERSION}/parzival_${PARZIVAL_VERSION}_${PARZIVAL_OS}_${PARZIVAL_ARCH}"
  2. Set permissions to allow execution of parzival binary and move to /usr/local/bin dir
    chmod +x parzival && \
    sudo mv parzival "/usr/local/bin/parzival"
  3. Get SSM Parameters by path
    parzival get --region "us-east-1" \
         --output-file-path ".dev_parameters.json" \
         --parameters-path "/myapp/dev/"
  4. Set SSM Parameters according to the output of Get
    parzival set --region "us-east-1" \
         --input-file-path ".dev_parameters.json" \
         --prefix-to-replace "/myapp/dev/" \
         --parameters-path "/myapp/stg/"

Local Development

Expand/Collapse

For local development, we'll use the following services

  • localstack - A fully functional local cloud (AWS) stack

Requirements

Development Process

Initial Setup For Golang

  1. Place the source code at $HOME/go/src/github.com/unfor19/parzival

  2. Add the following to ${HOME}/.bash_profile or ${HOME}/.bashrc

    export GOPATH=$HOME/go
    export GOROOT=/usr/local/opt/go/libexec
    export PATH=$PATH:$GOPATH/bin:$GOROOT/bin

Run

make up-localstack && \
    go run . get --localstack

Build

make build

Test

make test

Skip SSM Parameter creation by setting before running tests

export SKIP_PARAM_CREATION="true" && \
make test

Authors

Created and maintained by Meir Gabay

License

This project is licensed under the Apache License - see the LICENSE file for details