Git Product home page Git Product logo

aws-secrets-fetcher's Introduction

aws-secrets-fetcher

git clone https://github.com/sreehariskumar/aws-secrets-fetcher.git
cd aws-secrets-fetcher/
chmod +x aws-secrets-fetcher.sh
./aws-secrets-fetcher.sh

This script does the following tasks:

  • It sets three variables: your_secret_name, your_secret_region, and your_password_key, which should be replaced with actual values.

  • It detects the operating system running on the machine and assigns a value to the OS variable accordingly. Here's how it works:

The if statement checks if the output of the uname -s command is equal to "Linux". If it is, that means the script is running on a Linux system. If it isn't, the script prints an error message and exits.

If the script is running on a Linux system, the if statement checks if the /etc/os-release file contains the string "Ubuntu". If it does, the script assigns the value "ubuntu" to the OS variable. If it doesn't, the elif statement checks if the file contains the string "CentOS". If it does, the script assigns the value "centos" to the OS variable. If neither string is found, the else statement prints an error message and exits.

  • It installs the required packages based on the detected OS. If the OS is Ubuntu, the script uses apt-get to update the package cache and install the jq, unzip, and curl packages. If the OS is CentOS, the script uses yum to update the package cache and install the same packages.

  • It downloads and installs the AWS CLI tool.

  • It fetches a secret from the AWS Secrets Manager by calling the aws secretsmanager get-secret-value command with the --secret-id and --region options set to the values of the your_secret_name and your_secret_region variables, respectively. It then pipes the output through several commands to filter out the desired password value from the JSON response.

Follow this document to configure AWS CLI.

Note that in order to use this script, you will need to replace the placeholder values for the your_secret_name, your_secret_region, and your_password_key variables with the actual values for your AWS Secrets Manager secret.

aws-secrets-fetcher's People

Contributors

sreehariskumar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.