本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
@InjectSecretString
此装饰器需要一个密钥 ID 字符串和 SecretCache 作为前两个参数。该装饰器将返回密钥字符串值。密钥必须包含一个字符串。
from aws_secretsmanager_caching import SecretCache from aws_secretsmanager_caching import InjectKeywordedSecretString, InjectSecretString cache = SecretCache() @InjectSecretString ( '
mysecret
' , cache ) deffunction_to_be_decorated
( arg1, arg2, arg3):