81 lines
2.2 KiB
YAML
81 lines
2.2 KiB
YAML
service: vxTwitter
|
|
|
|
provider:
|
|
name: aws
|
|
runtime: python3.12
|
|
stage: dev
|
|
architecture: arm64
|
|
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, '#1DA1F2'}
|
|
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'}
|
|
VXTWITTER_GIF_CONVERT_API: ${env:VXTWITTER_GIF_CONVERT_API, ''}
|
|
VXTWITTER_WORKAROUND_TOKENS: ${env:VXTWITTER_WORKAROUND_TOKENS, ''}
|
|
#VXTWITTER_PROXIES: ${env:VXTWITTER_PROXIES, ''}
|
|
|
|
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: 15
|
|
memorySize: 500
|
|
layers:
|
|
- Ref: PythonRequirementsLambdaLayer
|
|
|
|
|
|
custom:
|
|
tableName: 'tweets-table-${self:provider.stage}'
|
|
wsgi:
|
|
app: twitfix.app
|
|
pythonRequirements:
|
|
layer: true
|
|
dockerizePip: true
|
|
dockerRunCmdExtraArgs: ['--platform','linux/arm64']
|
|
|
|
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 |