Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AWS Serverless Application Modelのデプロイ戦略
Search
Koji Nakayama
July 03, 2017
Technology
4
2.3k
AWS Serverless Application Modelのデプロイ戦略
Developers.IO 2017の発表スライドです。
Koji Nakayama
July 03, 2017
Tweet
Share
More Decks by Koji Nakayama
See All by Koji Nakayama
Software Testing in AWS IoT with The Power of Python
knakayama
0
1.5k
The ~~Ten~~ Three Most Critical Security Risks in Serverless Architectures
knakayama
2
1.4k
サーバーレス x IoT 〜我々はどういった課題に直面してそれをどのように解決したのか〜
knakayama
0
1.3k
Bloxが切り開くECSの世界
knakayama
1
1.1k
github-classmethod-study-20170426
knakayama
1
3.6k
サーバレスアーキテクチャはじめの一歩
knakayama
1
1.3k
Other Decks in Technology
See All in Technology
State of Open Source Web Mapping Libraries
dayjournal
0
200
Terraform Stacks入門 #HashiTalks
msato
0
260
信頼性に挑む中で拡張できる・得られる1人のスキルセットとは?
ken5scal
1
410
Mini Tokyo 3D × PLATEAU - 公共交通デジタルツインにリアルな風景を
nagix
1
230
Postmanの日本市場におけるDevRel (的) 活動 / Postman's DevRelish activities in Japan
yokawasa
1
120
AI長期記憶システム構築のための LLMマルチエージェントの取り組み / Awarefy-LLM-Multi-Agent
iktakahiro
2
350
フロントエンド メタフレームワーク 選定の際に考えたこと
yuppeeng
0
600
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
270
RustとWebAssemblyを使って高速な画像処理をWebアプリで実行しよう
rebonire626
0
110
私はこうやってマインドマップでテストすることを出す!
mineo_matsuya
0
220
"君は見ているが観察していない"で考えるインシデントマネジメント
grimoh
4
1k
TinyGoを使ったVSCode拡張機能実装
askua
2
200
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
46
2.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
27
2k
Designing Experiences People Love
moore
138
23k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
Measuring & Analyzing Core Web Vitals
bluesmoon
3
76
How STYLIGHT went responsive
nonsquared
95
5.2k
It's Worth the Effort
3n
183
27k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Transcript
AWS Serverless Application Model ΄ϔϤϺα䜐ኼ Developers.IO 2017 2017/07/01 Ӿઊ ଛလ
1
ᛔ૩奧Օ • Ӿઊ ଛလ • μ϶φϮϊϐϖ AWSԪ䮣᮱ ϊϷϲЄτϴ ЀίЄκϓμϕ •
AWSΨڥአͭ͵αЀϢ϶΄戔懯/䯤塈/π ЀςϸϓΰЀν • GitHub: knakayama • 奺䵉 • ηЀϤϹςЄϝ΄晁አ3ଙ • AWS䵉 1ଙͦΟ͚ 2
ίυδЀύ 1. AWS Serverless Application Modelͼ֜ 2. 樄咲ϢϺЄΨᘍ͞Ρ 3. ϊЄφπЄϖ΅Ϳ͜ᓕቘͯΏͣ͡
4. CI/CDΨෆ͞Ρ 5. Ք΄๕ 6. Δ;Η 3
1. AWS Serverless Application Modelͼ֜ 4
AWS Serverless Application Model΄༷ᥝ • ςЄϝϹφίЄκϓμώϰΨᓕቘͯΡ͵Η΄ϯϔϸ • ኼͭͼAWS SAM;ΆΡͩ;͢ग़͚ •
LambdaͿ΄AWSςЄϠφΨਯጱπЄϖ;ͭͼᓕቘݢᚆ • → ίЄκϓμώϰق֛ΨπЄϖͽᓕቘͽͣΡ • → Git/GitHub;昧൭ͭͼCI/CDϞαϤ϶αЀΨ֢Ρ • 䋚䙪΅CloudFormation΄䝭䔴䱛ᚆ 5
AWS SAM΄ϓЀϤϹЄϕֺ --- AWSTemplateFormatVersion: 2010-09-09 Transform: AWS::Serverless-2016-10-31 Description: AWS SAM
Sample Resources: Func: Type: AWS::Serverless::Function Properties: CodeUri: path/to/func Handler: index.handler Runtime: nodejs6.10 Events: Get: Type: Api Properties: Path: /users/{id} Method: get RestApiId: !Ref Api Api: Type: AWS::Serverless::Api ... 6
AWS SAM΄ϓЀϤϹЄϕֺ --- AWSTemplateFormatVersion: 2010-09-09 Transform: AWS::Serverless-2016-10-31 # AWS SAM
ΨڥአͯΡͩ;Ψกᐏጱਧ Description: AWS SAM Sample Resources: Func: Type: AWS::Serverless::Function Properties: CodeUri: path/to/func Handler: index.handler Runtime: nodejs6.10 7
AWS SAM΄ϓЀϤϹЄϕֺ --- AWSTemplateFormatVersion: 2010-09-09 Transform: AWS::Serverless-2016-10-31 Description: AWS SAM
Sample Resources: Func: Type: AWS::Serverless::Function # Lambda አϷϊЄφ΄ਧ嬝 Properties: CodeUri: path/to/func Handler: index.handler Runtime: nodejs6.10 8
AWS SAM΄ϓЀϤϹЄϕֺ --- AWSTemplateFormatVersion: 2010-09-09 Transform: AWS::Serverless-2016-10-31 Description: AWS SAM
Sample Resources: Func: Type: AWS::Serverless::Function Properties: CodeUri: path/to/func # Lambda ΄ϊЄφπЄϖΨތΖϔΰϹμϕϷΎ΄Ϟφ Handler: index.handler Runtime: nodejs6.10 9
AWS SAM΄ϓЀϤϹЄϕֺ --- AWSTemplateFormatVersion: 2010-09-09 Transform: AWS::Serverless-2016-10-31 Description: AWS SAM
Sample Resources: Func: Type: AWS::Serverless::Function Properties: CodeUri: path/to/func Handler: index.handler # ϜЀϖ϶΄ਧ (< Ϣήαϸݷ >.< 樛හݷ >) Runtime: nodejs6.10 10
AWS SAM΄ϓЀϤϹЄϕֺ --- AWSTemplateFormatVersion: 2010-09-09 Transform: AWS::Serverless-2016-10-31 Description: AWS SAM
Sample Resources: Func: Type: AWS::Serverless::Function Properties: CodeUri: path/to/func Handler: index.handler Runtime: nodejs6.10 # ϶Ѐόαϭ΄ਧ 11
AWS SAM΄ϓЀϤϹЄϕֺ ... Func: Type: AWS::Serverless::Function ... Events: Get: Type:
Api # API Gateway;΄αЀϓνϹЄτϴЀ Properties: Path: /users/{id} Method: get RestApiId: !Ref Api Api: Type: AWS::Serverless::Api # API GatewayϷϊЄφ΄ਧ嬝 ... 12
AWS SAM;CLI • ϺЄθϸ΄ϊЄφπЄϖ͡ΟϔϤϺαϮЀϕϞϐξЄυ΄֢౮/ίϐϤϺЄϖ͢ͽͣ Ρ • → ӞଶS3ίϐϤϺЄϖͭͼ͡ΟAWS SAM΄ϓЀϤϹЄϕΨ䄜䟵ͯΡ;͚͜㵕 ֢
• → ֺ͞Ά CodeUri ϤϺϞϓΰΨS3Ύ΄Ϟφ䄜䟵ͭͼͥΡ • 䌑አ΄πϫЀϖ΅አͫͼ͚΄ͽAWS CLIΨڥአͯΡ • → 㷗ੂ͜;ϢϹЄϭϼЄμͽ΅ͥͥ͘Δͽϯϔϸ;͚֖͜ᗝͻͧ΄͵Η • → Serverless FrameworkΚApex;΅吖ΡϪαЀϕ 13
䄜䟵ͫ͵AWS SAM΄ϓЀϤϹЄϕֺ --- AWSTemplateFormatVersion: 2010-09-09 Transform: AWS::Serverless-2016-10-31 Description: AWS SAM
Sample Resources: Func: Type: AWS::Serverless::Function Properties: CodeUri: s3://<_S3_BUCKET_>/<_S3_PREFIX_>/<DEPLOYMENT_PACKAGE> Handler: index.handler Runtime: nodejs6.10 14
AWS SAM΄ϔϤϺα • Ԇզӥ2ͺ΄πϫЀϖΨڥአͯΡ • aws cloudformation package • S3Ύ΄ίϐϤϺЄϖ;ϓЀϤϹЄϕ΄䄜䟵
• aws cloudformation deploy • φόϐμ/Change Set΄֢౮ or ๅෛ 15
AWS SAM΄ϔϤϺα $ aws cloudformation package \ --template-file sam.yml \
--s3-bucket <_S3_BUCKET_> \ --s3-prefix <_S3_PREFIX_> \ --output-template-file .sam/packaged.yml $ aws cloudformation deploy \ --template-file .sam/packaged.yml \ --stack-name <_STACK_NAME_> \ --capabilities CAPABILITY_IAM 16
2. 樄咲ϢϺЄΨᘍ͞Ρ 17
๋֗3ͺ΄厏हΨአͯΡ • Develop厏ह • → ϺЄθϸ΄樄咲厏ह • Staging厏ह • →
αЀϓνϹЄτϴЀϓφϕΨ䋚ෞͯΡ厏ह • → चጱProduction;ݶᒵ΄厏हͭͼͥ͠Ώͣ • Production厏ह • → ͠ਮͫΩ͢䋚檭ڥአͯΡ厏ह 18
Develop厏ह • ෭̸咲ኞͯΡෛ䱛ᚆ樄咲Κbugfix΄ץྋΨ䋚ෞͯΡ厏ह • ᔰͥ樄咲ͯΡ͵Η樄咲ᘏϺЄθϸͽਠ奾ͽͣΡΞͯ͜Ρ • ϺЄθϸ樄咲厏हΨςϪЄϕͯΡ厏हΨෆ͞Ρ • → ϦЄφ΅LocalstackͿ΄AWSεϬϲϹЄτϴЀᔮϑЄϸͽդ๊
• → ϓφϕπЄϖ΄ӾͽAWS SDK΄εЀϖϪαЀϕΨlocalhost䄜ๅ • → ;΅͚͞قͼ΄䱛ᚆΨդ๊ͽ͚ͣ΄ͽ晒ϯϐμ۸ 19
t-wada࿄΄φ϶αϖ๋͢ṛ΄ͽͰ抎Ζͩ; https://speakerdeck.com/twada/testable-lambda-working-effectively-with-legacy-lambda 20
Staging/Production厏ह • μ϶γϖςЄϠφ;͚͜ᇙӤ̵ϺЄθϸͽ΄αЀϓνϹЄτϴЀϓφ ϕ or E2Eϓφϕ΅ᴴኴ͘͢Ρ • → εϬϲϹЄτϴЀᔮϑЄϸ΅ͥ͘Δͽ֒͵ഄΡᛩ͚ΨͯΡͶͧ ΄ͽ̵䋚檭΄㵕֢;ݶͮ;΅ᴴΟ͚
• → ͘;ϯϐμ䨗ͥ΄ͶΡ͚ • Production;ΑΒݶᒵ΄厏ह(Staging)΄֖ᗝ՞ͧ͢᯿ᥝ • → Staging厏हͽϓφϕͯΡ;͚͜΄͢匍䋚ᥴͽ΅ 21
ϣ϶Ѐώ䜐ኼ • GitHubϢϺЄ + ϷϷЄφϣ϶Ѐώොୗ • 樄咲䦒΅ฦ᭗GitHubϢϺЄΨڥአ • Staging/ProductionϷϷЄφͯΡ檭ϣ϶ЀώΨڔΠ๊͞Ρ •
ϷϷЄφϣ϶Ѐώ΅ϔϤϺα͢֎͜΄ͽ樌晅ͼpushͫͱ͚ Ξͯ͜Ρ • → Protected BranchΨڥአ 22
ϣ϶Ѐώ䜐ኼ ϣ϶Ѐώݷ አ᭔ master ώδϐμίγϕز;Ρϣ϶Ѐώ ձ( add-new-feature ;͡) master͡Οώδϐμίγϕͭ͵ϕϡϐμ ϣ϶Ѐώ
staging stagingአϷϷЄφϣ϶Ѐώ Protected Branch production productionአϷϷЄφϣ϶Ѐώ Protected Branch 23
ϣ϶Ѐώ΄϶αϢςαμϸ 1. master ͡Οϕϡϐμϣ϶Ѐώ֢౮ 2. master 䌏ͭͼWIP PRڊͯ 3. 樄咲
4. master PR΄ϹϠϲЄׁ毲&ϫЄυ 5. ϓφϕ΄όαϬЀνͽ master ͡Ο staging PR & ϫЄυ 6. staging ͽαЀϓνϹЄτϴЀϓφϕ 7. ϷϷЄφ΄όαϬЀνͽ staging ͡Ο production PR & ϫЄυ 24
3. ϊЄφπЄϖ΅Ϳ͜ᓕቘͯΏͣ͡ 25
ϔϤϺαϮЀϕϞϐξЄυΨੜͫͥͯΡ • ϔϤϺαϮЀϕϞϐξЄυ΅ᥝΘ΄զक़ތΔ͚ • → Lambda΄πЄϸϖφόЄϕΨᎨ婘ͯΡ͵Η • AWS SAM΅ϔϤϺαϮЀϕϞϐξЄυ΄ݐ䞳晝䝑͢୧͚΄ͽϓφϕ πЄϖΘړ櫝
• → ͺΔΠLambda΄ϊЄφπЄϖ;ݶͮϔΰϹμϕϷ΅ތΗ͚ • → Serverless Framework΅ϼαϸϖθЄϖͽຨ敟晝䝑ͽͣΡ΄Ͷ ͢… https://speakerdeck.com/keisuke69/quan-bu-jiao-emasu-saharesuahurifalseantihatantotiyuninku?slide=24 26
1ͺ΄πЄϖϦЄφ;愢හ厏हΎ΄䌏䖕 • 厏ह䶅φόϐμΨړ櫝ͯΡ • → AWS SAM΅匍䦒ᅩͽLambda΄Version & Alias;ፘ䘂͚ •
→ aws cloudformation deploy ΄ --stack-name ͽ厏ह䶅φόϐμΨړ櫝ͯΡ • 厏ह䶅吖ΡϞ϶ϮЄόΨ戔ਧϢήαϸͽᓕቘ • → params զӥ厏ह䶅΄Ϟ϶ϮЄόΨތΩͶ戔ਧϢήαϸΨአ • → aws cloudformation deploy ΄ --parameter-overrides ͽ厏ह䶅΄Ϟ϶ϮЄ όΨޕ㷧 27
ϷϪυϕϷͽਠ奾ͫͱΡ • ϷϪυϕϷقͼ΄ఘ䁭ΨތΗΡ • → 愢හՈͽ΄樄咲ͽΘݶͮ厏हΨͯͦٚ匍ͽͣΡΞͭ͜ͼͥ͠ • → package.jsonᥝϯυϲЄϸΨقͼفΡ •
AWS CLI΄϶ϐϞЄφμϷϤϕΨአͭͼͥ͠ • → AWS SAMΨڥአͭͼ͚Ρ;AWS CLIΨ毱ᔺڥአͯΡ͵Η • → ϶ϐϞЄφμϷϤϕΨ bin զӥᯈᗝͭͼ package.json ΄ scripts ͡ΟΉڊͯ • → npm or yarn ͽ䋚ᤈ • → AWS CLI΄ϝЄυϴЀΘ requirements.txt ͽᓕቘ 28
㰜͢ᘍ͞͵๋䔶΄ϔΰϹμϕϷ䯤᭜ ϔΰϹμϕϷ or Ϣήαϸݷ ۆ .sam/ aws cloudformation package ͽ䄜䟵ͫ͵ϓЀϤ
ϹЄϕ( .sam/packaged.yml Ϳ) ݶͮϢήαϸΨٚኞ౮ݢᚆ΄ͽ .gitignore ͽᴻक़ bin/ AWS CLI΄϶ϐϞЄφμϷϤϕ( bin/deploy.sh Ϳ) package.json ϯυϲЄϸ;϶ϐϞЄφμϷϤϕ΄ᓕቘ params/ 厏ह䶅΄Ϟ϶ϮЄό( params/stg.json Ϳ) requirements.txt AWS CLI΄ϝЄυϴЀᓕቘ sam.yml AWS SAM΄ϓЀϤϹЄϕ 29
㰜͢ᘍ͞͵๋䔶΄ϔΰϹμϕϷ䯤᭜ ϔΰϹμϕϷ or Ϣήαϸݷ ۆ src/ Lambda΄ϊЄφπЄϖΚAPI Gateway΄SwaggerϢήα ϸᗝͣ䁰 sam.yml
;΅吖ΡϓЀϤϹЄϕΨڥአͭ͵͚䁰ݳ΅ͩ ͩᗝͥ΄Θ͘Π src/api/swagger.yml API Gateway΄SwaggerϢήαϸ(ֵ͜䁰ݳ) src/handlers/<樛හݷ>/ Lambda΄ϊЄφπЄϖᗝͣ䁰 test/ ϓφϕπЄϖᗝͣ䁰( test/<樛හݷ>.spec.js Ϳ) yarn.lock yarn΄ϺϐμϢήαϸ(ֵ͜䁰ݳ) buildspec.yml CodeBuild΄戔ਧϢήαϸ 30
4. CI/CDΨෆ͞Ρ 31
AWS SAM;CI/CD • AWS SAMͽCI/CDͯΡ͵Η΄ϑЄϸ or ςЄϠφ΅͚Σ͚Σ͘Ρ • → Jenkins/CircleCI/Travis
CI/etc... • Քࢧ΅CodePipeline;CodeBuild΄奲ΕݳΥͱΨͪ奧Օ • → ݱ圵AWSςЄϠφ;΄昧൭͢ಋܹ͚ܦ • ͵Ͷ̵ͭΚΣ͜;ͭͼ͚ΡٖጱͿ΄ϑЄϸ or ςЄϠφͽΘ ͽͣΡ΄ͽ֜ͽΘΞ͚΄ͽ΅ 32
CodePipeline • CI/CD΄ϞαϤ϶αЀ(ϢϺЄ)ΨᓕቘͽͣΡϫϚЄυϖςЄϠφ • → ϊЄφϊЄϖ΄ݐ/Ϡϸϖ/ϓφϕ;͚͜ϞαϤ϶αЀΨෆቘͽͣΡ • ϞαϤ϶αЀӤ΄ݱςЄϠφ΅φϓЄυ;Ό • →
φϓЄυͽኞ౮ͫ͵ίЄϓΰϢήμϕ΅S3ᯈᗝͯΡͩ;ΞΠφϓЄυ樌ͽ昧൭ͯΡ • ϊЄφπЄϖ΄ݐض;ͭͼGitHubΨڥአݢᚆ • → ဳᅩ;ͭͼϣ϶ЀώΎ΄pushΨॶ䱛;ͯΡᥝ͘Π • → 匍䦒ᅩͽ΅όν๚䌏䖕 • CodePipeline͡ΟCloudFromation΄䋚ᤈ/Change Set֢౮/ๅෛͿ͢ݢᚆ 33
CodeBuild • buildspec.yml चͻͣϠϸϖ/ϓφϕΨ䋚ෞͽͣΡϫϚЄυϖςЄϠ φ • → ϢδЄχ;͚༷͜ஷͽᇙਧ΄όαϬЀνͽձ΄πϫЀϖΨ䋚ᤈ ݢᚆ •
→ circle.yml ;य़֛ݶͮ • ςЄϠφϺЄϸ䌏䖕ͭͼ͚Ρ΄ͽAWSμϹϔЀτϰϸ΄咲ᤈ͢ӧᥝ • → CI/CD SaaS;吖Ρڥᅩ 34
CI/CDϞαϤ϶αЀ - ق֛ 1. staging/productionϣ϶ЀώΎ΄ϫЄυΨॶ䱛CodePipeline䋚 ᤈ 2. GitHub͡ΟϊЄφπЄϖݐ 3. CodeBuildͽϠϸϖ
& ϓφϕ 4. CodePipeline͡ΟCloudFormation΄䋚ᤈ http://dev.classmethod.jp/cloud/aws/developing-cloudformation-ci-cd-pipeline-with-github-codebuild-codepipeline/ 35
CI/CDϞαϤ϶Ѐ - Source • CodePipeline͢୮ • GitHub͡ΟϊЄφπЄϖΨݐͭͼS3כਂ 36
CI/CDϞαϤ϶Ѐ - Build & Test • CodeBuild͢୮ • ๋ڡS3͡ΟϊЄφπЄϖΨݐ •
ϓφϕ΅ϳϘϐϕϓφϕ • ͩ΄䁰ݳ΄Ϡϸϖ;΅ aws cloudformation package Ψͯ • ኞ౮ͭ͵ίЄϓΰϢήμϕΨS3כਂ 37
buildspec.yml΄ֺ version: 0.2 phases: install: commands: - | # AWS
CLI pip install -U pip pip install -r requirements.txt # yarn curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update sudo apt-get install -y yarn yarn pre_build: commands: - | [ -d .sam ] || mkdir .sam aws cloudformation validate-template --template-body file://sam.yml yarn test build: commands: - | aws cloudformation package \ --template-file sam.yml \ --s3-bucket $S3_BUCKET \ --s3-prefix $S3_PREFIX \ --output-template-file .sam/packaged.yml artifacts: files: - .sam/* - params/* discard-paths: yes 38
buildspec.yml΄ֺ - 厏ह΄ψϐϕίϐϤ • CodeBuildϝЀϖϸͫͼ͚Ρ pip ΄ϝЄυϴЀݘ͚ • Υε϶Є͢咲ኞͭ͢ͷ΄ͽϝЄυϴЀӤͨͼͥͩ͠; install:
commands: - | # AWS CLI pip install -U pip pip install -r requirements.txt # yarn curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update sudo apt-get install -y yarn yarn 39
buildspec.yml΄ֺ - ϓφϕ • AWS SAMϓЀϤϹЄϕ΄ϝϷϔЄτϴЀ;ϳϘϐϕϓφϕ • post_build ͽΚͼΘ͚͚ pre_build:
commands: - | [ -d .sam ] || mkdir .sam aws cloudformation validate-template --template-body file://sam.yml yarn test 40
buildspec.yml΄ֺ - Ϡϸϖ • ͽϺЄϸϝϐμͫͱ͵͚䦒΄͵Η S3_PREFIX Ψ෭՞Ϳͭ ͼͥ͠;Ξ͚ build: commands:
- | aws cloudformation package \ --template-file sam.yml \ --s3-bucket $S3_BUCKET \ --s3-prefix $S3_PREFIX \ --output-template-file .sam/packaged.yml 41
buildspec.yml΄ֺ - ίЄϓΰϢήμϕ΄ኞ౮ • 䄜䟵ͫ͵AWS SAMϓЀϤϹЄϕ;厏ह䶅΄Ϟ϶ϮЄόΨίЄϓΰ Ϣήμϕ;ͭͼS3ίϐϤϺЄϖ • discard-paths ΅ϔΰϹμϕϷݷΨ僻憙ͭͼίϐϤϺЄϖͯΡ͡Ϳ͜
͡(͠অΕͽOK) artifacts: files: - .sam/* - params/* discard-paths: yes 42
CI/CDϞαϤ϶Ѐ - Change Set΄֢౮ • CodePipeline͢୮ • S3͡ΟίЄϓΰϢήμϕΨݐ • Template䄜䟵ͫ͵AWS
SAMϓЀϤϹЄϕΨਧ • Template Configuration厏ह䶅΄Ϟ϶ϮЄόϢήαϸΨਧ { "Parameters": { "Env": "stg", "ReadCapacityUnits": "10", "WriteCapacityUnits": "10" } } 43
CI/CDϞαϤ϶Ѐ - SNSϕϡϐμΎ΄᭗Ꭳ • CodePipeline͢୮ • Change Set΄ٖΨ嘦扯 • SNSϕϡϐμΨςϣφμ϶αϣͭ͵Lambda͡ΟSlackͿ᭗
ᎣͯΡͩ;Θݢᚆ 44
CI/CDϞαϤ϶Ѐ - Change Set΄䋚ᤈ • CodePipeline͢୮ • Stack Name厏ह䶅΄φόϐμݷΨਧͯΡ •
Change SetΨ䋚ᤈͭͼϞαϤ϶αЀਠԧ 45
5. Ք΄๕ 46
Ք΄๕ • ςЄϝϹφίЄκϓμώϰͽϔϤϺαͯΡ厏ह΅嘦ᒈͫͼͣ͵ܦ • → AWS SAM/Serverless FrameworkͿޮ旽ϑЄϸ΄꧌䋚 • ͵ͶαЀϓνϹЄτϴЀϓφϕ
or E2EϓφϕΨތΗ͵CI΄᮱ړͽᎣ憎͚͢ • → Localstackֵ͜;CIӤͽΘαЀφϕЄϸ͚ͭ;͚͚ͧ • → ϳЄσԪֺΚϦφϕϤ϶μϓΰφ͢ΔͶ͚ • ϺЄθϸ樄咲厏हΨ꧌䋚ͫͱ͵͚ • → Localstack΅Քଙ咲ᤒͫ͵΄ͽΔͶΔͶ䱛ᚆӧ᪃ܦ • → ϯϐμ䨗ͥ΄τЀϖ͚ 47
6. Δ;Η 48
ςЄϝϹφίЄκϓμώϰ๋ṛ 49
͠ΥΠ 50