com.pulumi.aws.appautoscaling.kotlin.inputs.PolicyStepScalingPolicyConfigurationArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.appautoscaling.kotlin.inputs
import com.pulumi.aws.appautoscaling.inputs.PolicyStepScalingPolicyConfigurationArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
*
* @property adjustmentType Whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are `ChangeInCapacity`, `ExactCapacity`, and `PercentChangeInCapacity`.
* @property cooldown Amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
* @property metricAggregationType 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".
* @property minAdjustmentMagnitude Minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.
* @property stepAdjustments Set of adjustments that manage scaling. These have the following structure:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const ecsPolicy = new aws.appautoscaling.Policy("ecs_policy", {stepScalingPolicyConfiguration: {
* stepAdjustments: [
* {
* metricIntervalLowerBound: "1",
* metricIntervalUpperBound: "2",
* scalingAdjustment: -1,
* },
* {
* metricIntervalLowerBound: "2",
* metricIntervalUpperBound: "3",
* scalingAdjustment: 1,
* },
* ],
* }});
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* ecs_policy = aws.appautoscaling.Policy("ecs_policy", step_scaling_policy_configuration={
* "step_adjustments": [
* {
* "metric_interval_lower_bound": "1",
* "metric_interval_upper_bound": "2",
* "scaling_adjustment": -1,
* },
* {
* "metric_interval_lower_bound": "2",
* "metric_interval_upper_bound": "3",
* "scaling_adjustment": 1,
* },
* ],
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var ecsPolicy = new Aws.AppAutoScaling.Policy("ecs_policy", new()
* {
* StepScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationArgs
* {
* StepAdjustments = new[]
* {
* new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
* {
* MetricIntervalLowerBound = "1",
* MetricIntervalUpperBound = "2",
* ScalingAdjustment = -1,
* },
* new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
* {
* MetricIntervalLowerBound = "2",
* MetricIntervalUpperBound = "3",
* ScalingAdjustment = 1,
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appautoscaling"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := appautoscaling.NewPolicy(ctx, "ecs_policy", &appautoscaling.PolicyArgs{
* StepScalingPolicyConfiguration: &appautoscaling.PolicyStepScalingPolicyConfigurationArgs{
* StepAdjustments: appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArray{
* &appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
* MetricIntervalLowerBound: pulumi.String("1"),
* MetricIntervalUpperBound: pulumi.String("2"),
* ScalingAdjustment: pulumi.Int(-1),
* },
* &appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
* MetricIntervalLowerBound: pulumi.String("2"),
* MetricIntervalUpperBound: pulumi.String("3"),
* ScalingAdjustment: pulumi.Int(1),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.appautoscaling.Policy;
* import com.pulumi.aws.appautoscaling.PolicyArgs;
* import com.pulumi.aws.appautoscaling.inputs.PolicyStepScalingPolicyConfigurationArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var ecsPolicy = new Policy("ecsPolicy", PolicyArgs.builder()
* .stepScalingPolicyConfiguration(PolicyStepScalingPolicyConfigurationArgs.builder()
* .stepAdjustments(
* PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
* .metricIntervalLowerBound(1)
* .metricIntervalUpperBound(2)
* .scalingAdjustment(-1)
* .build(),
* PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
* .metricIntervalLowerBound(2)
* .metricIntervalUpperBound(3)
* .scalingAdjustment(1)
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* ecsPolicy:
* type: aws:appautoscaling:Policy
* name: ecs_policy
* properties:
* stepScalingPolicyConfiguration:
* stepAdjustments:
* - metricIntervalLowerBound: 1
* metricIntervalUpperBound: 2
* scalingAdjustment: -1
* - metricIntervalLowerBound: 2
* metricIntervalUpperBound: 3
* scalingAdjustment: 1
* ```
*
*/
public data class PolicyStepScalingPolicyConfigurationArgs(
public val adjustmentType: Output? = null,
public val cooldown: Output? = null,
public val metricAggregationType: Output? = null,
public val minAdjustmentMagnitude: Output? = null,
public val stepAdjustments: Output>? =
null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.appautoscaling.inputs.PolicyStepScalingPolicyConfigurationArgs =
com.pulumi.aws.appautoscaling.inputs.PolicyStepScalingPolicyConfigurationArgs.builder()
.adjustmentType(adjustmentType?.applyValue({ args0 -> args0 }))
.cooldown(cooldown?.applyValue({ args0 -> args0 }))
.metricAggregationType(metricAggregationType?.applyValue({ args0 -> args0 }))
.minAdjustmentMagnitude(minAdjustmentMagnitude?.applyValue({ args0 -> args0 }))
.stepAdjustments(
stepAdjustments?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
).build()
}
/**
* Builder for [PolicyStepScalingPolicyConfigurationArgs].
*/
@PulumiTagMarker
public class PolicyStepScalingPolicyConfigurationArgsBuilder internal constructor() {
private var adjustmentType: Output? = null
private var cooldown: Output? = null
private var metricAggregationType: Output? = null
private var minAdjustmentMagnitude: Output? = null
private var stepAdjustments: Output>? =
null
/**
* @param value Whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are `ChangeInCapacity`, `ExactCapacity`, and `PercentChangeInCapacity`.
*/
@JvmName("lqvnixxhnfcojhro")
public suspend fun adjustmentType(`value`: Output) {
this.adjustmentType = value
}
/**
* @param value Amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
*/
@JvmName("fxbolqbbjrepprlc")
public suspend fun cooldown(`value`: Output) {
this.cooldown = value
}
/**
* @param value 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".
*/
@JvmName("cnrjytgvmjdctamv")
public suspend fun metricAggregationType(`value`: Output) {
this.metricAggregationType = value
}
/**
* @param value Minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.
*/
@JvmName("sdaymadorvieinvh")
public suspend fun minAdjustmentMagnitude(`value`: Output) {
this.minAdjustmentMagnitude = value
}
/**
* @param value Set of adjustments that manage scaling. These have the following structure:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const ecsPolicy = new aws.appautoscaling.Policy("ecs_policy", {stepScalingPolicyConfiguration: {
* stepAdjustments: [
* {
* metricIntervalLowerBound: "1",
* metricIntervalUpperBound: "2",
* scalingAdjustment: -1,
* },
* {
* metricIntervalLowerBound: "2",
* metricIntervalUpperBound: "3",
* scalingAdjustment: 1,
* },
* ],
* }});
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* ecs_policy = aws.appautoscaling.Policy("ecs_policy", step_scaling_policy_configuration={
* "step_adjustments": [
* {
* "metric_interval_lower_bound": "1",
* "metric_interval_upper_bound": "2",
* "scaling_adjustment": -1,
* },
* {
* "metric_interval_lower_bound": "2",
* "metric_interval_upper_bound": "3",
* "scaling_adjustment": 1,
* },
* ],
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var ecsPolicy = new Aws.AppAutoScaling.Policy("ecs_policy", new()
* {
* StepScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationArgs
* {
* StepAdjustments = new[]
* {
* new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
* {
* MetricIntervalLowerBound = "1",
* MetricIntervalUpperBound = "2",
* ScalingAdjustment = -1,
* },
* new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
* {
* MetricIntervalLowerBound = "2",
* MetricIntervalUpperBound = "3",
* ScalingAdjustment = 1,
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appautoscaling"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := appautoscaling.NewPolicy(ctx, "ecs_policy", &appautoscaling.PolicyArgs{
* StepScalingPolicyConfiguration: &appautoscaling.PolicyStepScalingPolicyConfigurationArgs{
* StepAdjustments: appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArray{
* &appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
* MetricIntervalLowerBound: pulumi.String("1"),
* MetricIntervalUpperBound: pulumi.String("2"),
* ScalingAdjustment: pulumi.Int(-1),
* },
* &appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
* MetricIntervalLowerBound: pulumi.String("2"),
* MetricIntervalUpperBound: pulumi.String("3"),
* ScalingAdjustment: pulumi.Int(1),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.appautoscaling.Policy;
* import com.pulumi.aws.appautoscaling.PolicyArgs;
* import com.pulumi.aws.appautoscaling.inputs.PolicyStepScalingPolicyConfigurationArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var ecsPolicy = new Policy("ecsPolicy", PolicyArgs.builder()
* .stepScalingPolicyConfiguration(PolicyStepScalingPolicyConfigurationArgs.builder()
* .stepAdjustments(
* PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
* .metricIntervalLowerBound(1)
* .metricIntervalUpperBound(2)
* .scalingAdjustment(-1)
* .build(),
* PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
* .metricIntervalLowerBound(2)
* .metricIntervalUpperBound(3)
* .scalingAdjustment(1)
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* ecsPolicy:
* type: aws:appautoscaling:Policy
* name: ecs_policy
* properties:
* stepScalingPolicyConfiguration:
* stepAdjustments:
* - metricIntervalLowerBound: 1
* metricIntervalUpperBound: 2
* scalingAdjustment: -1
* - metricIntervalLowerBound: 2
* metricIntervalUpperBound: 3
* scalingAdjustment: 1
* ```
*
*/
@JvmName("nbympergyvtwqpkv")
public suspend fun stepAdjustments(`value`: Output>) {
this.stepAdjustments = value
}
@JvmName("pwhskiipplljhfcn")
public suspend fun stepAdjustments(vararg values: Output) {
this.stepAdjustments = Output.all(values.asList())
}
/**
* @param values Set of adjustments that manage scaling. These have the following structure:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const ecsPolicy = new aws.appautoscaling.Policy("ecs_policy", {stepScalingPolicyConfiguration: {
* stepAdjustments: [
* {
* metricIntervalLowerBound: "1",
* metricIntervalUpperBound: "2",
* scalingAdjustment: -1,
* },
* {
* metricIntervalLowerBound: "2",
* metricIntervalUpperBound: "3",
* scalingAdjustment: 1,
* },
* ],
* }});
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* ecs_policy = aws.appautoscaling.Policy("ecs_policy", step_scaling_policy_configuration={
* "step_adjustments": [
* {
* "metric_interval_lower_bound": "1",
* "metric_interval_upper_bound": "2",
* "scaling_adjustment": -1,
* },
* {
* "metric_interval_lower_bound": "2",
* "metric_interval_upper_bound": "3",
* "scaling_adjustment": 1,
* },
* ],
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var ecsPolicy = new Aws.AppAutoScaling.Policy("ecs_policy", new()
* {
* StepScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationArgs
* {
* StepAdjustments = new[]
* {
* new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
* {
* MetricIntervalLowerBound = "1",
* MetricIntervalUpperBound = "2",
* ScalingAdjustment = -1,
* },
* new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
* {
* MetricIntervalLowerBound = "2",
* MetricIntervalUpperBound = "3",
* ScalingAdjustment = 1,
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appautoscaling"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := appautoscaling.NewPolicy(ctx, "ecs_policy", &appautoscaling.PolicyArgs{
* StepScalingPolicyConfiguration: &appautoscaling.PolicyStepScalingPolicyConfigurationArgs{
* StepAdjustments: appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArray{
* &appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
* MetricIntervalLowerBound: pulumi.String("1"),
* MetricIntervalUpperBound: pulumi.String("2"),
* ScalingAdjustment: pulumi.Int(-1),
* },
* &appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
* MetricIntervalLowerBound: pulumi.String("2"),
* MetricIntervalUpperBound: pulumi.String("3"),
* ScalingAdjustment: pulumi.Int(1),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.appautoscaling.Policy;
* import com.pulumi.aws.appautoscaling.PolicyArgs;
* import com.pulumi.aws.appautoscaling.inputs.PolicyStepScalingPolicyConfigurationArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var ecsPolicy = new Policy("ecsPolicy", PolicyArgs.builder()
* .stepScalingPolicyConfiguration(PolicyStepScalingPolicyConfigurationArgs.builder()
* .stepAdjustments(
* PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
* .metricIntervalLowerBound(1)
* .metricIntervalUpperBound(2)
* .scalingAdjustment(-1)
* .build(),
* PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
* .metricIntervalLowerBound(2)
* .metricIntervalUpperBound(3)
* .scalingAdjustment(1)
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* ecsPolicy:
* type: aws:appautoscaling:Policy
* name: ecs_policy
* properties:
* stepScalingPolicyConfiguration:
* stepAdjustments:
* - metricIntervalLowerBound: 1
* metricIntervalUpperBound: 2
* scalingAdjustment: -1
* - metricIntervalLowerBound: 2
* metricIntervalUpperBound: 3
* scalingAdjustment: 1
* ```
*
*/
@JvmName("ibafseikboncielb")
public suspend fun stepAdjustments(values: List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy