• This repository has been archived on 03/Sep/2020
  • Stars
    star
    29
  • Rank 831,090 (Top 17 %)
  • Language
    Go
  • License
    MIT License
  • Created over 3 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Old apex/apex

No longer maintained

This software is no longer being maintainted and should not be chosen for new projects. See this issue for more information

Apex Serverless Architecture

Apex lets you build, deploy, and manage AWS Lambda functions with ease. With Apex you can use languages that are not natively supported by AWS Lambda through the use of a Node.js shim injected into the build. A variety of workflow related tooling is provided for testing functions, rolling back deploys, viewing metrics, tailing logs, hooking into the build system and more.

This project is designed for event-driven pipelines as it does not abstract away FaaS (functions as a service). If you are building web applications, APIs, or sites, consider using Apex Up, which provides a more out-of-the-box experience for these use-cases.

Installation

On macOS, Linux, or OpenBSD run the following:

curl https://raw.githubusercontent.com/apex/apex/master/install.sh | sh

Note that you may need to run the sudo version below, or alternatively chown /usr/local:

curl https://raw.githubusercontent.com/apex/apex/master/install.sh | sudo sh

On Windows download binary.

After downloading, rename binary file 'apex.exe', then add to PATH.

If already installed, upgrade with:

apex upgrade

Runtimes

Currently supports:

  • Node.js
  • Golang
  • Python
  • Ruby
  • Java
  • Rust
  • Clojure

Example projects for all supported runtimes can be found in _examples directory.

Features

  • Supports languages Lambda does not natively support via shim
  • Binary install (install apex quickly for continuous deployment in CI etc)
  • Hook support for running commands (transpile code, lint, dependency management, etc)
  • Batteries included but optional (opt-in to higher level abstractions)
  • Environment variable population via command-line, file, or inline config
  • Idempotent deployments (checksums skip already-deployed code)
  • Multiple environments via project.ENV.json and function.ENV.json files
  • Configuration inheritance and overrides
  • Command-line function invocation with JSON streams
  • Command & function name autocompletion
  • Function name globbing (ex: apex deploy api_*)
  • Transparently generates a zip for your deploy
  • Project bootstrapping with optional Terraform support
  • Function metrics and cost analysis
  • Ignore deploying files with .apexignore
  • Function rollback support
  • Tail function logs
  • Concurrency for quick deploys
  • Dry-run to preview changes
  • VPC support
  • Multiple region support
  • Lambda@Edge support

Sponsors

Does your company use Apex? Help keep the project bug-free and feature rich by sponsoring the project.

Backers

Love our work and community? Become a backer.

Example

Apex projects are made up of a project.json configuration file, and zero or more Lambda functions defined in the "functions" directory. Here's an example file structure:

project.json
functions
โ”œโ”€โ”€ bar
โ”‚ย ย  โ”œโ”€โ”€ function.json
โ”‚ย ย  โ””โ”€โ”€ index.js
โ””โ”€โ”€ foo
    โ”œโ”€โ”€ function.json
    โ””โ”€โ”€ index.js

The project.json file defines project level configuration that applies to all functions, and defines dependencies. For this simple example the following will do:

{
  "name": "example",
  "description": "Example project"
}

Each function uses a function.json configuration file to define function-specific properties such as the runtime, amount of memory allocated, and timeout. This file is completely optional, as you can specify defaults in your project.json file. For example:

{
  "name": "bar",
  "description": "Node.js example function",
  "runtime": "nodejs4.3",
  "memory": 128,
  "timeout": 5,
  "role": "arn:aws:iam::293503197324:role/lambda"
}

Now the directory structure for your project would be:

project.json
functions
โ”œโ”€โ”€ bar
โ”‚ย ย  โ””โ”€โ”€ index.js
โ””โ”€โ”€ foo
    โ””โ”€โ”€ index.js

Finally the source for the functions themselves look like this in Node.js:

console.log('start bar')
exports.handle = function(e, ctx) {
  ctx.succeed({ hello: e.name })
}

Apex operates at the project level, but many commands allow you to specify specific functions. For example you may deploy the entire project with a single command:

$ apex deploy

Or whitelist functions to deploy:

$ apex deploy foo bar

Invoke it!

$ echo '{ "name": "Tobi" }' | apex invoke bar
{ "hello": "Tobi" }

See the Documentation for more information.

Links


Build Status Slack Status GoDoc OpenCollective OpenCollective

More Repositories

1

up

Deploy infinitely scalable serverless apps, apis, and sites in seconds to AWS.
Go
8,762
star
2

gh-polls

Polls for user feedback in GitHub issues
Go
1,760
star
3

log

Structured logging package for Go.
Go
1,345
star
4

gateway

Drop-in replacement for Go net/http when running in AWS Lambda & API Gateway
Go
647
star
5

apex-ui

Apex monochrome Atom theme UI.
CSS
411
star
6

up-examples

Example apps, apis, and sites for Up.
HTML
389
star
7

apex-go

Golang runtime for Apex/Lambda.
Go
293
star
8

static

The static site anti-framework โ€“ย general-purpose library, purpose-built commands for various domains
Go
292
star
9

node-apex

Node.js module that makes AWS Lambda's user experience a little nicer using promises.
JavaScript
279
star
10

rpc

Simple RPC style APIs with generated clients & servers.
Go
215
star
11

actions

GitHub Actions
Go
176
star
12

gui

GitHub readme UI components
CSS
132
star
13

apex-syntax

Apex monochrome Atom theme syntax.
CSS
128
star
14

apex-shell

Interactive shell for executing commands in AWS Lambda containers.
Go
121
star
15

capture

Lambda function to capture a URL as PNG, JPG, or GIF using PhantomJS
JavaScript
109
star
16

httpstat

Higher level HTTP tracing for Go
Go
96
star
17

js

Go packages for JavaScript WASM interoperability in the browser
Go
89
star
18

apex-ui-slim

Apex monochrome Atom theme UI (slim variant)
CSS
74
star
19

svg_to_png

Lambda function to convert SVG to PNG using PhantomJS
JavaScript
71
star
20

logs

Apex Logs client for Go.
Go
61
star
21

apex.run

Apex website
HTML
59
star
22

up.js

Up application companion library for Node and the browser
JavaScript
58
star
23

logs-cloudwatch

Send your AWS CloudWatch Logs to Apex Logs.
Go
39
star
24

logs-js

Apex Logs client for Node, Deno, and the browser
TypeScript
38
star
25

httplog

Go http logger for apex/log.
Go
35
star
26

parsers

Performant Go log format parsers.
Go
31
star
27

roadmap

Roadmap for Apex Software products
30
star
28

invoke

Lambda invocation helper functions for Go.
Go
27
star
29

logs-winston

Apex Logs integration for the Node.js Winston logging framework
JavaScript
23
star