cdk-apprunner-autoscaling
v1.0.0
Published
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.
Downloads
5
Readme
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:
- 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
- Import it in your CDK stack:
import { AppRunnerAutoScaling } from "cdk-apprunner-autoscaling";
- 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,
});
- On your
CfnService
Construct (L1), reference thescaling
configuration as follows:
const service = new apprunner.CfnService(this, "AppRunnerService", {
serviceName: id,
autoScalingConfigurationArn: scaling.arn, // <-- Reference here.
/** Other config... **/
});
- When you deploy again, you will have that autoscaling config set.