Last active
January 15, 2021 19:47
-
-
Save metaskills/841c5280c8f480e2d6479705b84af1ce to your computer and use it in GitHub Desktop.
Lambdakiq Lamby Template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: LambdakiqRail | |
Parameters: | |
RailsEnv: | |
Type: String | |
Default: staging | |
AllowedValues: | |
- staging | |
- production | |
Globals: | |
Function: | |
Environment: | |
Variables: | |
RAILS_ENV: !Ref RailsEnv | |
JOBS_QUEUE_NAME: !GetAtt JobsQueue.QueueName | |
Resources: | |
RailsLambda: | |
Type: AWS::Serverless::Function | |
Metadata: | |
DockerContext: ./.lamby/RailsLambda | |
Dockerfile: Dockerfile | |
DockerTag: web | |
Properties: | |
Events: | |
HttpApiProxy: | |
Type: HttpApi | |
Properties: | |
ApiId: !Ref RailsHttpApi | |
TimeoutInMillis: 60000 | |
FunctionName: !Sub lambdakiq-rail-${RailsEnv} | |
MemorySize: 512 | |
PackageType: Image | |
Policies: | |
- ... | |
Timeout: 60 | |
JobsLambda: | |
Type: AWS::Serverless::Function | |
Metadata: | |
DockerContext: ./.lamby/RailsLambda | |
Dockerfile: Dockerfile | |
DockerTag: jobs | |
Properties: | |
Events: | |
SQSJobs: | |
Type: SQS | |
Properties: | |
Queue: !GetAtt JobsQueue.Arn | |
BatchSize: 1 | |
FunctionName: !Sub lambdakiq-jobs-${RailsEnv} | |
MemorySize: 512 | |
PackageType: Image | |
Policies: | |
- ... | |
Timeout: 300 | |
RailsHttpApi: | |
Type: AWS::Serverless::HttpApi | |
Properties: | |
StageName: !Ref RailsEnv | |
JobsQueue: | |
Type: AWS::SQS::Queue | |
Properties: | |
ReceiveMessageWaitTimeSeconds: 10 g. | |
RedrivePolicy: | |
deadLetterTargetArn: !GetAtt JobsDLQueue.Arn | |
maxReceiveCount: 13 | |
VisibilityTimeout: 900 | |
JobsDLQueue: | |
Type: AWS::SQS::Queue | |
Properties: | |
MessageRetentionPeriod: 1209600 | |
Outputs: | |
LambdakiqRailHttpApiUrl: | |
Description: Lambda Invoke URL | |
Value: !Sub https://${RailsHttpApi}.execute-api.${AWS::Region}.amazonaws.com/${RailsEnv}/ | |
LambdakiqRailLambdaResourceArn: | |
Description: Lambda ARN | |
Value: RailsLambda.Arn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment