Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

Latest commit

 

History

History
58 lines (41 loc) · 1.77 KB

README.md

File metadata and controls

58 lines (41 loc) · 1.77 KB

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.

Deprecation Notice:

Aws has published the new constructs for this configuration, use them instead, doc here: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apprunner.CfnAutoScalingConfiguration.html

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.