Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion .projenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const project = new awscdk.AwsCdkConstructLibrary({
authorName: 'Pahud Hsieh',
authorEmail: 'hunhsieh@amazon.com',
name: PROJECT_NAME,
cdkVersion: '2.18.0',
cdkVersion: '2.29.1',
description: PROJECT_DESCRIPTION,
repository: 'https://github.com/aws-samples/cdk-serverless-lamp.git',
defaultReleaseBranch: 'main',
Expand All @@ -21,6 +21,9 @@ const project = new awscdk.AwsCdkConstructLibrary({
'@aws-cdk/aws-apigatewayv2-integrations-alpha',
'@aws-cdk/aws-apigatewayv2-alpha',
],
peerDeps: [
'@aws-cdk/aws-apigatewayv2-alpha',
],
autoApproveOptions: {
secret: 'GITHUB_TOKEN',
allowedUsernames: ['pahud'],
Expand Down
9 changes: 9 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ new ServerlessApi(scope: Construct, id: string, props: ServerlessApiProps)

Name | Type | Description
-----|------|-------------
**endpoint** | <code>[HttpApi](#aws-cdk-aws-apigatewayv2-alpha-httpapi)</code> | <span></span>
**handler** | <code>[aws_lambda.IFunction](#aws-cdk-lib-aws-lambda-ifunction)</code> | <span></span>
**vpc**? | <code>[aws_ec2.IVpc](#aws-cdk-lib-aws-ec2-ivpc)</code> | __*Optional*__

Expand Down Expand Up @@ -127,6 +128,14 @@ new ServerlessLaravel(scope: Construct, id: string, props: ServerlessLaravelProp



### Properties


Name | Type | Description
-----|------|-------------
**api** | <code>[ServerlessApi](#cdk-serverless-lamp-serverlessapi)</code> | <span></span>



## struct DatabaseConfig <a id="cdk-serverless-lamp-databaseconfig"></a>

Expand Down
5 changes: 3 additions & 2 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export interface ServerlessApiProps {
export class ServerlessApi extends Construct {
readonly handler: lambda.IFunction;
readonly vpc?: ec2.IVpc;
readonly endpoint: apigateway.HttpApi;

constructor(scope: Construct, id: string, props: ServerlessApiProps) {
super(scope, id);
Expand Down Expand Up @@ -119,7 +120,7 @@ export class ServerlessApi extends Construct {
}));
}

const endpoint = new apigateway.HttpApi(this, 'apiservice', {
const endpoint = this.endpoint = new apigateway.HttpApi(this, 'apiservice', {
defaultIntegration: new HttpLambdaIntegration('lambdaHandler', this.handler),
});
new CfnOutput(this, 'EndpointURL', { value: endpoint.url! });
Expand All @@ -141,9 +142,11 @@ export interface ServerlessLaravelProps extends ServerlessApiProps {
* Use `ServerlessLaravel` to create the serverless Laravel resource
*/
export class ServerlessLaravel extends Construct {
readonly api:ServerlessApi;

constructor(scope: Construct, id: string, props: ServerlessLaravelProps) {
super(scope, id);
new ServerlessApi(this, id, {
this.api = new ServerlessApi(this, id, {
lambdaCodePath: props.laravelPath,
brefLayerVersion: props.brefLayerVersion,
handler: props.handler,
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.