

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# @InjectKeywordedSecretString
<a name="retrieving-secrets_cache-decor-keyword"></a>

이 데코레이터는 첫 번째와 두 번째 인수로 보안 암호 ID 문자열과 [SecretCache](retrieving-secrets_cache-ref-secretcache.md)을(를) 기대합니다. 나머지 인수는 래핑된 함수의 파라미터를 보안 암호의 JSON 키로 매핑합니다. 보안 암호에는 JSON 구조의 문자열이 포함되어야 합니다.

이 JSON이 포함된 보안 암호의 경우:

```
{
  "username": "{{saanvi}}",
  "password": "{{EXAMPLE-PASSWORD}}"
}
```

다음 예에서는 보안 암호에서 `username`과 `password`에 대한 JSON 값을 추출하는 방법을 보여줍니다.

```
from aws_secretsmanager_caching import SecretCache 
  from aws_secretsmanager_caching import InjectKeywordedSecretString,  InjectSecretString 
  
  cache = SecretCache()
  
  @InjectKeywordedSecretString ( secret_id = '{{mysecret}}' ,  cache = cache ,  func_username = 'username' ,  func_password = 'password' ) 
  def {{function_to_be_decorated}}( func_username,  func_password):
       print( 'Do something with the func_username and func_password parameters')
```