Skip to content

Commit

Permalink
feat: Deploy backend api gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysiekb committed Dec 28, 2023
1 parent bc78455 commit 6e8a818
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions backend/backend_stack.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
from aws_cdk import Stack, aws_lambda
from aws_cdk import Stack, aws_lambda, aws_apigateway
from constructs import Construct


class BackendStack(Stack):
def __init__(self, scope: Construct, id: str, **kwargs):
super().__init__(scope, id, **kwargs)

aws_lambda.Function(
backend_lambda = aws_lambda.Function(
scope=self,
id="ChatbotBackendLambda",
runtime=aws_lambda.Runtime.PYTHON_3_11,
handler="backend_lambda.handler",
code=aws_lambda.Code.from_asset("backend/lambda"),
)

backend_apigw = aws_apigateway.LambdaRestApi(
scope=self,
id="ChatbotBackendAPI",
handler=backend_lambda,
)

chatbot_res = backend_apigw.root.add_resource("chatbot")

chatbot_res.add_method("GET")
chatbot_res.add_method("POST")

0 comments on commit 6e8a818

Please sign in to comment.