Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
giuseppe-trisciuoglio avatar

Aws Lambda Php Integration

  • 1.4k installs
  • 311 repo stars
  • Updated June 22, 2026
  • giuseppe-trisciuoglio/developer-kit

aws-lambda-php-integration is an agent skill for provides aws lambda integration patterns for php with symfony using the bref framework. creates lambda handler classes, configures runtime layers, sets up sqs/sns event.

About

The aws-lambda-php-integration skill is designed for provides AWS Lambda integration patterns for PHP with Symfony using the Bref framework. Creates Lambda handler classes, configures runtime layers, sets up SQS/SNS event. AWS Lambda PHP Integration Patterns for deploying PHP and Symfony applications on AWS Lambda using the Bref framework. Project Structure Symfony with Bref Structure Raw PHP Structure 3. Invoke when the user deploying PHP/Symfony applications to AWS Lambda, configuring API Gateway integration, implementing serverless PHP applications, or optimizing Lambda performance with Bref.

  • Bref Framework - Standard PHP on Lambda with Symfony support, built-in routing, cold start < 2s.
  • Raw PHP - Minimal overhead, maximum control, cold start < 500ms.
  • Creating new Lambda functions in PHP.
  • Migrating existing Symfony applications to Lambda.
  • Optimizing cold start performance.

Aws Lambda Php Integration by the numbers

  • 1,436 all-time installs (skills.sh)
  • +55 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #327 of 4,386 Backend & APIs skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

aws-lambda-php-integration capabilities & compatibility

Capabilities
bref framework standard php on lambda with sym · raw php minimal overhead, maximum control, col · creating new lambda functions in php · migrating existing symfony applications to lambd
From the docs

What aws-lambda-php-integration says it does

Provides AWS Lambda integration patterns for PHP with Symfony using the Bref framework. Creates Lambda handler classes, configures runtime layers, sets up SQS/SNS event triggers, i
SKILL.md
Provides AWS Lambda integration patterns for PHP with Symfony using the Bref framework. Creates Lambda handler classes, configures runtime layers, sets up SQS/S
SKILL.md
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill aws-lambda-php-integration

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.4k
repo stars311
Security audit3 / 3 scanners passed
Last updatedJune 22, 2026
Repositorygiuseppe-trisciuoglio/developer-kit

How do I provides aws lambda integration patterns for php with symfony using the bref framework. creates lambda handler classes, configures runtime layers, sets up sqs/sns event?

Provides AWS Lambda integration patterns for PHP with Symfony using the Bref framework. Creates Lambda handler classes, configures runtime layers, sets up SQS/SNS event.

Who is it for?

Developers using aws lambda php integration workflows documented in SKILL.md.

Skip if: Skip when the task falls outside aws-lambda-php-integration scope or needs a different stack.

When should I use this skill?

User deploying PHP/Symfony applications to AWS Lambda, configuring API Gateway integration, implementing serverless PHP applications, or optimizing Lambda performance with Bref.

What you get

Completed aws-lambda-php-integration workflow with documented commands, files, and expected deliverables.

  • Lambda memory and timeout configuration
  • Optimized composer.json
  • Error-handling and logging checklist

By the numbers

  • Recommends 512MB memory for Symfony and 256MB for raw PHP on Lambda
  • Documents PHP ^8.2, bref/bref ^2.0, and Symfony ^6.0 in example composer.json

Files

SKILL.mdMarkdownGitHub ↗

AWS Lambda PHP Integration

Patterns for deploying PHP and Symfony applications on AWS Lambda using the Bref framework.

Overview

Two approaches available:

  • Bref Framework - Standard PHP on Lambda with Symfony support, built-in routing, cold start < 2s
  • Raw PHP - Minimal overhead, maximum control, cold start < 500ms

Both support API Gateway integration with production-ready configurations.

When to Use

  • Creating new Lambda functions in PHP
  • Migrating existing Symfony applications to Lambda
  • Optimizing cold start performance
  • Configuring API Gateway or SQS/SNS event triggers
  • Setting up deployment pipelines for PHP Lambda

Instructions

1. Choose Your Approach

ApproachCold StartBest ForComplexity
Bref< 2sSymfony apps, full-featured APIsMedium
Raw PHP< 500msSimple handlers, maximum controlLow

2. Project Structure

Symfony with Bref Structure
my-symfony-lambda/
├── composer.json
├── serverless.yml
├── public/
│   └── index.php         # Lambda entry point
├── src/
│   └── Kernel.php        # Symfony Kernel
├── config/
│   ├── bundles.php
│   ├── routes.yaml
│   └── services.yaml
└── templates/
Raw PHP Structure
my-lambda-function/
├── public/
│   └── index.php         # Handler entry point
├── composer.json
├── serverless.yml
└── src/
    └── Services/

3. Implementation

Symfony with Bref:

// public/index.php
use Bref\Symfony\Bref;
use App\Kernel;
use Symfony\Component\HttpFoundation\Request;

require __DIR__.'/../vendor/autoload.php';

$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? true);
$kernel->boot();

$bref = new Bref($kernel);
return $bref->run($event, $context);

Raw PHP Handler:

// public/index.php
use function Bref\Lambda\main;

main(function ($event) {
    $path = $event['path'] ?? '/';
    $method = $event['httpMethod'] ?? 'GET';

    return [
        'statusCode' => 200,
        'body' => json_encode(['message' => 'Hello from PHP Lambda!'])
    ];
});

4. Cold Start Optimization

1. Lazy loading - Defer heavy services until needed 2. Disable unused Symfony features - Turn off validation, annotations 3. Optimize composer autoload - Use classmap for production 4. Use Bref optimized runtime - Leverage PHP 8.x optimizations

5. Connection Management

// Cache AWS clients at function level
use Aws\DynamoDb\DynamoDbClient;

class DatabaseService
{
    private static ?DynamoDbClient $client = null;

    public static function getClient(): DynamoDbClient
    {
        if (self::$client === null) {
            self::$client = new DynamoDbClient([
                'region' => getenv('AWS_REGION'),
                'version' => 'latest'
            ]);
        }
        return self::$client;
    }
}

Best Practices

Memory and Timeout

  • Memory: Start with 512MB for Symfony, 256MB for raw PHP
  • Timeout: Symfony 10-30s for cold start buffer, Raw PHP 3-10s typically sufficient

Dependencies

{
    "require": {
        "php": "^8.2",
        "bref/bref": "^2.0",
        "symfony/framework-bundle": "^6.0"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist"
    }
}

Error Handling

try {
    $result = processRequest($event);
    return [
        'statusCode' => 200,
        'body' => json_encode($result)
    ];
} catch (ValidationException $e) {
    return [
        'statusCode' => 400,
        'body' => json_encode(['error' => $e->getMessage()])
    ];
} catch (Exception $e) {
    error_log($e->getMessage());
    return [
        'statusCode' => 500,
        'body' => json_encode(['error' => 'Internal error'])
    ];
}

Logging

error_log(json_encode([
    'level' => 'info',
    'message' => 'Request processed',
    'request_id' => $context->getAwsRequestId(),
    'path' => $event['path'] ?? '/'
]));

Deployment

Serverless Configuration

# serverless.yml
service: symfony-lambda-api

provider:
  name: aws
  runtime: php-82
  memorySize: 512
  timeout: 20

package:
  individually: true
  exclude:
    - '**/node_modules/**'
    - '**/.git/**'

functions:
  api:
    handler: public/index.php
    events:
      - http:
          path: /{proxy+}
          method: ANY

Deploy and Validate

# 1. Install Bref
composer require bref/bref --dev

# 2. Test locally (validate before deploy)
sam local invoke -e event.json

# 3. Deploy
vendor/bin/bref deploy

# 4. Verify deployment
aws lambda invoke --function-name symfony-lambda-api-api \
  --payload '{"path": "/", "httpMethod": "GET"}' /dev/stdout

Symfony Full Configuration

# serverless.yml for Symfony
service: symfony-lambda-api

provider:
  name: aws
  runtime: php-82
  stage: ${self:custom.stage}
  region: ${self:custom.region}
  environment:
    APP_ENV: ${self:custom.stage}
    APP_DEBUG: ${self:custom.isLocal}
  iam:
    role:
      statements:
        - Effect: Allow
          Action:
            - dynamodb:GetItem
            - dynamodb:PutItem
          Resource: '*'

functions:
  web:
    handler: public/index.php
    timeout: 30
    memorySize: 1024
    events:
      - http:
          path: /{proxy+}
          method: ANY

  console:
    handler: bin/console
    timeout: 300
    events:
      - schedule: rate(1 day)

plugins:
  - ./vendor/bref/bref

custom:
  stage: dev
  region: us-east-1
  isLocal: false

Constraints and Warnings

Lambda Limits

  • Deployment package: 250MB unzipped maximum (50MB zipped)
  • Memory: 128MB to 10GB
  • Timeout: 29 seconds (API Gateway), 15 minutes for async
  • Concurrent executions: 1000 default

PHP-Specific Considerations

  • Cold start: PHP has moderate cold start; use Bref for optimized runtimes
  • Dependencies: Keep composer.json minimal; use Lambda Layers for shared deps
  • PHP version: Use PHP 8.2+ for best Lambda performance
  • No local storage: Lambda containers are ephemeral; use S3/DynamoDB for persistence

Common Pitfalls

1. Large vendor folder - Exclude dev dependencies; use --no-dev 2. Session storage - Don't use local file storage; use DynamoDB 3. Long-running processes - Not suitable for Lambda; use ECS instead 4. Websockets - Use API Gateway WebSockets or AppSync instead

Security Considerations

  • Never hardcode credentials; use IAM roles and SSM Parameter Store
  • Validate all input data
  • Use least privilege IAM policies
  • Enable CloudTrail for audit logging
  • Set proper CORS headers

Examples

Example 1: Create a Symfony Lambda API

Input: "Create a Symfony Lambda REST API using Bref for a todo application"

Process: 1. Initialize Symfony project with composer create-project 2. Install Bref: composer require bref/bref 3. Configure serverless.yml 4. Set up routes in config/routes.yaml 5. Test locally: sam local invoke 6. Deploy: vendor/bin/bref deploy 7. Verify: aws lambda invoke --function-name <name> --payload '{}'

Output: Complete Symfony project structure with REST API, DynamoDB integration, deployment configuration

Example 2: Optimize Cold Start for Symfony

Input: "My Symfony Lambda has 5 second cold start, how do I optimize it?"

Process: 1. Analyze services loaded at startup 2. Disable unused Symfony features (validation, annotations) 3. Use lazy loading for heavy services 4. Optimize composer autoload 5. Measure: Deploy and invoke to verify cold start < 2s

Output: Refactored Symfony configuration with cold start < 2s

Example 3: Deploy with GitHub Actions

Input: "Configure CI/CD for Symfony Lambda with Serverless Framework"

Process: 1. Create GitHub Actions workflow 2. Set up PHP environment with composer 3. Run PHPUnit tests 4. Deploy with Serverless Framework 5. Validate: Check Lambda function exists and responds

Output: Complete .github/workflows/deploy.yml with multi-stage pipeline and test automation

References

  • [Bref Lambda](references/bref-lambda.md) - Complete Bref setup, Symfony integration, routing
  • [Raw PHP Lambda](references/raw-php-lambda.md) - Minimal handler patterns, caching, packaging
  • [Serverless Deployment](references/serverless-deployment.md) - Serverless Framework, SAM, CI/CD pipelines
  • [Testing Lambda](references/testing-lambda.md) - PHPUnit, SAM Local, integration testing

Related skills

Forks & variants (1)

Aws Lambda Php Integration has 1 known copy in the catalog totaling 20 installs. They canonicalize to this original listing.

How it compares

Use for Bref-specific PHP Lambda sizing and packaging when generic AWS Lambda guides omit Symfony cold-start and Composer deployment limits.

FAQ

What does aws-lambda-php-integration do?

Provides AWS Lambda integration patterns for PHP with Symfony using the Bref framework. Creates Lambda handler classes, configures runtime layers, sets up SQS/SNS event.

When should I use aws-lambda-php-integration?

User deploying PHP/Symfony applications to AWS Lambda, configuring API Gateway integration, implementing serverless PHP applications, or optimizing Lambda performance with Bref.

Is aws-lambda-php-integration safe to install?

Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.