Skip to content

Commit 2799b02

Browse files
committed
random-name function
1 parent 9c670fd commit 2799b02

File tree

10 files changed

+27
-94
lines changed

10 files changed

+27
-94
lines changed

.ebextensions/lambda-function.config

Lines changed: 0 additions & 48 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ bucket-name.txt
1212
lib
1313
_lambda/random-name/node_modules/*
1414
out.yml
15+
node_modules
16+
package-lock.json

2-deploy.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/bin/bash
22
set -eo pipefail
33
ARTIFACT_BUCKET=$(cat bucket-name.txt)
4+
cd function
5+
rm -rf node_modules
6+
rm -f package-lock.json
7+
npm install --production
8+
cd ../
49
git archive --format=zip HEAD > package.zip
510
aws cloudformation package --template-file template.yml --s3-bucket $ARTIFACT_BUCKET --output-template-file out.yml
611
aws cloudformation deploy --template-file out.yml --stack-name scorekeep --capabilities CAPABILITY_NAMED_IAM

_lambda/create-random-name.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

_lambda/delete-random-name.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

_lambda/random-name.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

_lambda/update-random-name.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"version": "1.0.0",
44
"description": "Name generator",
55
"main": "index.js",
6-
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
8-
},
6+
"scripts": {},
97
"repository": {
108
"type": "git",
119
"url": "eb-java-scorekeep"

template.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
11
AWSTemplateFormatVersion: 2010-09-09
2+
Transform: AWS::Serverless-2016-10-31
23
Description: An AWS Elastic application that uses DynamoDB.
34
Parameters:
45
emailAddress:
56
Type: String
67
Default: UPDATEME
78
Resources:
9+
function:
10+
Type: AWS::Serverless::Function
11+
Properties:
12+
FunctionName: random-name
13+
Handler: index.handler
14+
Runtime: nodejs12.x
15+
CodeUri: function/.
16+
Description: Generate random names
17+
Timeout: 10
18+
# Function's execution role
19+
Policies:
20+
- AWSLambdaBasicExecutionRole
21+
- AWSXrayWriteOnlyAccess
22+
- AmazonSNSFullAccess
23+
Tracing: Active
24+
Environment:
25+
Variables:
26+
TOPIC_ARN: !Ref notificationTopic
827
application:
928
Type: AWS::ElasticBeanstalk::Application
1029
Properties:

0 commit comments

Comments
 (0)