Skip to content

Commit

Permalink
Bump version to 0.26.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hayd committed Dec 6, 2019
1 parent 5277eb2 commit 720fa16
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 27 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ From the [AWS console](https://console.aws.amazon.com/lambda/):

1. Download zip files from the [releases](https://github.com/hayd/deno-lambda/releases) page.

2. Create a _layer_ and upload `deno-lambda-layer.zip`. Note its ARN.
2. Create a _layer_ and upload `deno-lambda-layer.zip`.

<img width="828" alt="Create layer" src="https://user-images.githubusercontent.com/1931852/68455786-0b618100-01b1-11ea-988a-ba3a5810a8d5.png">

<img width="1122" alt="Layer created" src="https://user-images.githubusercontent.com/1931852/68455785-0b618100-01b1-11ea-9686-8ebefe3b00ff.png">

Note its Version ARN.

3. Create a lambda function from scratch with runtime "provide your own bootstrap".

<img width="1295" alt="Create function" src="https://user-images.githubusercontent.com/1931852/68455784-0ac8ea80-01b1-11ea-93ba-8c64a4e487e7.png">
Expand All @@ -32,7 +34,7 @@ From the [AWS console](https://console.aws.amazon.com/lambda/):

6. "Save". "Test" (use the default event).

<img width="1298" alt="Execution successful" src="https://user-images.githubusercontent.com/1931852/68455779-0ac8ea80-01b1-11ea-9204-67bf4cb1c250.png">
<img width="1277" alt="Execution successful" src="https://user-images.githubusercontent.com/1931852/70288824-bb61e400-1787-11ea-95a6-61bb3a260c05.png">

---

Expand Down
13 changes: 7 additions & 6 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Serverless example

Deploy in a single step using [`serverless deploy`](https://serverless.com/framework/docs/providers/aws/guide/deploying/).

This example lambda application defines:

- A lambda layer from the `deno-lambda-layer.zip`.
- A DynamodDB table "candidates".
- Three lambda functions a list/get/submit.
- An API Gateway endpoint to these functions.

This is based on [_Building a REST API in Node.js with AWS Lambda, API Gateway, DynamoDB, and Serverless Framework_ blogpost by Shekhar Gulat](https://serverless.com/blog/node-rest-api-with-serverless-lambda-and-dynamodb/).
Requires `deno-lambda-layer.zip` to be in the directory:

See the application described in `serverless.yml` and the exported functions in `api/candidate.ts`.
curl -sfL https://github.com/hayd/deno-lambda/releases/download/v0.4.0/deno-lambda-layer.zip -o deno-lambda-layer.zip

It can be deployed in a single step using [`serverless deploy`](https://serverless.com/framework/docs/providers/aws/guide/deploying/).
This example is based on [_Building a REST API in Node.js with AWS Lambda, API Gateway, DynamoDB, and Serverless Framework_ blogpost by Shekhar Gulat](https://serverless.com/blog/node-rest-api-with-serverless-lambda-and-dynamodb/).

Note: The `serverless-scriptable-plugin` is used to compile (`deno fetch api/candidate.ts`)
so there is no init-time download/compilation step.
See the application described in `serverless.yml` and the exported functions in `api/candidate.ts`.

DENO_DIR=.deno_dir deno fetch api/candidate.ts && cp -R .deno_dir/gen/file/$PWD/ .deno_dir/LAMBDA_TASK_ROOT
Note: The `serverless-scriptable-plugin` is used to compile `api/candidate.ts` so there is no init-time download/compilation step.

---

Expand Down
Binary file removed example/deno-lambda-layer.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion example/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export {
DynamoDBClient
} from "https://raw.githubusercontent.com/hayd/dynamodb/782f64ce64e7c83f964970c7eeacba0d5c9dfb91/mod.ts";

export { v4 as uuid } from "https://deno.land/std@v0.25.0/uuid/mod.ts";
export { v4 as uuid } from "https://deno.land/std@v0.26.0/uuid/mod.ts";
2 changes: 1 addition & 1 deletion example/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ provider:
name: aws
runtime: provided
stage: dev
region: us-east-1
region: ${env:AWS_DEFAULT_REGION, 'us-east-1'}
iamRoleStatements:
- Effect: "Allow"
Action:
Expand Down
4 changes: 2 additions & 2 deletions example/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
// You must also pass a access key/secret environment variables, but these don't have to be real e.g.
// AWS_ACCESS_KEY_ID=fakeMyKeyId AWS_SECRET_ACCESS_KEY=fakeSecretAccessKey deno --allow-env --allow-net test.ts

import { runIfMain } from "https://deno.land/std@v0.25.0/testing/mod.ts";
import { runIfMain } from "https://deno.land/std@v0.26.0/testing/mod.ts";
import {
assert,
assertEquals
} from "https://deno.land/std@v0.25.0/testing/asserts.ts";
} from "https://deno.land/std@v0.26.0/testing/asserts.ts";

import { client } from "./client.ts";
import { test } from "./test_util.ts";
Expand Down
2 changes: 1 addition & 1 deletion example/test_util.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
TestDefinition,
test as stdTest
} from "https://deno.land/std@v0.25.0/testing/mod.ts";
} from "https://deno.land/std@v0.26.0/testing/mod.ts";

import { client } from "./client.ts";
import { TableName } from "./api/candidate.ts";
Expand Down
2 changes: 1 addition & 1 deletion tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Note: This must be built in the .. context

FROM hayd/deno:amazonlinux1-0.25.0
FROM hayd/deno:amazonlinux1-0.26.0
# This is the runtime used by AWS Lambda
# plus a compatible deno executable /bin/deno.
# https://github.com/hayd/deno_docker
Expand Down
6 changes: 3 additions & 3 deletions tests/deps.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { assertEquals } from "https://deno.land/std@v0.25.0/testing/asserts.ts";
export { serve } from "https://deno.land/std@v0.25.0/http/server.ts";
export { runIfMain, test } from "https://deno.land/std@v0.25.0/testing/mod.ts";
export { assertEquals } from "https://deno.land/std@v0.26.0/testing/asserts.ts";
export { serve } from "https://deno.land/std@v0.26.0/http/server.ts";
export { runIfMain, test } from "https://deno.land/std@v0.26.0/testing/mod.ts";
4 changes: 2 additions & 2 deletions tests/test_bundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"expected": [
{
"status": "ok",
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.25.0 🦕\"}"
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.26.0 🦕\"}"
},
{
"status": "ok",
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.25.0 🦕\"}"
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.26.0 🦕\"}"
}
],
"files": ["hello.bundle.js"],
Expand Down
4 changes: 2 additions & 2 deletions tests/test_example_zip.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"expected": [
{
"status": "ok",
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.25.0 🦕\"}"
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.26.0 🦕\"}"
},
{
"status": "ok",
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.25.0 🦕\"}"
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.26.0 🦕\"}"
}
],
"files": "deno-lambda-example.zip",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_js.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"expected": [
{
"status": "ok",
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.25.0 🦕\"}"
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.26.0 🦕\"}"
},
{
"status": "ok",
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.25.0 🦕\"}"
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.26.0 🦕\"}"
}
],
"files": ["hello.js"],
Expand Down
4 changes: 2 additions & 2 deletions tests/test_self_contained.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"expected": [
{
"status": "ok",
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.25.0 🦕\"}"
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.26.0 🦕\"}"
},
{
"status": "ok",
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.25.0 🦕\"}"
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.26.0 🦕\"}"
}
],
"files": ["hello.ts", "bootstrap", "amz-deno"]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"expected": [
{
"status": "ok",
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.25.0 🦕\"}"
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.26.0 🦕\"}"
},
{
"status": "ok",
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.25.0 🦕\"}"
"content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.26.0 🦕\"}"
}
],
"files": ["hello.ts"],
Expand Down

0 comments on commit 720fa16

Please sign in to comment.