// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.Tctest.As
{
    [TctestResourceType("tctest:As/scalingPolicy:ScalingPolicy")]
    public partial class ScalingPolicy : Pulumi.CustomResource
    {
        /// <summary>
        /// Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values:
        /// `CHANGE_IN_CAPACITY`, `EXACT_CAPACITY` and `PERCENT_CHANGE_IN_CAPACITY`.
        /// </summary>
        [Output("adjustmentType")]
        public Output<string> AdjustmentType { get; private set; } = null!;

        /// <summary>
        /// Define the number of instances by which to scale.For `CHANGE_IN_CAPACITY` type or PERCENT_CHANGE_IN_CAPACITY, a positive
        /// increment adds to the current capacity and a negative value removes from the current capacity. For `EXACT_CAPACITY`
        /// type, it defines an absolute number of the existing Auto Scaling group size.
        /// </summary>
        [Output("adjustmentValue")]
        public Output<int> AdjustmentValue { get; private set; } = null!;

        /// <summary>
        /// Comparison operator. Valid values: `GREATER_THAN`, `GREATER_THAN_OR_EQUAL_TO`, `LESS_THAN`, `LESS_THAN_OR_EQUAL_TO`,
        /// `EQUAL_TO` and `NOT_EQUAL_TO`.
        /// </summary>
        [Output("comparisonOperator")]
        public Output<string> ComparisonOperator { get; private set; } = null!;

        /// <summary>
        /// Retry times. Valid value ranges: (1~10).
        /// </summary>
        [Output("continuousTime")]
        public Output<int> ContinuousTime { get; private set; } = null!;

        /// <summary>
        /// Cooldwon time in second. Default is `30`0.
        /// </summary>
        [Output("cooldown")]
        public Output<int?> Cooldown { get; private set; } = null!;

        /// <summary>
        /// Name of an indicator. Valid values: `CPU_UTILIZATION`, `MEM_UTILIZATION`, `LAN_TRAFFIC_OUT`, `LAN_TRAFFIC_IN`,
        /// `WAN_TRAFFIC_OUT` and `WAN_TRAFFIC_IN`.
        /// </summary>
        [Output("metricName")]
        public Output<string> MetricName { get; private set; } = null!;

        /// <summary>
        /// An ID group of users to be notified when an alarm is triggered.
        /// </summary>
        [Output("notificationUserGroupIds")]
        public Output<ImmutableArray<string>> NotificationUserGroupIds { get; private set; } = null!;

        /// <summary>
        /// Time period in second. Valid values: `60` and `300`.
        /// </summary>
        [Output("period")]
        public Output<int> Period { get; private set; } = null!;

        /// <summary>
        /// Name of a policy used to define a reaction when an alarm is triggered.
        /// </summary>
        [Output("policyName")]
        public Output<string> PolicyName { get; private set; } = null!;

        /// <summary>
        /// ID of a scaling group.
        /// </summary>
        [Output("scalingGroupId")]
        public Output<string> ScalingGroupId { get; private set; } = null!;

        /// <summary>
        /// Statistic types. Valid values: `AVERAGE`, `MAXIMUM` and `MINIMUM`. Default is `AVERAGE`.
        /// </summary>
        [Output("statistic")]
        public Output<string?> Statistic { get; private set; } = null!;

        /// <summary>
        /// Alarm threshold.
        /// </summary>
        [Output("threshold")]
        public Output<int> Threshold { get; private set; } = null!;


        /// <summary>
        /// Create a ScalingPolicy resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public ScalingPolicy(string name, ScalingPolicyArgs args, CustomResourceOptions? options = null)
            : base("tctest:As/scalingPolicy:ScalingPolicy", name, args ?? new ScalingPolicyArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ScalingPolicy(string name, Input<string> id, ScalingPolicyState? state = null, CustomResourceOptions? options = null)
            : base("tctest:As/scalingPolicy:ScalingPolicy", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing ScalingPolicy resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static ScalingPolicy Get(string name, Input<string> id, ScalingPolicyState? state = null, CustomResourceOptions? options = null)
        {
            return new ScalingPolicy(name, id, state, options);
        }
    }

    public sealed class ScalingPolicyArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values:
        /// `CHANGE_IN_CAPACITY`, `EXACT_CAPACITY` and `PERCENT_CHANGE_IN_CAPACITY`.
        /// </summary>
        [Input("adjustmentType", required: true)]
        public Input<string> AdjustmentType { get; set; } = null!;

        /// <summary>
        /// Define the number of instances by which to scale.For `CHANGE_IN_CAPACITY` type or PERCENT_CHANGE_IN_CAPACITY, a positive
        /// increment adds to the current capacity and a negative value removes from the current capacity. For `EXACT_CAPACITY`
        /// type, it defines an absolute number of the existing Auto Scaling group size.
        /// </summary>
        [Input("adjustmentValue", required: true)]
        public Input<int> AdjustmentValue { get; set; } = null!;

        /// <summary>
        /// Comparison operator. Valid values: `GREATER_THAN`, `GREATER_THAN_OR_EQUAL_TO`, `LESS_THAN`, `LESS_THAN_OR_EQUAL_TO`,
        /// `EQUAL_TO` and `NOT_EQUAL_TO`.
        /// </summary>
        [Input("comparisonOperator", required: true)]
        public Input<string> ComparisonOperator { get; set; } = null!;

        /// <summary>
        /// Retry times. Valid value ranges: (1~10).
        /// </summary>
        [Input("continuousTime", required: true)]
        public Input<int> ContinuousTime { get; set; } = null!;

        /// <summary>
        /// Cooldwon time in second. Default is `30`0.
        /// </summary>
        [Input("cooldown")]
        public Input<int>? Cooldown { get; set; }

        /// <summary>
        /// Name of an indicator. Valid values: `CPU_UTILIZATION`, `MEM_UTILIZATION`, `LAN_TRAFFIC_OUT`, `LAN_TRAFFIC_IN`,
        /// `WAN_TRAFFIC_OUT` and `WAN_TRAFFIC_IN`.
        /// </summary>
        [Input("metricName", required: true)]
        public Input<string> MetricName { get; set; } = null!;

        [Input("notificationUserGroupIds")]
        private InputList<string>? _notificationUserGroupIds;

        /// <summary>
        /// An ID group of users to be notified when an alarm is triggered.
        /// </summary>
        public InputList<string> NotificationUserGroupIds
        {
            get => _notificationUserGroupIds ?? (_notificationUserGroupIds = new InputList<string>());
            set => _notificationUserGroupIds = value;
        }

        /// <summary>
        /// Time period in second. Valid values: `60` and `300`.
        /// </summary>
        [Input("period", required: true)]
        public Input<int> Period { get; set; } = null!;

        /// <summary>
        /// Name of a policy used to define a reaction when an alarm is triggered.
        /// </summary>
        [Input("policyName", required: true)]
        public Input<string> PolicyName { get; set; } = null!;

        /// <summary>
        /// ID of a scaling group.
        /// </summary>
        [Input("scalingGroupId", required: true)]
        public Input<string> ScalingGroupId { get; set; } = null!;

        /// <summary>
        /// Statistic types. Valid values: `AVERAGE`, `MAXIMUM` and `MINIMUM`. Default is `AVERAGE`.
        /// </summary>
        [Input("statistic")]
        public Input<string>? Statistic { get; set; }

        /// <summary>
        /// Alarm threshold.
        /// </summary>
        [Input("threshold", required: true)]
        public Input<int> Threshold { get; set; } = null!;

        public ScalingPolicyArgs()
        {
        }
    }

    public sealed class ScalingPolicyState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values:
        /// `CHANGE_IN_CAPACITY`, `EXACT_CAPACITY` and `PERCENT_CHANGE_IN_CAPACITY`.
        /// </summary>
        [Input("adjustmentType")]
        public Input<string>? AdjustmentType { get; set; }

        /// <summary>
        /// Define the number of instances by which to scale.For `CHANGE_IN_CAPACITY` type or PERCENT_CHANGE_IN_CAPACITY, a positive
        /// increment adds to the current capacity and a negative value removes from the current capacity. For `EXACT_CAPACITY`
        /// type, it defines an absolute number of the existing Auto Scaling group size.
        /// </summary>
        [Input("adjustmentValue")]
        public Input<int>? AdjustmentValue { get; set; }

        /// <summary>
        /// Comparison operator. Valid values: `GREATER_THAN`, `GREATER_THAN_OR_EQUAL_TO`, `LESS_THAN`, `LESS_THAN_OR_EQUAL_TO`,
        /// `EQUAL_TO` and `NOT_EQUAL_TO`.
        /// </summary>
        [Input("comparisonOperator")]
        public Input<string>? ComparisonOperator { get; set; }

        /// <summary>
        /// Retry times. Valid value ranges: (1~10).
        /// </summary>
        [Input("continuousTime")]
        public Input<int>? ContinuousTime { get; set; }

        /// <summary>
        /// Cooldwon time in second. Default is `30`0.
        /// </summary>
        [Input("cooldown")]
        public Input<int>? Cooldown { get; set; }

        /// <summary>
        /// Name of an indicator. Valid values: `CPU_UTILIZATION`, `MEM_UTILIZATION`, `LAN_TRAFFIC_OUT`, `LAN_TRAFFIC_IN`,
        /// `WAN_TRAFFIC_OUT` and `WAN_TRAFFIC_IN`.
        /// </summary>
        [Input("metricName")]
        public Input<string>? MetricName { get; set; }

        [Input("notificationUserGroupIds")]
        private InputList<string>? _notificationUserGroupIds;

        /// <summary>
        /// An ID group of users to be notified when an alarm is triggered.
        /// </summary>
        public InputList<string> NotificationUserGroupIds
        {
            get => _notificationUserGroupIds ?? (_notificationUserGroupIds = new InputList<string>());
            set => _notificationUserGroupIds = value;
        }

        /// <summary>
        /// Time period in second. Valid values: `60` and `300`.
        /// </summary>
        [Input("period")]
        public Input<int>? Period { get; set; }

        /// <summary>
        /// Name of a policy used to define a reaction when an alarm is triggered.
        /// </summary>
        [Input("policyName")]
        public Input<string>? PolicyName { get; set; }

        /// <summary>
        /// ID of a scaling group.
        /// </summary>
        [Input("scalingGroupId")]
        public Input<string>? ScalingGroupId { get; set; }

        /// <summary>
        /// Statistic types. Valid values: `AVERAGE`, `MAXIMUM` and `MINIMUM`. Default is `AVERAGE`.
        /// </summary>
        [Input("statistic")]
        public Input<string>? Statistic { get; set; }

        /// <summary>
        /// Alarm threshold.
        /// </summary>
        [Input("threshold")]
        public Input<int>? Threshold { get; set; }

        public ScalingPolicyState()
        {
        }
    }
}
