Monday, April 15, 2024
HomeSoftware EngineeringGet Secret from AWS Secrets and techniques Supervisor in Python

Get Secret from AWS Secrets and techniques Supervisor in Python


You’ll be able to retailer secrets and techniques in AWS Secret Supervisor and reference their ARN in AWS Techniques Secret Supervisor.

The under snippet permits you to specify the related parameter to get the key worth.

import boto3

ssm = boto3.consumer('ssm')
secretsmanager = boto3.consumer('secretsmanager')

parameter = ssm.get_parameter(Title="/your/parameter/title", WithDecryption=True)
secret = secretsmanager.get_secret_value(SecretId=parameter['Parameter']['Value'])
secret = json.masses(secret['SecretString'])

print(secret)
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments