Package Exports
- turbo-remote-cache-construct
- turbo-remote-cache-construct/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (turbo-remote-cache-construct) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Turborepo Remote Cache API Construct
An AWS CDK construct for easily deploying a Turborepo Remote Cache API infrastructure.
Installation
To use this construct in your CDK project, install it using npm, pnpm, or yarn:
npm install turbo-remote-cache-constructpnpm add turbo-remote-cache-constructUsage
Import and use the construct in your CDK stack:
import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { TurboRemoteCache } from 'turbo-remote-cache-construct';
import * as acm from 'aws-cdk-lib/aws-certificatemanager';
import * as apigateway from 'aws-cdk-lib/aws-apigateway';
export class TurboRemoteCacheStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
new TurboRemoteCache(this, 'TurboRemoteCache', {
// optional domain name options for using a custom domain with API Gateway
domainNameOptions: {
domainName: 'your-custom-domain.com',
// create a certificate in us-east-1 for custom domain
certificate: acm.Certificate.fromCertificateArn(this, 'Certificate', 'YOUR_CERTIFICATE_ARN'),
endpointType: apigateway.EndpointType.EDGE,
securityPolicy: apigateway.SecurityPolicy.TLS_1_2,
},
});
}
}Architecture
The construct uses API Gateway, Lambda, S3 integration, and DynamoDB to create a serverless Turborepo Remote Cache REST API. The construct can be self-hosted in your AWS account and be used with the Turborepo Remote Cache.
Components
- API Gateway: Used to create a REST API that will be used to interact with the Remote Cache.
- Lambda: Used to handle the API requests and responses for non-artifact related endpoints.
- S3 Integration: Allows API Gateway to integrate with S3 without a Lambda function which allows for a larger payload size and lower latency.
- S3: Used to store the Remote Cache artifacts.
- DynamoDB: Used to store the Remote Cache events.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This construct is licensed under the MIT License. See the LICENSE file for details.