암호 이메일 재설정을 트리거하는 엔드 포인트에 https 요청을 보내는 AWS 람다를 작성했습니다. 로컬로 람다를 실행하면 예상대로 실행되고받은 편지함에 전자 메일이 도착하지만 노드 코드를 업로드하고 AWS 콘솔에서 람다를 실행할 때 게시 요청을 할 때 다음 오류가 발생합니다 :AWS 람다 오류로 노드 https 요청
Error: getaddrinfo ENOTFOUND myfakedomain.com myfakedomain.com:443
합니다 (슈퍼 에이전트 노드 모듈 사용) HTTPS 요청을 내 람다의 기능은 다음과 같습니다
:
function resetPassword(intentRequest, callback) {
const emailAddress = intentRequest.currentIntent.slots.EmailAddress;
console.log(`emailAddress is: ${emailAddress}`);
request
.post('https://myfakedomain.com:443/passwordreset', emailAddress)
.set({ 'Content-Type': 'text/plain' })
.end((resp) => {
console.log('response was: ' + resp);
});
callback(close(intentRequest.sessionAttributes, 'Fulfilled',
{ contentType: 'PlainText', content: `Thanks, a reset password link has been sent to ${emailAddress}.` }));
}
AWS를 통해 내 람다를 실행이 오류에 대한 어떤 특별한 이유가 있나요 ? 재설정 암호 끝 점이 열리므로 누구나 공격 할 수 있습니다. 나는 또한 게시물 요청의 시작 부분에서 https : // 제거를 시도했지만 운이 없다. 나는 오류 로깅이 매우 최소한도 도움이되지 않는 것 같아요!
도움을 주시면 감사하겠습니다.
이 올바르지 않습니다
관련 AWS 문서에 대한 아래 링크의 몇 가지가 있습니다. 람다 함수는 기본적으로 인터넷에 액세스 할 수 있습니다. VPC의 람다 기능은 NAT 게이트웨이를 사용하지 않는 한 인터넷에 액세스 할 수 없습니다. – dashmug
Dasmug, 감사합니다. 업데이트했습니다. –