-
Notifications
You must be signed in to change notification settings - Fork 2
/
serverless.yml
57 lines (52 loc) · 1.33 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
service: spring-cloud-function-aws-iw
provider:
name: aws
runtime: java8
region: us-east-1
memory: 1024
timeout: 20
iamRoleStatements:
- Effect: 'Allow'
Action:
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource:
Fn::Join:
- ""
- - "arn:aws:dynamodb:::"
- "Ref" : "DynamoDBRes"
# jar file that will be uploaded and executed on AWS
package:
artifact: target/iw-aws-lambda-blog-1-shaded.jar
#define Lambda function
functions:
createStudent:
handler: org.springframework.cloud.function.adapter.aws.SpringBootStreamHandler
events: # api gateway
- http:
path: student
method: post
cors: true
environment: # environment variables
FUNCTION_NAME: createStudent
# cloud formation
resources:
Resources:
DynamoDBRes:
Type: AWS::DynamoDB::Table
Properties:
AttributeDefinitions:
- AttributeName: "uuid"
AttributeType: "S"
KeySchema:
- AttributeName: "uuid"
KeyType: "HASH"
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: student