<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks// *** 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.AliCloud.Ga
{
    /// <summary>
    /// Provides a Global Accelerator (GA) Forwarding Rule resource.
    /// 
    /// For information about Global Accelerator (GA) Forwarding Rule and how to use it, see [What is Forwarding Rule](https://www.alibabacloud.com/help/zh/doc-detail/205815.htm).
    /// 
    /// &gt; **NOTE:** Available in v1.120.0+.
    /// 
    /// ## Import
    /// 
    /// Ga Forwarding Rule can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:ga/forwardingRule:ForwardingRule example &lt;id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:ga/forwardingRule:ForwardingRule")]
    public partial class ForwardingRule : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The ID of the Global Accelerator instance.
        /// </summary>
        [Output("acceleratorId")]
        public Output<string> AcceleratorId { get; private set; } = null!;

        /// <summary>
        /// Forwarding Policy ID.
        /// </summary>
        [Output("forwardingRuleId")]
        public Output<string> ForwardingRuleId { get; private set; } = null!;

        /// <summary>
        /// Forwarding policy name. The length of the name is 2-128 English or Chinese characters. It must start with uppercase and lowercase letters or Chinese characters. It can contain numbers, half width period (.), underscores (_) And dash (-).
        /// </summary>
        [Output("forwardingRuleName")]
        public Output<string?> ForwardingRuleName { get; private set; } = null!;

        /// <summary>
        /// Forwarding Policy Status.
        /// </summary>
        [Output("forwardingRuleStatus")]
        public Output<string> ForwardingRuleStatus { get; private set; } = null!;

        /// <summary>
        /// The ID of the listener.
        /// </summary>
        [Output("listenerId")]
        public Output<string> ListenerId { get; private set; } = null!;

        /// <summary>
        /// Forwarding policy priority.
        /// </summary>
        [Output("priority")]
        public Output<int> Priority { get; private set; } = null!;

        /// <summary>
        /// Forward action.
        /// </summary>
        [Output("ruleActions")]
        public Output<ImmutableArray<Outputs.ForwardingRuleRuleAction>> RuleActions { get; private set; } = null!;

        /// <summary>
        /// Forwarding condition list.
        /// </summary>
        [Output("ruleConditions")]
        public Output<ImmutableArray<Outputs.ForwardingRuleRuleCondition>> RuleConditions { get; private set; } = null!;


        /// <summary>
        /// Create a ForwardingRule 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 ForwardingRule(string name, ForwardingRuleArgs args, CustomResourceOptions? options = null)
            : base("alicloud:ga/forwardingRule:ForwardingRule", name, args ?? new ForwardingRuleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ForwardingRule(string name, Input<string> id, ForwardingRuleState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:ga/forwardingRule:ForwardingRule", 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/rhysmdnz/pulumi-alicloud",
            };
            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 ForwardingRule 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 ForwardingRule Get(string name, Input<string> id, ForwardingRuleState? state = null, CustomResourceOptions? options = null)
        {
            return new ForwardingRule(name, id, state, options);
        }
    }

    public sealed class ForwardingRuleArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The ID of the Global Accelerator instance.
        /// </summary>
        [Input("acceleratorId", required: true)]
        public Input<string> AcceleratorId { get; set; } = null!;

        /// <summary>
        /// Forwarding policy name. The length of the name is 2-128 English or Chinese characters. It must start with uppercase and lowercase letters or Chinese characters. It can contain numbers, half width period (.), underscores (_) And dash (-).
        /// </summary>
        [Input("forwardingRuleName")]
        public Input<string>? ForwardingRuleName { get; set; }

        /// <summary>
        /// The ID of the listener.
        /// </summary>
        [Input("listenerId", required: true)]
        public Input<string> ListenerId { get; set; } = null!;

        /// <summary>
        /// Forwarding policy priority.
        /// </summary>
        [Input("priority")]
        public Input<int>? Priority { get; set; }

        [Input("ruleActions", required: true)]
        private InputList<Inputs.ForwardingRuleRuleActionArgs>? _ruleActions;

        /// <summary>
        /// Forward action.
        /// </summary>
        public InputList<Inputs.ForwardingRuleRuleActionArgs> RuleActions
        {
            get => _ruleActions ?? (_ruleActions = new InputList<Inputs.ForwardingRuleRuleActionArgs>());
            set => _ruleActions = value;
        }

        [Input("ruleConditions", required: true)]
        private InputList<Inputs.ForwardingRuleRuleConditionArgs>? _ruleConditions;

        /// <summary>
        /// Forwarding condition list.
        /// </summary>
        public InputList<Inputs.ForwardingRuleRuleConditionArgs> RuleConditions
        {
            get => _ruleConditions ?? (_ruleConditions = new InputList<Inputs.ForwardingRuleRuleConditionArgs>());
            set => _ruleConditions = value;
        }

        public ForwardingRuleArgs()
        {
        }
        public static new ForwardingRuleArgs Empty => new ForwardingRuleArgs();
    }

    public sealed class ForwardingRuleState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The ID of the Global Accelerator instance.
        /// </summary>
        [Input("acceleratorId")]
        public Input<string>? AcceleratorId { get; set; }

        /// <summary>
        /// Forwarding Policy ID.
        /// </summary>
        [Input("forwardingRuleId")]
        public Input<string>? ForwardingRuleId { get; set; }

        /// <summary>
        /// Forwarding policy name. The length of the name is 2-128 English or Chinese characters. It must start with uppercase and lowercase letters or Chinese characters. It can contain numbers, half width period (.), underscores (_) And dash (-).
        /// </summary>
        [Input("forwardingRuleName")]
        public Input<string>? ForwardingRuleName { get; set; }

        /// <summary>
        /// Forwarding Policy Status.
        /// </summary>
        [Input("forwardingRuleStatus")]
        public Input<string>? ForwardingRuleStatus { get; set; }

        /// <summary>
        /// The ID of the listener.
        /// </summary>
        [Input("listenerId")]
        public Input<string>? ListenerId { get; set; }

        /// <summary>
        /// Forwarding policy priority.
        /// </summary>
        [Input("priority")]
        public Input<int>? Priority { get; set; }

        [Input("ruleActions")]
        private InputList<Inputs.ForwardingRuleRuleActionGetArgs>? _ruleActions;

        /// <summary>
        /// Forward action.
        /// </summary>
        public InputList<Inputs.ForwardingRuleRuleActionGetArgs> RuleActions
        {
            get => _ruleActions ?? (_ruleActions = new InputList<Inputs.ForwardingRuleRuleActionGetArgs>());
            set => _ruleActions = value;
        }

        [Input("ruleConditions")]
        private InputList<Inputs.ForwardingRuleRuleConditionGetArgs>? _ruleConditions;

        /// <summary>
        /// Forwarding condition list.
        /// </summary>
        public InputList<Inputs.ForwardingRuleRuleConditionGetArgs> RuleConditions
        {
            get => _ruleConditions ?? (_ruleConditions = new InputList<Inputs.ForwardingRuleRuleConditionGetArgs>());
            set => _ruleConditions = value;
        }

        public ForwardingRuleState()
        {
        }
        public static new ForwardingRuleState Empty => new ForwardingRuleState();
    }
}
