Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Deploy examples on Amazon Linux 2 #57

Merged
merged 4 commits into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
COLOR ?= auto
CARGO = cargo --color $(COLOR)
BUILDER = ewbankkit/rust-amazonlinux:1.45.0-2018.03.0.20200602.1
BUILDER = ewbankkit/rust-amazonlinux:1.45.2-2.0.20200722.0

.PHONY: all build check clean doc fmt release test update

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This workspace includes multiple crates:

## Build

Build a binary suitable for running on Amazon Linux using a [builder image](https://hub.docker.com/repository/docker/ewbankkit/rust-amazonlinux):
Build a binary suitable for running on Amazon Linux 2 using a [builder image](https://hub.docker.com/repository/docker/ewbankkit/rust-amazonlinux):

```console
$ make release
Expand Down
6 changes: 3 additions & 3 deletions examples/apigw/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
}

provider "aws" {
version = ">= 2.59.0"
version = ">= 3.3.0"
}

//
Expand Down Expand Up @@ -35,7 +35,7 @@ resource "aws_apigatewayv2_api" "example" {
//

data "aws_lambda_layer_version" "slim" {
layer_name = "wascc-slim"
layer_name = "wascc-slim-al2"
}

resource "aws_lambda_function" "example" {
Expand All @@ -44,7 +44,7 @@ resource "aws_lambda_function" "example" {
function_name = "waSCC-example-apigw"
role = aws_iam_role.example.arn
handler = "doesnt.matter"
runtime = "provided"
runtime = "provided.al2"
memory_size = 256
timeout = 90

Expand Down
6 changes: 3 additions & 3 deletions examples/custom/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
}

provider "aws" {
version = ">= 2.50.0"
version = ">= 3.3.0"
}

//
Expand All @@ -25,7 +25,7 @@ data "aws_region" "current" {}
//

data "aws_lambda_layer_version" "slim" {
layer_name = "wascc-slim"
layer_name = "wascc-slim-al2"
}

resource "aws_lambda_function" "example" {
Expand All @@ -34,7 +34,7 @@ resource "aws_lambda_function" "example" {
function_name = "waSCC-example-custom"
role = aws_iam_role.example.arn
handler = "doesnt.matter"
runtime = "provided"
runtime = "provided.al2"
memory_size = 256
timeout = 90

Expand Down
2 changes: 1 addition & 1 deletion layers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Build and deploy Lambda layers for the waSCC runtime.

* `wascc-slim` contains just the custom runtime binary (`bootstrap`).
* `wascc-slim` contains just the custom runtime binary (`bootstrap`). This layer is compatible with the [custom runtime](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html) based on Amazon Linux 2.

### Deploy

Expand Down
6 changes: 3 additions & 3 deletions layers/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ terraform {
}

provider "aws" {
version = ">= 2.50.0"
version = ">= 3.3.0"
}

//
// Layers.
//

resource "aws_lambda_layer_version" "slim" {
layer_name = "wascc-slim"
layer_name = "wascc-slim-al2"
description = "waSCC custom runtime (slim)"

filename = "${path.module}/slim.zip"
source_code_hash = filebase64sha256("${path.module}/slim.zip")

compatible_runtimes = ["provided"]
compatible_runtimes = ["provided.al2"]
}

//
Expand Down