Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
98 lines (91 sloc) 2.33 KB
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
#
# Happy Coding!
service: aws-python # NOTE: update this with your service name
provider:
name: aws
runtime: python2.7
# you can overwrite defaults here
# stage: dev
# region: us-east-1
# you can add statements to the Lambda function's IAM Role here
iamRoleStatements:
- Effect: "Allow"
Action:
- "logs:CreateLogGroup"
- "logs:CreateLogStream"
- "logs:PutLogEvents"
Resource: "arn:aws:logs:*:*:*"
- Effect: "Allow"
Action:
- "s3:GetObject"
- "s3:PutObject"
Resource:
- {
"Fn::Join": [
"",
[
"arn:aws:s3:::",
{
"Ref": "RdsLogs"
},
"/*"
]
]
}
- Effect: "Allow"
Action:
- "s3:ListBucket"
Resource:
- {
"Fn::Join": [
"",
[
"arn:aws:s3:::",
{
"Ref": "RdsLogs"
}
]
]
}
- Effect: "Allow"
Action:
- "rds:DescribeDBLogFiles"
- "rds:DownloadDBLogFilePortion"
Resource:
- "*"
functions:
rdsMysqltoS3:
handler: rdslogs.rds_mysql_to_s3.hello
# The following are a few example events you can configure
# NOTE: Please make sure to change your handler code to work with those events
# Check the event documentation for details
# events:
# - http:
# path: users/create
# method: get
# - s3: ${env:BUCKET}
# - schedule: rate(10 minutes)
# - sns: greeter-topic
# - stream: arn:aws:dynamodb:region:XXXXXX:table/foo/stream/1970-01-01T00:00:00.000
# you can add CloudFormation resource templates here
resources:
Resources:
RdsLogs:
Type: AWS::S3::Bucket
Properties:
BucketName: rds-mysql-logs-${env:FUNC_PREFIX}
Outputs:
RdsLogs:
Description: "RDS Log Bucket"
Value:
Ref: "RdsLogs"