AWS에 배포하기 위한, Serverless framework 설치
Node.js 서버리스 소프트웨어 설치하기
Node.js — Run JavaScript Everywhere
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
nodejs.org
Serverless 프레임워크 설치하기
- cmd에서 설치 / 깃허브 경로로 이동해서 설치한다.
$ cd 깃허브 폴더 경로 복사해서 경로 이동
$ npm install -g serverless
AWS IAM에서 생성한 유저로 서버리스에 엑세스 권한을 설정해 준다.
1. Serverless 회원가입 해주자
Serverless: Zero-Friction Serverless Apps On AWS Lambda & Beyond.
Easily build auto-scaling, low-overhead applications on AWS Lambda, API Gateway, DynamoDB, and other managed services with the Serverless Framework.
www.serverless.com
2. CMD 에서 서버 리스 세팅 하자
: 서버리스 메뉴얼 https://www.serverless.com/framework/docs/getting-started
2-1. 깃허브 폴더 안으로 경로 이동
$ cd 내 깃허브 경로 (C:\Users\405\Documents\GitHub)
2-2. 서버리스 프레임워크에 접속
$ serverless
선택 : AWS / Python / Flask API _ 방향키 누르면 움직인다.
2-3.
작성 : Name Your Service : 내 서비스 이름
선택 : Login/Register
2-4. 로그인 완료되었다. [You have successfully signed in.]
선택 : Skip Adding An App / 내가 만든 앱 선택 / APP 이름 만들기 중 선택해서 만들어주기
선택 : Save AWS Credentials in a Local Profile
2-5. AWS IAM에서 생성한 엑세스 키를 이용해 작성하면 서비스 준비가 완료된다.
작성 : Enter AWS Access Key ID: · 사용자 엑세스키
작성 : Enter AWS Secret Access Key: · 사용자 비밀엑세스키
* serverless 와 Node.js 를 사용하는 이유
aws가 알아서 scale-up을 진행하기 때문에 api 호출이 급작스럽게 늘어나도 aws에서 알아서 서버를 지원하기 때문에,
개발자가 서버를 관리해야 하는 비중이 줄어든다는 장점이 있다.
참조. https://velog.io/@alli-eunbi/Node-JS-Serverless-%EB%B0%B0%ED%8F%AC
Node JS & Serverless 배포
Serverless를 사용하는 이유 Serverless FrameWork 활용 serverless 프레임워크를 install 해준다. serverless.yml은 아래와 같이 입력해준다. service 이름은 project 이름으로 주었다. plugins는 다양하
velog.io
'AWS SERVER > AWS Lambda Serverless 배포' 카테고리의 다른 글
[Serverless] 서울 리전 사용(region: ap-northeast-2), AWS에서 람다와 로그 확인, API endpoint 주소 알기 (0) | 2024.05.24 |
---|---|
[Serverless] 서버리스가 주는 템플릿으로 서버 배포 할 때 오류 -> 해결방법 2가지(V4 / V3) (0) | 2024.05.23 |