-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from hayd/amazonlinux2
Update provided runtime to al2
- Loading branch information
Showing
44 changed files
with
215 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Test | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: denolib/setup-deno@master | ||
with: | ||
deno-version: 1.6.0 | ||
- name: Run fmt | ||
run: | | ||
deno fmt --check | ||
- name: Run lint | ||
run: | | ||
deno lint --unstable hello.ts tests | ||
deno lint --unstable examples-aws-cdk | ||
deno lint --unstable example-sam --ignore=example-sam/.aws-sam | ||
deno lint --unstable example-serverless --ignore=example-serverless/node_modules,example-serverless/.deno_dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
.serverless | ||
node_modules | ||
package-lock.json | ||
*.zip | ||
*.zip | ||
example-sam/.aws-sam/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env node | ||
import 'source-map-support/register'; | ||
import * as cdk from '@aws-cdk/core'; | ||
import { ExampleAwsCdkStack } from '../cdk/example-aws-cdk-stack'; | ||
import "source-map-support/register"; | ||
import * as cdk from "@aws-cdk/core"; | ||
import { ExampleAwsCdkStack } from "../cdk/example-aws-cdk-stack"; | ||
|
||
const app = new cdk.App(); | ||
new ExampleAwsCdkStack(app, 'ExampleAwsCdkStack'); | ||
new ExampleAwsCdkStack(app, "ExampleAwsCdkStack"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,37 @@ | ||
import * as cdk from '@aws-cdk/core'; | ||
import * as lambda from '@aws-cdk/aws-lambda'; | ||
import * as apigw from '@aws-cdk/aws-apigateway'; | ||
import { CfnApplication } from '@aws-cdk/aws-sam' | ||
import * as cdk from "@aws-cdk/core"; | ||
import * as lambda from "@aws-cdk/aws-lambda"; | ||
import * as apigw from "@aws-cdk/aws-apigateway"; | ||
import { CfnApplication } from "@aws-cdk/aws-sam"; | ||
|
||
export class ExampleAwsCdkStack extends cdk.Stack { | ||
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { | ||
super(scope, id, props); | ||
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { | ||
super(scope, id, props); | ||
|
||
const denoRuntime = new CfnApplication(this, "DenoRuntime", { | ||
location: { | ||
applicationId: | ||
"arn:aws:serverlessrepo:us-east-1:390065572566:applications/deno", | ||
semanticVersion: "1.6.1", | ||
}, | ||
}); | ||
|
||
const denoRuntime = new CfnApplication(this, 'DenoRuntime', { | ||
location: { | ||
applicationId: 'arn:aws:serverlessrepo:us-east-1:390065572566:applications/deno', | ||
semanticVersion: '1.6.0' | ||
} | ||
}); | ||
// Deno Layer | ||
const layer = lambda.LayerVersion.fromLayerVersionArn( | ||
this, | ||
"denoRuntimeLayer", | ||
denoRuntime.getAtt("Outputs.LayerArn").toString(), | ||
); | ||
|
||
// Deno Layer | ||
const layer = lambda.LayerVersion.fromLayerVersionArn(this, 'denoRuntimeLayer', denoRuntime.getAtt('Outputs.LayerArn').toString()) | ||
const name = new lambda.Function(this, "HelloHandler", { | ||
runtime: lambda.Runtime.PROVIDED_AL2, | ||
code: lambda.Code.fromAsset("src"), | ||
handler: "hello.handler", | ||
layers: [layer], | ||
}); | ||
|
||
const name = new lambda.Function(this, 'HelloHandler', { | ||
runtime: lambda.Runtime.PROVIDED, | ||
code: lambda.Code.fromAsset('src'), | ||
handler: 'hello.handler', | ||
layers: [layer], | ||
}) | ||
|
||
// API Gateway | ||
new apigw.LambdaRestApi(this, 'Endpoint', { | ||
handler: name | ||
}); | ||
|
||
} | ||
// API Gateway | ||
new apigw.LambdaRestApi(this, "Endpoint", { | ||
handler: name, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { | ||
APIGatewayProxyEvent, | ||
APIGatewayProxyResult, | ||
Context | ||
APIGatewayProxyEvent, | ||
APIGatewayProxyResult, | ||
Context, | ||
} from "https://deno.land/x/lambda/mod.ts"; | ||
|
||
export async function handler( | ||
event: APIGatewayProxyEvent, | ||
context: Context, | ||
event: APIGatewayProxyEvent, | ||
context: Context, | ||
): Promise<APIGatewayProxyResult> { | ||
return { | ||
statusCode: 200, | ||
headers: { "content-type": "text/html;charset=utf8" }, | ||
body: `Hello World! Sent from AWS CDK deno ${Deno.version.deno} 🦕`, | ||
}; | ||
} | ||
return { | ||
statusCode: 200, | ||
headers: { "content-type": "text/html;charset=utf8" }, | ||
body: `Hello World! Sent from AWS CDK deno ${Deno.version.deno} 🦕`, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { DynamoDBClient, createClient } from "./deps.ts"; | ||
import { createClient, DynamoDBClient } from "./deps.ts"; | ||
|
||
export const client: DynamoDBClient = createClient(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.