// *** 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;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Tem
{
    /// <summary>
    /// Provides a resource to create a tem scaleRule
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var scaleRule = new Tencentcloud.Tem.ScaleRule("scaleRule", new Tencentcloud.Tem.ScaleRuleArgs
    ///         {
    ///             EnvironmentId = "en-o5edaepv",
    ///             ApplicationId = "app-3j29aa2p",
    ///             WorkloadId = resource.Tencentcloud_tem_workload.Workload.Id,
    ///             Autoscaler = new Tencentcloud.Tem.Inputs.ScaleRuleAutoscalerArgs
    ///             {
    ///                 AutoscalerName = "test3123",
    ///                 Description = "test",
    ///                 Enabled = true,
    ///                 MinReplicas = 1,
    ///                 MaxReplicas = 4,
    ///                 CronHorizontalAutoscalers = 
    ///                 {
    ///                     new Tencentcloud.Tem.Inputs.ScaleRuleAutoscalerCronHorizontalAutoscalerArgs
    ///                     {
    ///                         Name = "test",
    ///                         Period = "* * *",
    ///                         Priority = 1,
    ///                         Enabled = true,
    ///                         Schedules = 
    ///                         {
    ///                             new Tencentcloud.Tem.Inputs.ScaleRuleAutoscalerCronHorizontalAutoscalerScheduleArgs
    ///                             {
    ///                                 StartAt = "03:00",
    ///                                 TargetReplicas = 1,
    ///                             },
    ///                         },
    ///                     },
    ///                     new Tencentcloud.Tem.Inputs.ScaleRuleAutoscalerCronHorizontalAutoscalerArgs
    ///                     {
    ///                         Name = "test123123",
    ///                         Period = "* * *",
    ///                         Priority = 0,
    ///                         Enabled = true,
    ///                         Schedules = 
    ///                         {
    ///                             new Tencentcloud.Tem.Inputs.ScaleRuleAutoscalerCronHorizontalAutoscalerScheduleArgs
    ///                             {
    ///                                 StartAt = "04:13",
    ///                                 TargetReplicas = 1,
    ///                             },
    ///                         },
    ///                     },
    ///                 },
    ///                 HorizontalAutoscalers = 
    ///                 {
    ///                     new Tencentcloud.Tem.Inputs.ScaleRuleAutoscalerHorizontalAutoscalerArgs
    ///                     {
    ///                         Metrics = "CPU",
    ///                         Enabled = true,
    ///                         MaxReplicas = 4,
    ///                         MinReplicas = 1,
    ///                         Threshold = 60,
    ///                     },
    ///                 },
    ///             },
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// ## Import
    /// 
    /// tem scaleRule can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import tencentcloud:Tem/scaleRule:ScaleRule scaleRule environmentId#applicationId#scaleRuleId
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Tem/scaleRule:ScaleRule")]
    public partial class ScaleRule : Pulumi.CustomResource
    {
        /// <summary>
        /// application ID.
        /// </summary>
        [Output("applicationId")]
        public Output<string> ApplicationId { get; private set; } = null!;

        /// <summary>
        /// .
        /// </summary>
        [Output("autoscaler")]
        public Output<Outputs.ScaleRuleAutoscaler> Autoscaler { get; private set; } = null!;

        /// <summary>
        /// environment ID.
        /// </summary>
        [Output("environmentId")]
        public Output<string> EnvironmentId { get; private set; } = null!;

        /// <summary>
        /// application ID, which is combined by environment ID and application ID, like `en-o5edaepv#app-3j29aa2p`.
        /// </summary>
        [Output("workloadId")]
        public Output<string> WorkloadId { get; private set; } = null!;


        /// <summary>
        /// Create a ScaleRule 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 ScaleRule(string name, ScaleRuleArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Tem/scaleRule:ScaleRule", name, args ?? new ScaleRuleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ScaleRule(string name, Input<string> id, ScaleRuleState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Tem/scaleRule:ScaleRule", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/tencentcloudstack",
            };
            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 ScaleRule 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 ScaleRule Get(string name, Input<string> id, ScaleRuleState? state = null, CustomResourceOptions? options = null)
        {
            return new ScaleRule(name, id, state, options);
        }
    }

    public sealed class ScaleRuleArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// application ID.
        /// </summary>
        [Input("applicationId", required: true)]
        public Input<string> ApplicationId { get; set; } = null!;

        /// <summary>
        /// .
        /// </summary>
        [Input("autoscaler", required: true)]
        public Input<Inputs.ScaleRuleAutoscalerArgs> Autoscaler { get; set; } = null!;

        /// <summary>
        /// environment ID.
        /// </summary>
        [Input("environmentId", required: true)]
        public Input<string> EnvironmentId { get; set; } = null!;

        /// <summary>
        /// application ID, which is combined by environment ID and application ID, like `en-o5edaepv#app-3j29aa2p`.
        /// </summary>
        [Input("workloadId", required: true)]
        public Input<string> WorkloadId { get; set; } = null!;

        public ScaleRuleArgs()
        {
        }
    }

    public sealed class ScaleRuleState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// application ID.
        /// </summary>
        [Input("applicationId")]
        public Input<string>? ApplicationId { get; set; }

        /// <summary>
        /// .
        /// </summary>
        [Input("autoscaler")]
        public Input<Inputs.ScaleRuleAutoscalerGetArgs>? Autoscaler { get; set; }

        /// <summary>
        /// environment ID.
        /// </summary>
        [Input("environmentId")]
        public Input<string>? EnvironmentId { get; set; }

        /// <summary>
        /// application ID, which is combined by environment ID and application ID, like `en-o5edaepv#app-3j29aa2p`.
        /// </summary>
        [Input("workloadId")]
        public Input<string>? WorkloadId { get; set; }

        public ScaleRuleState()
        {
        }
    }
}
