Skip to content

Commit

Permalink
files for deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
keryc committed Jun 2, 2021
1 parent 5d9a08f commit af7fd61
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
3 changes: 2 additions & 1 deletion botmaker_message/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ def botmaker_message(event, context):
botmaker.save()
if SANDBOX_MODE and SANDBOX_URL:
try:
auth_bm_token = event['headers'].get('auth-bm-token', '')
requests.post(
SANDBOX_URL,
json=payload,
headers=event['headers']
headers={"auth-bm-token": auth_bm_token}
)
except Exception as e:
pass
Expand Down
60 changes: 31 additions & 29 deletions packaged.yaml
Original file line number Diff line number Diff line change
@@ -1,56 +1,58 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: 'omni-serverless
Sample SAM Template for omni-serverless
'
Globals:
Function:
Timeout: 3
Outputs:
BotmakerMessageApi:
Description: Api Botmaker Message
Value:
Fn::Sub: https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/botmaker/message
CuencaShippingApi:
Description: Api Cuenca Shipping
Value:
Fn::Sub: https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/cuenca-shipping/address
Timeout: 5
Resources:
BotmakerMessageFunction:
CuencaShippingFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://omni-serverless.cuenca.io/3c754f49836826d39576ac79e938db4f
CodeUri: s3://omni-serverless.cuenca.io/64b65d2f3f116974bbd59fc6eb214384
Handler: app.cuenca_shipping
Runtime: python3.7
Environment:
Variables:
MONGO_URI: mongodb://0.0.0.0:27017/
CORS_ORIGIN: http://0.0.0.0:9000
Events:
CuencaShipping:
Type: Api
Properties:
Path: /cuenca-shipping/address
Method: post
Path: /botmaker/message
CuencaShippingCors:
Type: Api
Handler: app.lambda_handler
Runtime: python3.7
Properties:
Path: /cuenca-shipping/address
Method: options
BotmakerMessageFunction:
Type: AWS::Serverless::Function
CuencaShippingFunction:
Properties:
CodeUri: s3://omni-serverless.cuenca.io/1d6d365d1f6474104b15ab6918fea368
CodeUri: s3://omni-serverless.cuenca.io/a42dcc73f0519a51768522afdc413f5e
Handler: app.botmaker_message
Runtime: python3.7
Environment:
Variables:
CORS_ORIGIN: http://0.0.0.0:9000
MONGO_URI: mongodb://0.0.0.0:27017/
SANDBOX_MODE: false
SANDBOX_URL: https://example.com
Events:
CuencaShipping:
Properties:
Method: post
Path: /cuenca-shipping/address
Type: Api
CuencaShippingCors:
Properties:
Method: options
Path: /cuenca-shipping/address
Type: Api
Handler: app.lambda_handler
Runtime: python3.7
Type: AWS::Serverless::Function
Transform: AWS::Serverless-2016-10-31
Path: /botmaker/message
Method: post
Outputs:
CuencaShippingApi:
Description: Api Cuenca Shipping
Value:
Fn::Sub: https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/cuenca-shipping/address
BotmakerMessageApi:
Description: Api Botmaker Message
Value:
Fn::Sub: https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/botmaker/message

0 comments on commit af7fd61

Please sign in to comment.