...
- Cloud9을 이용하여 서버리스 애플리케이션을 SAM(Serverless Application Model) 기반으로 개발/테스트/배포 할 수 있습니다.
- Cloud9, SAM, IAM
- SAM을 이해하고 서버리스 서비스에 필요한 서비스를 직접 기술 할 수 있습니다.
- API Gateway, Lambda, DynamoDB, S3, SNS, Polly
- 서버리스 애플리케이션을 AWS Code 시리즈를 이용하여 배포 프로세스를 제작할 수 있습니다.
- CodePipeline, CodeCommit, CodeBuild, CloudFormation(SAM), CodeDeploy
실습 비용
Service | Sub Service | Unit | Pricing | Total | free tier | etc |
---|---|---|---|---|---|---|
Cloud9 | EC2 - t2.micro | 1 hour | $0.0116/Hour | $0.0232 | 750hour/month | |
EBS - 8GB | 1 month | $0.1/GB | $0.8 | 30GB/month | ||
Lambda | - | 128MB | $0.000000208/100ms | - | 100만번 요청 400GB-초 | 1년 후 지속 제공 |
API Gateway | - | 1백만 API 호출당 3.50 USD 처음 10TB에 대해 0.09 USD/GB | 호출 100만건 | |||
DynamoDB | - | |||||
Polly | - | |||||
Cognito | - | |||||
CodeStar | CodePipeline | |||||
CodeCommit | ||||||
CodeDeploy | ||||||
CloudFormation(SAM) | ||||||
s3 | - |
구축하고자 하는 서버리스 웹 애플리케이션에 대한 소개
...
- RESTful API의 Delete 메서드를 이용하여 삭제를 요청합니다.1
- API Gateway는 뉴스 데이터를 삭제하는 Lambda 함수인 "DeleteNews"를 호출합니다.
아래 실습을 직접 수행하려면 Amazon Polly 서비스가 제공되는 지역을 선택하십시오. (이 예제는 Cloud9이 존재하는 Singapore 리전에서 English 언어로 진행합니다.)
...
실습
이 예제는 Cloud9이 존재하는 Singapore 리전에서 English 언어로 진행합니다.
실습은 다음과 같은 순서로 진행됩니다.
Lab1. Cloud 9을 이용한 웹 애플리케이션 구축 실습
...
정적 웹 호스팅 파일 다운로드 받기
코드 블럭 language bash theme RDark linenumbers true wget https://s3.ap-northeast-2.amazonaws.com/polly.awsdemokr.com/301_static_web.zip
압축 풀고 폴더 이동
코드 블럭 language bash theme RDark linenumbers true unzip 301_static_web.zip cd 301_static_web
Cloud9에서 scripts.js 파일 열어서 CloudFormation Stack에 배포된 Output의 APIEndpointURL 값을 소스코드에 반영 (WebsiteURL이 아니므로 주의)
코드 블럭 language js theme RDark linenumbers true var API_ENDPOINT = "https://xxxxxxxxxx.execute-api.ap-southeast-1.amazonaws.com/Prod/news/"; if (API_ENDPOINT === "") { alert("scripts.js 파일의 상단에 API Gateway에 배포한 URL을 등록하고 실행하세요."); }
정적 웹 포스팅하고자 하는 S3 버킷에 public-read 권한으로 파일을 업로드 (CloudFormation Stack에 배포된 Output의 S3WebBucket 값을 아래에 대체)
코드 블럭 language bash theme RDark linenumbers true aws s3 sync . s3://cloud9-webapp-staticwebbucket-xxxxxxxxxxxx --acl public-read
- 웹 브라우저로 정적 웹 페이지에 접속 (CloudFormation Stack에 배포된 Output의 WebsiteURL 값을 웹 브라우저 주소창에 입력)
- https://cloud9-webapp-staticwebbucket-xxxxxxxxxxxx.s3.amazonaws.com
- https://cloud9-webapp-staticwebbucket-xxxxxxxxxxxx.s3.amazonaws.com
...