How to use the @aws-cdk/aws-applicationautoscaling.BaseScalableAttribute function in @aws-cdk/aws-applicationautoscaling

To help you get started, we’ve selected a few @aws-cdk/aws-applicationautoscaling examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-cdk / packages / @aws-cdk / aws-dynamodb / lib / scalable-table-attribute.ts View on Github external
import * as appscaling from '@aws-cdk/aws-applicationautoscaling';
import { UtilizationScalingProps } from './scalable-attribute-api';

/**
 * A scalable table attribute
 */
export class ScalableTableAttribute extends appscaling.BaseScalableAttribute {
  /**
   * Scale out or in based on time
   */
  public scaleOnSchedule(id: string, action: appscaling.ScalingSchedule) {
    super.doScaleOnSchedule(id, action);
  }

  /**
   * Scale out or in to keep utilization at a given level
   */
  public scaleOnUtilization(props: UtilizationScalingProps) {
    if (props.targetUtilizationPercent < 10 || props.targetUtilizationPercent > 90) {
      // tslint:disable-next-line:max-line-length
      throw new RangeError(`targetUtilizationPercent for DynamoDB scaling must be between 10 and 90 percent, got: ${props.targetUtilizationPercent}`);
    }
    const predefinedMetric = this.props.dimension.indexOf('ReadCapacity') === -1
github aws / aws-cdk / packages / @aws-cdk / aws-ecs / lib / base / scalable-task-count.ts View on Github external
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2';
import { Construct } from '@aws-cdk/core';

/**
 * The properties of a scalable attribute representing task count.
 */
// tslint:disable-next-line:no-empty-interface
export interface ScalableTaskCountProps extends appscaling.BaseScalableAttributeProps {

}

/**
 * The scalable attribute representing task count.
 */
export class ScalableTaskCount extends appscaling.BaseScalableAttribute {

  /**
   * Constructs a new instance of the ScalableTaskCount class.
   */
  constructor(scope: Construct, id: string, props: ScalableTaskCountProps) {
    super(scope, id, props);
  }

  /**
   * Scales in or out based on a specified scheduled time.
   */
  public scaleOnSchedule(id: string, props: appscaling.ScalingSchedule) {
    return super.doScaleOnSchedule(id, props);
  }

  /**

@aws-cdk/aws-applicationautoscaling

The CDK Construct Library for AWS::ApplicationAutoScaling

Apache-2.0
Latest version published 10 months ago

Package Health Score

70 / 100
Full package analysis