{"id":19289822,"url":"https://github.com/brefphp/constructs","last_synced_at":"2026-02-26T21:06:20.307Z","repository":{"id":97692364,"uuid":"579017633","full_name":"brefphp/constructs","owner":"brefphp","description":"AWS CDK constructs for PHP applications with Bref","archived":false,"fork":false,"pushed_at":"2024-11-24T19:35:08.000Z","size":51,"stargazers_count":28,"open_issues_count":4,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-10T20:34:33.460Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brefphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-16T13:02:33.000Z","updated_at":"2025-04-28T08:55:44.000Z","dependencies_parsed_at":"2025-04-22T05:45:16.220Z","dependency_job_id":"812c32a3-accb-47af-bdf2-67a046f3b437","html_url":"https://github.com/brefphp/constructs","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/brefphp/constructs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brefphp%2Fconstructs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brefphp%2Fconstructs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brefphp%2Fconstructs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brefphp%2Fconstructs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brefphp","download_url":"https://codeload.github.com/brefphp/constructs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brefphp%2Fconstructs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29872677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T21:05:00.265Z","status":"ssl_error","status_checked_at":"2026-02-26T20:57:13.669Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T22:17:18.467Z","updated_at":"2026-02-26T21:06:20.299Z","avatar_url":"https://github.com/brefphp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS CDK constructs for PHP on AWS Lambda\n\nThe [Bref](https://bref.sh/) CDK constructs let you deploy serverless PHP applications on AWS Lambda using the AWS CDK.\n\nBy default, Bref [deploys using the Serverless Framework](https://bref.sh/docs/deploy.html). Using the AWS CDK is an alternative, but be aware that this is an advanced topic. If you are lost, follow the [Bref documentation](https://bref.sh/docs/) instead.\n\n## Installation\n\nInstall [the package](https://github.com/brefphp/constructs) with NPM:\n\n```bash\nnpm install @bref.sh/constructs\n```\n\n## Usage\n\nSimple example to deploy an HTTP application:\n\n```typescript\nimport { Construct } from 'constructs';\nimport { App, Stack } from 'aws-cdk-lib';\nimport { PhpFpmFunction } from '@bref.sh/constructs';\n\nclass MyStack extends Stack {\n    constructor(scope: Construct, id: string, props?: StackProps) {\n        super(scope, id, props);\n\n        new PhpFpmFunction(this, 'Hello', {\n            handler: 'public/index.php',\n        });\n    }\n}\n\nconst app = new App();\nnew MyStack(app, 'test', {\n    env: {\n        region: 'eu-west-1',\n    },\n});\n```\n\n## Constructs\n\n### Functions\n\n#### `PhpFpmFunction`\n\nThis construct deploys a PHP function with the [HTTP runtime](https://bref.sh/docs/runtimes/http.html).\n\n```typescript\nnew PhpFpmFunction(this, 'MyFunction', {\n    handler: 'public/index.php',\n});\n```\n\nIt inherits from the AWS CDK [`Function` construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html) with these options set by default:\n\n- `handler`: `index.php` by default\n- `runtime`: `provided.al2023`\n- `code`: the code is automatically zipped from the current directory.\n- `layers`: the Bref layer is automatically added.\n- `memorySize`: `1024`\n- `timeout`: `28` (seconds)\n\nThe code is automatically zipped from the current directory. You can override this behavior by setting the `code` property:\n\n```typescript\nimport { packagePhpCode } from '@bref.sh/constructs';\n\nnew PhpFpmFunction(this, 'MyFunction', {\n    code: packagePhpCode('custom-path', {\n        exclude: ['docs'],\n    }),\n});\n```\n\nThe following paths are always excluded: `.git`, `.idea`, `cdk.out`, `node_modules`, `.bref`, `.serverless`, `tests`.\n\nThe construct also adds the following options:\n\n- `phpVersion` (default: `8.4`): the PHP version to use.\n\n#### `PhpFunction`\n\nThis construct deploys a PHP function with the [\"event-driven function\" runtime](https://bref.sh/docs/runtimes/function.html).\n\n```typescript\nnew PhpFunction(this, 'MyFunction', {\n    handler: 'my-handler.php',\n});\n```\n\nIt inherits from the AWS CDK [`Function` construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html) with these options set by default:\n\n- `runtime`: `provided.al2023`\n- `code`: the code is automatically zipped from the current directory.\n- `layers`: the Bref layer is automatically added.\n- `memorySize`: `1024`\n- `timeout`: `6` (seconds)\n\nThe code is automatically zipped from the current directory. You can override this behavior by setting the `code` property:\n\n```typescript\nimport { packagePhpCode } from '@bref.sh/constructs';\n\nnew PhpFunction(this, 'MyFunction', {\n    // ...\n    code: packagePhpCode('custom-path', {\n        exclude: ['docs'],\n    }),\n});\n```\n\nThe following paths are always excluded: `.git`, `.idea`, `cdk.out`, `node_modules`, `.bref`, `.serverless`, `tests`.\n\nThe construct also adds the following options:\n\n- `phpVersion` (default: `8.4`): the PHP version to use.\n\n#### `ConsoleFunction`\n\nThis construct deploys a PHP function with the [\"console\" runtime](https://bref.sh/docs/runtimes/console.html).\n\n```typescript\nnew ConsoleFunction(this, 'Artisan', {\n    handler: 'artisan',\n});\n```\n\nIt inherits from the AWS CDK [`Function` construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html) with these options set by default:\n\n- `runtime`: `provided.al2023`\n- `code`: the code is automatically zipped from the current directory.\n- `layers`: the Bref layer is automatically added.\n- `memorySize`: `1024`\n- `timeout`: `6` (seconds)\n\nThe code is automatically zipped from the current directory. You can override this behavior by setting the `code` property:\n\n```typescript\nimport { packagePhpCode } from '@bref.sh/constructs';\n\nnew ConsoleFunction(this, 'Artisan', {\n    // ...\n    code: packagePhpCode('custom-path', {\n        exclude: ['docs'],\n    }),\n});\n```\n\nThe following paths are always excluded: `.git`, `.idea`, `cdk.out`, `node_modules`, `.bref`, `.serverless`, `tests`.\n\nThe construct also adds the following options:\n\n- `phpVersion` (default: `8.4`): the PHP version to use.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrefphp%2Fconstructs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrefphp%2Fconstructs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrefphp%2Fconstructs/lists"}