Skip to content
Open
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
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,30 @@ export interface SPADeploymentWithCloudFront extends SPADeployment {
}
```

### Setting the deployment lamba memory limit

The amount of memory (in MiB) to allocate to the AWS Lambda function which replicates the files from the CDK bucket to the destination bucket.

If you are deploying large files, you will need to increase this number accordingly. Defaults to 128mb

```typescript
import cdk = require('@aws-cdk/core');
import { SPADeploy } from 'cdk-spa-deploy';

export class CdkStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);

new SPADeploy(this, 'spaDeploy')
.createBasicSite({
indexDoc: 'index.html',
websiteFolder: '../blog/dist/blog',
memoryLimit: 1024
});
}
}
```

## Issues / Feature Requests

https://github.com/nideveloper/CDK-SPA-Deploy
5 changes: 5 additions & 0 deletions lib/spa-deploy/spa-deploy-construct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface SPADeployConfig {
readonly blockPublicAccess?:s3.BlockPublicAccess
readonly sslMethod?: SSLMethod,
readonly securityPolicy?: SecurityPolicyProtocol,
readonly memoryLimit?: number
readonly role?:Role,
}

Expand All @@ -38,6 +39,7 @@ export interface HostedZoneConfig {
readonly websiteFolder: string,
readonly zoneName: string,
readonly subdomain?: string,
readonly memoryLimit?: number
readonly role?: Role,
}

Expand Down Expand Up @@ -198,6 +200,7 @@ export class SPADeploy extends Construct {
sources: [s3deploy.Source.asset(config.websiteFolder)],
role: config.role,
destinationBucket: websiteBucket,
memoryLimit: config.memoryLimit
});

const cfnOutputConfig:any = {
Expand Down Expand Up @@ -236,6 +239,7 @@ export class SPADeploy extends Construct {
// Invalidate the cache for / and index.html when we deploy so that cloudfront serves latest site
distribution,
distributionPaths: ['/', `/${config.indexDoc}`],
memoryLimit: config.memoryLimit
role: config.role,
});

Expand Down Expand Up @@ -271,6 +275,7 @@ export class SPADeploy extends Construct {
distribution,
role: config.role,
distributionPaths: ['/', `/${config.indexDoc}`],
memoryLimit: config.memoryLimit
});

new ARecord(this, 'Alias', {
Expand Down