구조

Untitled

lambda test

exports.handler = async (event) => {
  // const response = {
  //   statusCode: 200,
  //   body: JSON.stringify('Hello from Lambda!'),
  // };
  console.log(event.text)
  return event.text;
};

API Gateway 설정

Untitled

URL 호출 주소 (스프링 부트에서 해당 주소를 요청하면 API gateway 로 요청됨)

https://8n4eynhw2h.execute-api.ap-northeast-1.amazonaws.com/prod


springboot 호출 예시 (백엔드에서 api gateway 호출하는 방법)

 String triggerUrl = "[<https://8n4eynhw2h.execute-api.ap-northeast-1.amazonaws.com/prod>](<https://8n4eynhw2h.execute-api.ap-northeast-1.amazonaws.com/prod>)/notifications/approvals";
 RestTemplate restTemplate = new RestTemplate();
 restTemplate.postForEntity(triggerUrl, null, String.class);
  1. 가입 승인 로직 구현 시 게이트 웨이 호출하기
  2. 호출 시 어떤 정보를 보내줘야 하는지
  3. 해당 함수 호출 시 람다가 sns 메시지 요청 및 반환