

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# @InjectSecretString
<a name="retrieving-secrets_cache-decor-string"></a>

此装饰器需要一个密钥 ID 字符串和 [SecretCache](retrieving-secrets_cache-ref-secretcache.md) 作为前两个参数。该装饰器将返回密钥字符串值。密钥必须包含一个字符串。

```
from aws_secretsmanager_caching import SecretCache 
from aws_secretsmanager_caching import InjectKeywordedSecretString,  InjectSecretString 

cache = SecretCache()

@InjectSecretString ( 'mysecret' ,  cache ) 
def function_to_be_decorated( arg1,  arg2,  arg3):
```