Skip to content

Commit

Permalink
random-name function
Browse files Browse the repository at this point in the history
  • Loading branch information
mwunderl committed Apr 9, 2020
1 parent 9c670fd commit 2799b02
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 94 deletions.
48 changes: 0 additions & 48 deletions .ebextensions/lambda-function.config

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ bucket-name.txt
lib
_lambda/random-name/node_modules/*
out.yml
node_modules
package-lock.json
5 changes: 5 additions & 0 deletions 2-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
set -eo pipefail
ARTIFACT_BUCKET=$(cat bucket-name.txt)
cd function
rm -rf node_modules
rm -f package-lock.json
npm install --production
cd ../
git archive --format=zip HEAD > package.zip
aws cloudformation package --template-file template.yml --s3-bucket $ARTIFACT_BUCKET --output-template-file out.yml
aws cloudformation deploy --template-file out.yml --stack-name scorekeep --capabilities CAPABILITY_NAMED_IAM
1 change: 0 additions & 1 deletion _lambda/create-random-name.sh

This file was deleted.

1 change: 0 additions & 1 deletion _lambda/delete-random-name.sh

This file was deleted.

36 changes: 0 additions & 36 deletions _lambda/random-name.yml

This file was deleted.

5 changes: 0 additions & 5 deletions _lambda/update-random-name.sh

This file was deleted.

File renamed without changes.
4 changes: 1 addition & 3 deletions _lambda/random-name/package.json → function/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"version": "1.0.0",
"description": "Name generator",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"scripts": {},
"repository": {
"type": "git",
"url": "eb-java-scorekeep"
Expand Down
19 changes: 19 additions & 0 deletions template.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Description: An AWS Elastic application that uses DynamoDB.
Parameters:
emailAddress:
Type: String
Default: UPDATEME
Resources:
function:
Type: AWS::Serverless::Function
Properties:
FunctionName: random-name
Handler: index.handler
Runtime: nodejs12.x
CodeUri: function/.
Description: Generate random names
Timeout: 10
# Function's execution role
Policies:
- AWSLambdaBasicExecutionRole
- AWSXrayWriteOnlyAccess
- AmazonSNSFullAccess
Tracing: Active
Environment:
Variables:
TOPIC_ARN: !Ref notificationTopic
application:
Type: AWS::ElasticBeanstalk::Application
Properties:
Expand Down

0 comments on commit 2799b02

Please sign in to comment.