Apex
Apex๋ AWS lambda function ๋น๋, ๋ฐฐํฌ, ๊ด๋ฆฌ๋ฅผ ํธ๋ฆฌํ๋๋ก ๋์์ฃผ๋ ํด์ด๋ค
์ค์น
โข
mac, linux, OpenBSD
$ curl https://raw.githubusercontent.com/apex/apex/master/install.sh | sh
Shell
๋ณต์ฌ
โข
์ธ์ฆ ์ค์
$ ~/.aws/credentials
[example]
aws_access_key_id = xxxxxxxx
aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxx
$ ~/.aws/config
[profile example]
region = ap-northeast-2
Bash
๋ณต์ฌ
ํ๋ก์ ํธ ์์ฑ
$ mkdir example
$ cd example
$ apex init # project name, description ๋ฑ ์ค์
$ apex deploy
Shell
๋ณต์ฌ
ํด๋ ๊ตฌ์กฐ
โโโ functions
โ โโโ hello
โ โโโ index.js
โโโ project.json
Plain Text
๋ณต์ฌ
ํ ์คํธ
$ vim event.json
{"hello": "world"}
$ apex invoke hello < event.json
$ apex invoke hello # without event
Shell
๋ณต์ฌ
project.json
โข
name: ํ๋ก์ ํธ๋ช
โข
description: ํ๋ก์ ํธ ์ค๋ช
โข
runtime: lambda์ ๋ฐํ์ ์ค์
โฆ
java (Java 8)
โฆ
python (Python 2.7)
โฆ
nodejs (Node.js 0.10)
โฆ
nodejs4.3 (Node.js 4.3)
โฆ
nodejs6.10 (Node.js 6.10)
โฆ
golang (any version)
โฆ
clojure (any version)
โฆ
rust-musl[^rust-runtime][^rust-linux-only] (any version)
โฆ
rust-gnu[^rust-runtime][^rust-linux-only] (any version)
โข
memory: lambda ํ ๋น ๋ฉ๋ชจ๋ฆฌ
โข
timeout: lambda ํจ์ ์ต๋ ์คํ ์๊ฐ ( ์ต๋ 300์ด ๊น์ง ํ์ฉ )
โข
role: AWS role
โข
profile: AWS ํ๋กํ์ผ๋ช
โข
defaultEnvironment: ๊ธฐ๋ณธ ์ธํ๋ผ ํ๊ฒฝ (stage, production ๋ฑ)
โข
environment: lambda์ ์ ์ฉํ ํ๊ฒฝ ๋ณ์
โข
nameTemplate: lambda function ๋ง๋ค ๋ ์ฌ์ฉ๋๋ ์ด๋ฆ ํ
ํ๋ฆฟ (default: {{.Project.Name}}_{{.Function.Name}})
โข
retainedVersions: lambda ํจ์์์ ์ ์งํ๊ณ ์์ ๋ฒ์ ๊ฐ์ (default: 10, ๋กค๋ฐฑ์ฉ ๋ฑ์ผ๋ก ์ฌ์ฉํจ)
โข
vpc: AWS VPC
โข
vpc.securityGroups: Security Group ID ๋ชฉ๋ก๋ค
โข
vpc.subnets: ์๋ธ๋ท ID ๋ชฉ๋ก๋ค



