BetterTwitFix/serverless.yml
Dylan 0ed2902284 Squashed commit of the following:
commit 519bd76dd5fde9dd58c3586cb19a43c2e5f1b4c0
Merge: 56046a0 1e27ad4
Author: Dylan <dylanpdx@gmail.com>
Date:   Wed Dec 7 02:06:06 2022 +0000

    Merge branch 'main' into prod

commit 56046a02b6d3f9a07c9067151c0a304e075c545c
Author: Dylan <dylanpdx@gmail.com>
Date:   Wed Dec 7 01:09:10 2022 +0000

    Updated serverless in package-lock

commit ee1b0442683729c2123174a571a5f75bb0c668f6
Merge: aea2a2c 0739f71
Author: Dylan <dylanpdx@gmail.com>
Date:   Wed Dec 7 00:52:41 2022 +0000

    Merge branch 'main' into prod

commit aea2a2cb2cbd3bbbe9c7cc857a1c5a2258e005cf
Author: Dylan <dylanpdx@gmail.com>
Date:   Tue Dec 6 22:59:44 2022 +0000

    Added verbose for debugging

commit d6b61315a9643ae3101bfdeacd14fed4e35599aa
Author: Dylan <dylanpdx@gmail.com>
Date:   Tue Dec 6 22:45:17 2022 +0000

    Added token permissions

commit 40f3b8b3d3befd02e48b79ba8dcde5b5490ed8ff
Author: Dylan <dylanpdx@gmail.com>
Date:   Tue Dec 6 22:42:27 2022 +0000

    Deploy config update

commit 9684cf3faf68ae2aa752d258298c2a75e9ed2a0b
Author: Dylan <dylanpdx@gmail.com>
Date:   Tue Dec 6 19:05:20 2022 +0000

    Updated actions

commit 0ac55ae11b6c2ba55e41b089327f97ed1cd10237
Author: Dylan <dylanpdx@gmail.com>
Date:   Tue Dec 6 19:02:07 2022 +0000

    Updated deploy script

commit 812d99cd778837fb66cbc6eb2b4faa5e8ab63c52
Author: Dylan <dylanpdx@gmail.com>
Date:   Tue Dec 6 18:57:20 2022 +0000

    Add production deploy
2022-12-07 02:07:37 +00:00

77 lines
1.9 KiB
YAML

service: vxTwitter
provider:
name: aws
runtime: python3.8
stage: dev
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource:
- { "Fn::GetAtt": ["vxTwitterDynamoTable", "Arn" ] }
environment:
VXTWITTER_CACHE_TABLE: ${self:custom.tableName}
RUNNING_SERVERLESS: 1
VXTWITTER_LINK_CACHE: ${env:VXTWITTER_LINK_CACHE, 'json'}
VXTWITTER_DATABASE: ${env:VXTWITTER_DATABASE, 'none'}
VXTWITTER_METHOD: ${env:VXTWITTER_METHOD, 'hybrid'}
VXTWITTER_COLOR: ${env:VXTWITTER_COLOR, '#43B581'}
VXTWITTER_APP_NAME: ${env:VXTWITTER_APP_NAME, 'vxTwitter'}
VXTWITTER_REPO: ${env:VXTWITTER_REPO, 'https://github.com/dylanpdx/BetterTwitFix'}
VXTWITTER_URL: ${env:VXTWITTER_URL, 'https://vxtwitter.com'}
VXTWITTER_COMBINATION_METHOD: ${env:VXTWITTER_COMBINATION_METHOD, 'local'}
package:
patterns:
- '!node_modules/**'
- '!venv/**'
plugins:
- serverless-wsgi
- serverless-python-requirements
- serverless-plugin-common-excludes
- serverless-plugin-include-dependencies
functions:
vxTwitterApp:
handler: wsgi_handler.handler
url: true
timeout: 5
memorySize: 150
layers:
- Ref: PythonRequirementsLambdaLayer
custom:
tableName: 'tweets-table-${self:provider.stage}'
wsgi:
app: twitfix.app
pythonRequirements:
layer: true
dockerizePip: false
resources:
Resources:
vxTwitterDynamoTable:
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
-
AttributeName: tweet
AttributeType: S
KeySchema:
-
AttributeName: tweet
KeyType: HASH
TableName: ${self:custom.tableName}
BillingMode: PAY_PER_REQUEST
TimeToLiveSpecification:
AttributeName: ttl
Enabled: true