-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: added installation/usage docs (#2)
- Loading branch information
1 parent
2555bd3
commit c2d8c14
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,69 @@ | ||
# Pulumi Bref | ||
|
||
A Pulumi construct to deploy a Laravel application using brefphp | ||
|
||
## Installation | ||
|
||
```shell | ||
npm config set --location=project @chatloop:registry=https://npm.pkg.github.com | ||
npm install @chatloop/pulumi-bref | ||
``` | ||
|
||
## Usage | ||
|
||
This is purely just an example you may tweak to suit your needs. | ||
|
||
```ts | ||
import { BrefLaravel } from "@chatloop/pulumi-bref"; | ||
import * as aws from '@pulumi/aws'; | ||
|
||
const commonFunctionArgs = { | ||
architectures: ['arm64'], | ||
environment: { | ||
variables: { | ||
API_URL: 'https://example.com' | ||
}, | ||
}, | ||
memorySize: 2048, | ||
role: 'arn:aws:iam:...', | ||
// optional - associate lambdas to a vpc | ||
vpcConfig: { | ||
securityGroupIds: [...], | ||
subnetIds: [...], | ||
}, | ||
} as const satisfies Partial<aws.lambda.FunctionArgs>; | ||
|
||
const brefApp = new BrefLaravel('App', { | ||
name: 'pulumi-bref-example', | ||
phpVersion: '8.2', | ||
projectRoot: '/example', // folder path to the laravel app src code | ||
sqsQueueArn: 'arn:aws:sqs:...', | ||
cdn: { | ||
assetPaths: ['build/*', 'img/*', 'vendor/*', 'favicon.ico', 'robots.txt'], | ||
comment: 'My Example API CDN', | ||
domain: { | ||
name: 'bref.example.com', | ||
aliases: [...], | ||
// this ACM ARN must exist in us-east-1 | ||
cert: 'arn:aws:acm:...', | ||
}, | ||
}, | ||
functions: { | ||
artisan: { | ||
...commonFunctionArgs, | ||
description: 'My Example API Artisan', | ||
timeout: 120, | ||
}, | ||
web: { | ||
...commonFunctionArgs, | ||
description: 'My Example API Web', | ||
timeout: 30, | ||
}, | ||
worker: { | ||
...commonFunctionArgs, | ||
description: 'My Example API Worker', | ||
timeout: 600, | ||
}, | ||
}, | ||
}); | ||
``` |