npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nclouds-paramstore

v1.0.3

Published

Retrieve parameters from AWS Parameter Store and sets them as environment variables

Downloads

3

Readme

Add parameter store functionality to your Dockerfile

This repository contain scripts that are used to retrieve parameters from AWS Parameter Store and export them as environment variables.

The repository has the following structure:

  • package.json: Defines dependencies and main script for the node.js app that communicates with the AWS cli to retrieve the parameters from parameter store and stores them in a text file.
  • ssm_get_secrets.js: This script communicates with the AWS cli to retrieve the parameters from parameter store and stores them in a text file. It receives two parameters:
    1. The name of the text file where the parameters will be stored.
    2. The Parameter Store hierarchy from which it will retrieve the parameters.
  • start.sh: Wrapper script to be added as CMD to the Dockerfile in order to retrieve the parameter store script, export the environment variables and then start the service.

Implementation

In order to implement this feature in your docker image follow the next steps:

  1. For each service, create a Dockerfile (if it isn't already created).
  2. Clone the repository inside the container:
git clone [email protected]:k4connect/cloud-parameter-store.git
  1. Modify the entrypoint to something like the following:
ENTRYPOINT [ "/bin/bash", "./cloud-parameter-store/start.sh" ]
  1. Modify or add the CMD as follows:
CMD [ "npm", "start" ]
  1. Verify that the image has installed node.js. If it doesn't, install it using the following commands:
RUN apt-get update -qq && apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs

Be sure to modify the node version to fit your needs. Now you're ready to build the image.

Usage

In order to use this scripts, you'll need the following:

  1. Environment variables: a. DEPLOYMENT_ENVIRONMENT: For example dev, staging or production. This allows to manage different values for the same environment variable across environments. b. SERVICE_NAME: The name of the service that will use this variable, e.g. sso, web or api. This way the scripts will retrieve only the necessary variables for the service to run. c. AWS_DEFAULT_REGION: AWS region. d. AWS_ACCESS_KEY_ID: access key. e. AWS_SECRET_ACCESS_KEY: AWS secret key. Depending on the environment you are running the service on, you can use other methods of authentication to AWS.