Show / Hide Table of Contents

Class Policy

Provides an AutoScaling Scaling Policy resource.

NOTE: You may want to omit desired_capacity attribute from attached aws.autoscaling.Group when using autoscaling policies. It's good practice to pick either manual or dynamic (policy-based) scaling.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var bar = new Aws.AutoScaling.Group("bar", new Aws.AutoScaling.GroupArgs
    {
        AvailabilityZones = 
        {
            "us-east-1a",
        },
        ForceDelete = true,
        HealthCheckGracePeriod = 300,
        HealthCheckType = "ELB",
        LaunchConfiguration = aws_launch_configuration.Foo.Name,
        MaxSize = 5,
        MinSize = 2,
    });
    var bat = new Aws.AutoScaling.Policy("bat", new Aws.AutoScaling.PolicyArgs
    {
        AdjustmentType = "ChangeInCapacity",
        AutoscalingGroupName = bar.Name,
        Cooldown = 300,
        ScalingAdjustment = 4,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Policy
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.AutoScaling
Assembly: Pulumi.Aws.dll
Syntax
public class Policy : CustomResource

Constructors

View Source

Policy(String, PolicyArgs, CustomResourceOptions)

Create a Policy resource with the given unique name, arguments, and options.

Declaration
public Policy(string name, PolicyArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

PolicyArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

AdjustmentType

Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

Declaration
public Output<string> AdjustmentType { get; }
Property Value
Type Description
Output<System.String>
View Source

Arn

The ARN assigned by AWS to the scaling policy.

Declaration
public Output<string> Arn { get; }
Property Value
Type Description
Output<System.String>
View Source

AutoscalingGroupName

The name of the autoscaling group.

Declaration
public Output<string> AutoscalingGroupName { get; }
Property Value
Type Description
Output<System.String>
View Source

Cooldown

The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.

Declaration
public Output<int?> Cooldown { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

EstimatedInstanceWarmup

The estimated time, in seconds, until a newly launched instance will contribute CloudWatch metrics. Without a value, AWS will default to the group's specified cooldown period.

Declaration
public Output<int?> EstimatedInstanceWarmup { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

MetricAggregationType

The aggregation type for the policy's metrics. Valid values are "Minimum", "Maximum", and "Average". Without a value, AWS will treat the aggregation type as "Average".

Declaration
public Output<string> MetricAggregationType { get; }
Property Value
Type Description
Output<System.String>
View Source

MinAdjustmentMagnitude

Declaration
public Output<int?> MinAdjustmentMagnitude { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

Name

The name of the dimension.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

PolicyType

The policy type, either "SimpleScaling", "StepScaling" or "TargetTrackingScaling". If this value isn't provided, AWS will default to "SimpleScaling."

Declaration
public Output<string> PolicyType { get; }
Property Value
Type Description
Output<System.String>
View Source

ScalingAdjustment

The number of members by which to scale, when the adjustment bounds are breached. A positive value scales up. A negative value scales down.

Declaration
public Output<int?> ScalingAdjustment { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

StepAdjustments

A set of adjustments that manage group scaling. These have the following structure:

Declaration
public Output<ImmutableArray<PolicyStepAdjustment>> StepAdjustments { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<PolicyStepAdjustment>>
View Source

TargetTrackingConfiguration

A target tracking policy. These have the following structure:

Declaration
public Output<PolicyTargetTrackingConfiguration> TargetTrackingConfiguration { get; }
Property Value
Type Description
Output<PolicyTargetTrackingConfiguration>

Methods

View Source

Get(String, Input<String>, PolicyState, CustomResourceOptions)

Get an existing Policy resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static Policy Get(string name, Input<string> id, PolicyState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

PolicyState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Policy
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.