1.0.0 • Published 1 year ago

cdk-apprunner-autoscaling v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

AWS App Runner CloudFront Auto Scaling Integration

This AWS CDK construct enables autoscaling for AWS AppRunner services on CloudFormation. The construct is written in TypeScript and uses the AWS CDK Custom Resources to create the required AWS resources.

Requirements To use this construct, you'll need the following:

  • An AWS account with the necessary permissions to create AWS AppRunner and AWS CloudFormation resources.
  • AWS CDK v2 installed and configured on your development machine.
  • Node.js and TypeScript installed on your development machine.

Getting Started

To get started with this library, follow these steps:

  1. Install the library in your AWS CDK project by running the following command:
npm install cdk-apprunner-autoscaling

or, with yarn:

yarn add cdk-apprunner-autoscaling
  1. Import it in your CDK stack:
import { AppRunnerAutoScaling } from "cdk-apprunner-autoscaling";
  1. Instantiate the AppRunnerAutoscaling construct in your AWS CDK stack and provide the required parameters:
const scaling = new AppRunnerAutoScaling(this, "AutoScaling", {
  AutoScalingConfigurationName: `my-scaling-config`,
  MaxConcurrency: 200,
  MinSize: 1,
  MaxSize: 3,
});
  1. On your CfnService Construct (L1), reference the scaling configuration as follows:
const service = new apprunner.CfnService(this, "AppRunnerService", {
  serviceName: id,
  autoScalingConfigurationArn: scaling.arn, // <-- Reference here.
  /** Other config... **/
});
  1. When you deploy again, you will have that autoscaling config set.
1.0.0

1 year ago