Skip to content

Commit

Permalink
docs: added installation/usage docs (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
kieranbrown authored Sep 16, 2024
1 parent 2555bd3 commit c2d8c14
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions README.md
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,
},
},
});
```

0 comments on commit c2d8c14

Please sign in to comment.