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)