daroczig / botor

Reticulate wrapper on 'boto3' with convenient helper functions -- aka "boto fo(u)r R"
https://daroczig.github.io/botor
31 stars 5 forks source link

Add Helper Fn for AWS Secrets Manager #11

Closed amy17519 closed 4 years ago

amy17519 commented 4 years ago

library(botor) currently has ssm_get_parameter, which can retrieve from both AWS Parameter Store and Secrets Manager (if you know all the details to make that happen)

I wrote two helper fns ssm_get_secrets() and sm_get_secrets() for retrieving secrets in AWS Secrets Manager. Users can specify their secrets in two formats: xx_get_secrets(path = 'your/secret/key') xx_get_secrets(path = 'your/secret', key = key)

  1. ssm_get_secrets() uses botocore.client.SSM

Complexities:

  1. sm_get_secrets() uses botocore.client.secretsmanager. Function and AWS permission would be cleaner. The only downside is that we need to add more functions

@daroczig

UPDATE (May 21, 2020): Decide to only add sm_get_secrets() for retrieving secrets from AWS Secret Manager. The function supports retrieving value from json-structured secrets by a key or a vector of keys. Users can also get secrets in raw format (useful when secrets are not json or you simply want unparsed output)

daroczig commented 4 years ago

This is really cool, @amy17519 -- thanks a lot :bowing_man:

Added some comments above, please let's discuss before merging.