Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
102 lines (91 sloc) 2.15 KB
service: ahv-council-mailer
provider:
name: aws
runtime: nodejs8.10
stage: ${opt:stage}
region: us-west-2
environment: ${file(env.${opt:stage}.yml)}
iamRoleStatements:
- Effect: "Allow"
Action:
- "ses:SendEmail"
Resource: "*"
- Effect: "Allow"
Action:
- "s3:GetBucketLocation"
- "s3:GetObject"
- "s3:ListBucket"
- "s3:ListBucketMultipartUploads"
- "s3:ListMultipartUploadParts"
- "s3:AbortMultipartUpload"
- "s3:PutObject"
Resource:
- arn:aws:s3:::${file(env.${opt:stage}.yml):S3_LOGGING_BUCKET}
- arn:aws:s3:::${file(env.${opt:stage}.yml):S3_LOGGING_BUCKET}/*
- Effect: "Allow"
Action:
- "glue:GetTable"
Resource: "*"
- Effect: "Allow"
Action:
- "athena:*"
Resource: "*"
- Effect: 'Allow'
Action:
- "sns:Publish"
Resource:
- ${self:custom.ahvSlashTaskQueue}
custom:
ahvSlashTaskQueue:
Fn::Join:
- ":"
-
- "arn:aws:sns"
- Ref: AWS::Region
- Ref: AWS::AccountId
- ahvSlashTasks
resources:
Conditions:
CreateS3Bucket:
Fn::Not:
- Fn::Equals:
- ${file(env.${opt:stage}.yml):S3_LOGGING_BUCKET}
- ""
Resources:
S3LoggingBucket:
Type: "AWS::S3::Bucket"
Condition: "CreateS3Bucket"
Properties:
BucketName: ${file(env.${opt:stage}.yml):S3_LOGGING_BUCKET}
functions:
createLetter:
handler: src/createLetter.entryPoint
events:
- http:
path: submit
method: post
private: false
cors: true
approveLetter:
handler: src/approveLetter.entryPoint
events:
- http:
path: approve
method: post
private: false
slash:
handler: src/slash.invokeSlashCommand
events:
- http:
path: slash
method: post
private: false
environment:
SLASH_TOPIC: ${self:custom.ahvSlashTaskQueue}
processSlashCommand:
handler: src/slash.processSlashCommand
events:
- sns: ahvSlashTasks
timeout: 180
plugins:
- serverless-mocha-plugin
You can’t perform that action at this time.