GithubHelp home page GithubHelp logo

isabella232 / terraform-aws-secretsmanager-data Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sailthru/terraform-aws-secretsmanager-data

0.0 0.0 0.0 10 KB

License: Apache License 2.0

HCL 100.00%

terraform-aws-secretsmanager-data's Introduction

Terraform module that returns a map form AWS Secrets Manager JSON string

Terraform module which is used for reading a JSON secret form the AWS Secrets Manager and returning a map that can be used in plans

Usage

Secrets in JSON

/tmp/dev.json

{
  "docker_hub_user" : "foo",
  "docker_hub_pass" : "dragons"
}

Create AWS secrets manager secret with the JSON string

aws secretsmanager create-secret \
  --name DevEnv \
  --description "Secrets for DEV environment" \
  --secret-string file:///tmp/dev.json

Use secrets in a Terraform plan

module "aws_dev_secrets" {
  source  = "sailthru/secretsmanager-data/aws"
  secret_id = "DevEnv"
}

locals {
  docker_hub_user = "${module.aws_dev_secrets.secret_map["docker_hub_user"]}"
  docker_hub_pass = "${module.aws_dev_secrets.secret_map["docker_hub_pass"]}"
}

output "docker_hub_user" {
  value = "${local.docker_hub_user"]}"
}

Inputs

Name Description Type Default Required
aws_region AWS region to use string us-east-1 no
aws_profile AWS credentials profile to use string `` no
secret_id Specifies the secret containing the version that you want to retrieve. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret. string - yes
version_id Specifies the unique identifier of the version of the secret that you want to retrieve. Overrides version_stage string `` no
version_stages Specifies the secret version that you want to retrieve by the staging label attached to the version. Defaults to AWSCURRENT string AWSCURRENT no

terraform-aws-secretsmanager-data's People

Contributors

bezerker avatar jcarr-sailthru avatar jnichols3 avatar tlipatov 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.