Giter Site home page Giter Site logo

lambda-blog-study's Introduction

서버리스 blog (Serverless Blog)

목표

  • 서버리스 이미지 최적화 만들기를 통하여서 aws serverless 아키텍쳐 이해
  • serverless 프레임워크 이해
  • typescript 로 작성하며, typescript 이해

이미지 최적화 아키텍쳐

  1. 온디멘드 방식 -> 이미지 업로드 즉시 처리하여 s3 에 업로드
  2. 이벤트 직접 호출 방식
  3. 이벤트 구독 방식

필수 설치

  • serverless framework
  • aws cli

option 설치

  • direnv

환경설정

  • aws cli 설치
# aws cli 설치
brew install awscli

# aws 인증 설정
aws configure

# AWS Key ID : [AWS Console IAM 에서 발급받은 Key ID] 
# AWS Secret Access Key : [AWS Console IAM 에서 발급받은 Secret Access Key]
# Default region name : [원하는 디폴트 리전, (한국 ap-northeast-2)]
# Default output format : [원하는 Response 포맷 (json)]
  • serverless framework 설치
npm i serverless -g
  • direnv가 설치되어 있는 경우에는 .envrc 에 작성
export BUCKET_NAME=[S3 버킷이름]
export ROOT_DOMAIN=[구매한 도메인 이름]
export SUB_DOMAIN=[1차 서브 도메인]
export INFRA_DOMAIN=[2차 도메인 사용시 환경구성 (예제에서는 production, qa, dev)]


export AWS_ACCESS_KEY_ID=[AWS access key]
export AWS_SECRET_ACCESS_KEY=[AWS secret key]
export AWS_DEFAULT_REGION=[region, 예제에서는 (ap-northeast-2)]
export ACM_CERTIFICATE_ARN=[미리 요청된 SSL의 ARN]

패키지

sls package
# serverless package
# npm run package

배포

sls deploy
# serverless deploy
# npm run deploy

제거

sls remove
# serverless remove
# npm run remove

설명

이미지 최적화 블로그

issue

sls remove 가 안될 때

  • 사용한 s3 버킷이 비어있지 않으면, 명령어가 제대로 작동하지 않음, 비운 후에 다시 명령어 사용할 것

lambda-blog-study's People

Contributors

yousung avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.