Class Policy
Provides an AutoScaling Scaling Policy resource.
NOTE: You may want to omit
desired_capacityattribute from attachedaws.autoscaling.Groupwhen 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,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.AutoScaling
Assembly: Pulumi.Aws.dll
Syntax
public class Policy : CustomResource
Constructors
View SourcePolicy(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 SourceAdjustmentType
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> |
Arn
The ARN assigned by AWS to the scaling policy.
Declaration
public Output<string> Arn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
AutoscalingGroupName
The name of the autoscaling group.
Declaration
public Output<string> AutoscalingGroupName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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>> |
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>> |
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> |
MinAdjustmentMagnitude
Declaration
public Output<int?> MinAdjustmentMagnitude { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Name
The name of the dimension.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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>> |
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>> |
TargetTrackingConfiguration
A target tracking policy. These have the following structure:
Declaration
public Output<PolicyTargetTrackingConfiguration> TargetTrackingConfiguration { get; }
Property Value
| Type | Description |
|---|---|
| Output<PolicyTargetTrackingConfiguration> |
Methods
View SourceGet(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 |