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
| FROM public.ecr.aws/docker/library/python:3.13-slim | |
| COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.9.1 /lambda-adapter /opt/extensions/lambda-adapter | |
| ENV PORT=8000 | |
| # Copies requirements.txt file into the container | |
| COPY requirements.txt . | |
| # Installs dependencies found in your requirements.txt file | |
| RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" |
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
| { | |
| "identity":"None", | |
| "result":"None", | |
| "request":{ | |
| "headers": { | |
| "x-forwarded-for": "1.1.1.1, 2.2.2.2", | |
| "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36", | |
| }, | |
| "domainName":"None" | |
| }, |
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
| import aws_cdk.aws_logs as logs | |
| from aws_cdk import ( | |
| aws_appsync as appsync, | |
| ) | |
| from aws_cdk import ( | |
| aws_iam as iam, | |
| ) | |
| from aws_cdk import ( | |
| aws_wafv2 as wafv2, | |
| ) |
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
| from __future__ import annotations | |
| from typing import Any | |
| from aws_lambda_env_modeler import init_environment_variables | |
| from aws_lambda_powertools.event_handler import AppSyncEventsResolver | |
| from aws_lambda_powertools.event_handler.events_appsync.exceptions import UnauthorizedException | |
| from aws_lambda_powertools.logging import Logger | |
| from aws_lambda_powertools.metrics import Metrics, MetricUnit | |
| from aws_lambda_powertools.tracing import Tracer |
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
| # ✅ AWS Lambda Security Checklist | |
| A practical checklist to help developers write secure AWS Lambda functions—without needing to be security experts. | |
| --- | |
| ## 🔐 Input Validation | |
| - [ ] Validate and sanitize all incoming event data at the start of the handler. | |
| - [ ] Use strict schemas (e.g., Pydantic for Python) and whitelisting. | |
| - [ ] Avoid relying solely on frontend validation. |
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
| 5 Serverless Architecture Patterns You Should Stop Using (And What to Do Instead) | |
| https://www.ranthebuilder.cloud/post/five-serverless-patterns-you-shouldn-t-use | |
| AWS Lambda Handler Cookbook: | |
| https://github.com/ran-isenberg/aws-lambda-handler-cookbook | |
| AWS Lambda MCP Cookbook: | |
| https://github.com/ran-isenberg/aws-lambda-mcp-cookbook | |
| Hexagonal Architecture: |
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
| import json | |
| from aws_cdk import ( | |
| aws_fms as fms, | |
| aws_wafv2 as wafv2 | |
| ) | |
| from constructs import Construct | |
| class CentralizedFirewallManagerConstruct(Construct): | |
| def __init__(self, scope: Construct, id_: str) -> None: |
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
| Serverless service backend blueprint: https://github.com/ran-isenberg/aws-lambda-handler-cookbook | |
| Deep dive into the blueprint: https://www.youtube.com/watch?v=reWSpioKaUM | |
| Awesome Serverless Bluepirnts: | |
| https://github.com/ran-isenberg/awesome-serverless-blueprints | |
| Automate IAM trust open source / SaaS control plane automation Article: | |
| https://github.com/ran-isenberg/auto-cross-account-access-service | |
| https://aws.amazon.com/blogs/mt/serverless-governance-of-software-deployed-with-aws-service-catalog/ |
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
| import { Amplify } from 'aws-amplify'; | |
| import { events } from 'aws-amplify/data'; | |
| // set your API endpoint and API key | |
| Amplify.configure({ | |
| "API": { | |
| "Events": { | |
| "endpoint": "https://<YOUR_APPSYNC_ENDPOINT>/event", | |
| "region": "us-east-1", | |
| "defaultAuthMode": "apiKey", |
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
| { | |
| 'headers': { | |
| 'Host': 'asasasas.execute-api.us-east-1.amazonaws.com', | |
| 'x-api-key': '', | |
| 'X-Forwarded-For': '', | |
| 'x-restapi': '' | |
| }, | |
| 'multiValueHeaders': { | |
| 'Host': ['asasasas.execute-api.us-east-1.amazonaws.com'], | |
| 'x-api-key': [''], |
NewerOlder