The securitytoken included in the request is expired가 될 때의 대응 방법
4568 단어 SecretsManagerAWS
이벤트: Secrets Manager에서 기밀 정보를 가져오려다가 혼났습니다.
얻은 코드는 아주 친절하게 비밀 값을 설정했을 때 표시되기 때문에 기본적으로 복사하고 붙여넣는 데 쓰인다...
ExpiredTokenException
def get_backlog_api_key():
secret_name = 'シークレットの名前'
session = boto3.session.Session()
client = session.client(
service_name='secretsmanager',
region_name='リージョン'
)
try:
get_secret_value_response = client.get_secret_value(
SecretId=secret_name
)
except ClientError as e:
print(e.response['Error'])
raise e
else:
if 'SecretString' in get_secret_value_response:
secret = get_secret_value_response['SecretString']
else:
decoded_binary_secret = base64.b64decode(get_secret_value_response['SecretBinary'])
{'Message': 'The security token included in the request is expired', 'Code': 'ExpiredTokenException'}
이유: Lambda에 대한 권한이 없습니다.
권한의 존재를 잊어버렸다.
Minimum permissions
To run this command, you must have the following permissions:
secretsmanager:GetSecretValue
GetSecretValue - AWS Secrets Manager
해당: 권한 부여
secretsmanager
SecretManagerReadWrite 검사>[정책 첨부] 버튼을 통해 권한 추가Reference
이 문제에 관하여(The securitytoken included in the request is expired가 될 때의 대응 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/ponsuke0531/items/c5c415f71796bb1d2d66텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)