-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
46 lines (41 loc) · 1.27 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
# This file is the main config file for your Serverless lambda.
service: angryhuman-rss-generator
provider:
name: aws
stage: dev
region: ${file(./config.yml):region}
runtime: nodejs4.3
memorySize: 128
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:ListBucket"
Resource: { "Fn::Join" : ["", ["arn:aws:s3:::", { "Ref" : "DataBucket"} ]] }
- Effect: "Allow"
Action:
- "s3:PutObject"
- "s3:GetObject"
- "s3:PutObjectAcl"
Resource: { "Fn::Join" : ["", ["arn:aws:s3:::", { "Ref" : "DataBucket"}, "/*" ]] }
custom:
myStage: ${opt:stage, self:provider.stage}
functions:
generaterss:
name: ${self:custom.myStage}-generaterss
description: Generates RSS feed for angry human podcast in ${self:custom.myStage}
handler: handler.generaterss
events:
- schedule: ${file(./config.yml):globalSchedule}
resources:
Resources:
DataBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${file(./config.yml):bucket}
AccessControl: PublicRead
WebsiteConfiguration:
IndexDocument: index.html
Outputs:
WebsiteURL:
Value: { "Fn::GetAtt" : [ "DataBucket", "WebsiteURL" ] }
Description: URL for the website hosted on S3