Sender Authorizati (truncated...) AuthorizationError (client): User: arn:aws:iam::130996166715:user/SNS_OTP_SENDER is not authorized to perform: SNS:Publish on resource: +821098572027 because no identity-based policy allows the SNS:Publish action - Sender AuthorizationError User: arn:aws:iam::130996166715:user/SNS_OTP_SENDER is not authorized to perform: SNS:Publish on resource: +821011111111 because no identity-based policy allows the SNS:Publish action f860dafb-d277-5f3f-b278-842cfefbd629 "> Sender Authorizati (truncated...) AuthorizationError (client): User: arn:aws:iam::130996166715:user/SNS_OTP_SENDER is not authorized to perform: SNS:Publish on resource: +821098572027 because no identity-based policy allows the SNS:Publish action - Sender AuthorizationError User: arn:aws:iam::130996166715:user/SNS_OTP_SENDER is not authorized to perform: SNS:Publish on resource: +821011111111 because no identity-based policy allows the SNS:Publish action f860dafb-d277-5f3f-b278-842cfefbd629 "> Sender Authorizati (truncated...) AuthorizationError (client): User: arn:aws:iam::130996166715:user/SNS_OTP_SENDER is not authorized to perform: SNS:Publish on resource: +821098572027 because no identity-based policy allows the SNS:Publish action - Sender AuthorizationError User: arn:aws:iam::130996166715:user/SNS_OTP_SENDER is not authorized to perform: SNS:Publish on resource: +821011111111 because no identity-based policy allows the SNS:Publish action f860dafb-d277-5f3f-b278-842cfefbd629 ">
Error executing "Publish" on "<https://sns.eu-west-1.amazonaws.com>"; AWS HTTP error: Client error: `POST <https://sns.eu-west-1.amazonaws.com`> resulted in a `403 Forbidden` response:
<ErrorResponse xmlns="<http://sns.amazonaws.com/doc/2010-03-31/>">
  <Error>
    <Type>Sender</Type>
    <Code>Authorizati (truncated...)
 AuthorizationError (client): User: arn:aws:iam::130996166715:user/SNS_OTP_SENDER is not authorized to perform: SNS:Publish on resource: +821098572027 because no identity-based policy allows the SNS:Publish action - <ErrorResponse xmlns="<http://sns.amazonaws.com/doc/2010-03-31/>">
  <Error>
    <Type>Sender</Type>
    <Code>AuthorizationError</Code>
    <Message>User: arn:aws:iam::130996166715:user/SNS_OTP_SENDER is not authorized to perform: SNS:Publish on resource: +821011111111 because no identity-based policy allows the SNS:Publish action</Message>
  </Error>
  <RequestId>f860dafb-d277-5f3f-b278-842cfefbd629</RequestId>
</ErrorResponse>

AWS SNS(Simple Notification Service)를 사용하여 메시지를 발행할 때 발생한 권한 문제입니다. SNS_OTP_SENDER 사용자는 SNS 작업을 수행할 권한이 없기 때문에 권한 오류가 발생하였습니다.

해결하기 위해서는 해당 사용자에게 SNS 작업을 수행할 수 있는 권한을 부여해야 합니다.

이를 위해 IAM(Identity and Access Management)에서 해당 사용자에 대한 정책을 수정하여 SNS 작업을 허용하는 인라인 정책을 추가하거나, 사용자가 속한 그룹에 대한 정책을 수정하여 SNS 작업을 허용할 수 있습니다.

저는 인라인 정책을 추가해보도록 하겠습니다.

Untitled

먼저 IAM 서비스를 통합검색으로 찾습니다.

Untitled

SNS_OTP_SENDER 사용자를 선택합니다.

Untitled

SourceIP를 허용하려는 IP주소를 설정합니다. 배열이기 때문에 여러개의 허용 IP를 설정할수 있습니다.

Untitled

요청조건에 추가한 IP가 작성되어 있는지 확인하고 변경 사항을 저장합니다.

Untitled

Untitled

정상적으로 메시지가 온것을 확인할수 있습니다.