// *** 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.CloudFirewall
{
    /// <summary>
    /// Provides a Cloud Firewall Control Policy resource.
    /// 
    /// For information about Cloud Firewall Control Policy and how to use it, see [What is Control Policy](https://www.alibabacloud.com/help/doc-detail/138867.htm).
    /// 
    /// &gt; **NOTE:** Available in v1.129.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var example = new AliCloud.CloudFirewall.ControlPolicy("example", new()
    ///     {
    ///         AclAction = "accept",
    ///         ApplicationName = "ANY",
    ///         Description = "example",
    ///         Destination = "100.1.1.0/24",
    ///         DestinationType = "net",
    ///         Direction = "out",
    ///         Proto = "ANY",
    ///         Source = "1.2.3.0/24",
    ///         SourceType = "net",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Cloud Firewall Control Policy can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:cloudfirewall/controlPolicy:ControlPolicy example &lt;acl_uuid&gt;:&lt;direction&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:cloudfirewall/controlPolicy:ControlPolicy")]
    public partial class ControlPolicy : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The action that Cloud Firewall performs on the traffic. Valid values: `accept`, `drop`, `log`.
        /// </summary>
        [Output("aclAction")]
        public Output<string> AclAction { get; private set; } = null!;

        /// <summary>
        /// (Available in v1.148.0+) The unique ID of the access control policy.
        /// </summary>
        [Output("aclUuid")]
        public Output<string> AclUuid { get; private set; } = null!;

        /// <summary>
        /// The application type that the access control policy supports.If `direction` is `in`, the valid value is `ANY`. If `direction` is `out`, the valid values are `ANY`, `HTTP`, `HTTPS`, `MQTT`, `Memcache`, `MongoDB`, `MySQL`, `RDP`, `Redis`, `SMTP`, `SMTPS`, `SSH`, `SSL`, `VNC`.
        /// </summary>
        [Output("applicationName")]
        public Output<string> ApplicationName { get; private set; } = null!;

        /// <summary>
        /// The description of the access control policy.
        /// </summary>
        [Output("description")]
        public Output<string> Description { get; private set; } = null!;

        /// <summary>
        /// The destination port defined in the access control policy.
        /// </summary>
        [Output("destPort")]
        public Output<string> DestPort { get; private set; } = null!;

        /// <summary>
        /// The destination port address book defined in the access control policy.
        /// </summary>
        [Output("destPortGroup")]
        public Output<string> DestPortGroup { get; private set; } = null!;

        /// <summary>
        /// The destination port type defined in the access control policy. Valid values: `group`, `port`.
        /// </summary>
        [Output("destPortType")]
        public Output<string> DestPortType { get; private set; } = null!;

        /// <summary>
        /// The destination address defined in the access control policy.
        /// </summary>
        [Output("destination")]
        public Output<string> Destination { get; private set; } = null!;

        /// <summary>
        /// DestinationType. Valid values: If Direction is `in`, the valid values are `net`, `group`. If `direction` is `out`, the valid values are `net`, `group`, `domain`, `location`.
        /// </summary>
        [Output("destinationType")]
        public Output<string> DestinationType { get; private set; } = null!;

        /// <summary>
        /// Direction. Valid values: `in`, `out`.
        /// </summary>
        [Output("direction")]
        public Output<string> Direction { get; private set; } = null!;

        /// <summary>
        /// The ip version.
        /// </summary>
        [Output("ipVersion")]
        public Output<string?> IpVersion { get; private set; } = null!;

        /// <summary>
        /// DestPortGroupPorts. Valid values: `en`, `zh`.
        /// </summary>
        [Output("lang")]
        public Output<string?> Lang { get; private set; } = null!;

        /// <summary>
        /// Proto. Valid values: ` TCP`, ` UDP`, `ANY`, `ICMP`.
        /// </summary>
        [Output("proto")]
        public Output<string> Proto { get; private set; } = null!;

        /// <summary>
        /// Specifies whether the access control policy is enabled. By default, an access control policy is enabled after it is created. Valid values: `true`, `false`.
        /// </summary>
        [Output("release")]
        public Output<string> Release { get; private set; } = null!;

        /// <summary>
        /// Source.
        /// </summary>
        [Output("source")]
        public Output<string> Source { get; private set; } = null!;

        /// <summary>
        /// The source ip.
        /// </summary>
        [Output("sourceIp")]
        public Output<string> SourceIp { get; private set; } = null!;

        /// <summary>
        /// SourceType. Valid values: If `direction` is `in`, the valid values are `net`, `group`, `location`. If `direction` is `out`, the valid values are `net`, `group`.
        /// </summary>
        [Output("sourceType")]
        public Output<string> SourceType { get; private set; } = null!;


        /// <summary>
        /// Create a ControlPolicy 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 ControlPolicy(string name, ControlPolicyArgs args, CustomResourceOptions? options = null)
            : base("alicloud:cloudfirewall/controlPolicy:ControlPolicy", name, args ?? new ControlPolicyArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ControlPolicy(string name, Input<string> id, ControlPolicyState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:cloudfirewall/controlPolicy:ControlPolicy", 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 ControlPolicy 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 ControlPolicy Get(string name, Input<string> id, ControlPolicyState? state = null, CustomResourceOptions? options = null)
        {
            return new ControlPolicy(name, id, state, options);
        }
    }

    public sealed class ControlPolicyArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The action that Cloud Firewall performs on the traffic. Valid values: `accept`, `drop`, `log`.
        /// </summary>
        [Input("aclAction", required: true)]
        public Input<string> AclAction { get; set; } = null!;

        /// <summary>
        /// The application type that the access control policy supports.If `direction` is `in`, the valid value is `ANY`. If `direction` is `out`, the valid values are `ANY`, `HTTP`, `HTTPS`, `MQTT`, `Memcache`, `MongoDB`, `MySQL`, `RDP`, `Redis`, `SMTP`, `SMTPS`, `SSH`, `SSL`, `VNC`.
        /// </summary>
        [Input("applicationName", required: true)]
        public Input<string> ApplicationName { get; set; } = null!;

        /// <summary>
        /// The description of the access control policy.
        /// </summary>
        [Input("description", required: true)]
        public Input<string> Description { get; set; } = null!;

        /// <summary>
        /// The destination port defined in the access control policy.
        /// </summary>
        [Input("destPort")]
        public Input<string>? DestPort { get; set; }

        /// <summary>
        /// The destination port address book defined in the access control policy.
        /// </summary>
        [Input("destPortGroup")]
        public Input<string>? DestPortGroup { get; set; }

        /// <summary>
        /// The destination port type defined in the access control policy. Valid values: `group`, `port`.
        /// </summary>
        [Input("destPortType")]
        public Input<string>? DestPortType { get; set; }

        /// <summary>
        /// The destination address defined in the access control policy.
        /// </summary>
        [Input("destination", required: true)]
        public Input<string> Destination { get; set; } = null!;

        /// <summary>
        /// DestinationType. Valid values: If Direction is `in`, the valid values are `net`, `group`. If `direction` is `out`, the valid values are `net`, `group`, `domain`, `location`.
        /// </summary>
        [Input("destinationType", required: true)]
        public Input<string> DestinationType { get; set; } = null!;

        /// <summary>
        /// Direction. Valid values: `in`, `out`.
        /// </summary>
        [Input("direction", required: true)]
        public Input<string> Direction { get; set; } = null!;

        /// <summary>
        /// The ip version.
        /// </summary>
        [Input("ipVersion")]
        public Input<string>? IpVersion { get; set; }

        /// <summary>
        /// DestPortGroupPorts. Valid values: `en`, `zh`.
        /// </summary>
        [Input("lang")]
        public Input<string>? Lang { get; set; }

        /// <summary>
        /// Proto. Valid values: ` TCP`, ` UDP`, `ANY`, `ICMP`.
        /// </summary>
        [Input("proto", required: true)]
        public Input<string> Proto { get; set; } = null!;

        /// <summary>
        /// Specifies whether the access control policy is enabled. By default, an access control policy is enabled after it is created. Valid values: `true`, `false`.
        /// </summary>
        [Input("release")]
        public Input<string>? Release { get; set; }

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

        /// <summary>
        /// The source ip.
        /// </summary>
        [Input("sourceIp")]
        public Input<string>? SourceIp { get; set; }

        /// <summary>
        /// SourceType. Valid values: If `direction` is `in`, the valid values are `net`, `group`, `location`. If `direction` is `out`, the valid values are `net`, `group`.
        /// </summary>
        [Input("sourceType", required: true)]
        public Input<string> SourceType { get; set; } = null!;

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

    public sealed class ControlPolicyState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The action that Cloud Firewall performs on the traffic. Valid values: `accept`, `drop`, `log`.
        /// </summary>
        [Input("aclAction")]
        public Input<string>? AclAction { get; set; }

        /// <summary>
        /// (Available in v1.148.0+) The unique ID of the access control policy.
        /// </summary>
        [Input("aclUuid")]
        public Input<string>? AclUuid { get; set; }

        /// <summary>
        /// The application type that the access control policy supports.If `direction` is `in`, the valid value is `ANY`. If `direction` is `out`, the valid values are `ANY`, `HTTP`, `HTTPS`, `MQTT`, `Memcache`, `MongoDB`, `MySQL`, `RDP`, `Redis`, `SMTP`, `SMTPS`, `SSH`, `SSL`, `VNC`.
        /// </summary>
        [Input("applicationName")]
        public Input<string>? ApplicationName { get; set; }

        /// <summary>
        /// The description of the access control policy.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The destination port defined in the access control policy.
        /// </summary>
        [Input("destPort")]
        public Input<string>? DestPort { get; set; }

        /// <summary>
        /// The destination port address book defined in the access control policy.
        /// </summary>
        [Input("destPortGroup")]
        public Input<string>? DestPortGroup { get; set; }

        /// <summary>
        /// The destination port type defined in the access control policy. Valid values: `group`, `port`.
        /// </summary>
        [Input("destPortType")]
        public Input<string>? DestPortType { get; set; }

        /// <summary>
        /// The destination address defined in the access control policy.
        /// </summary>
        [Input("destination")]
        public Input<string>? Destination { get; set; }

        /// <summary>
        /// DestinationType. Valid values: If Direction is `in`, the valid values are `net`, `group`. If `direction` is `out`, the valid values are `net`, `group`, `domain`, `location`.
        /// </summary>
        [Input("destinationType")]
        public Input<string>? DestinationType { get; set; }

        /// <summary>
        /// Direction. Valid values: `in`, `out`.
        /// </summary>
        [Input("direction")]
        public Input<string>? Direction { get; set; }

        /// <summary>
        /// The ip version.
        /// </summary>
        [Input("ipVersion")]
        public Input<string>? IpVersion { get; set; }

        /// <summary>
        /// DestPortGroupPorts. Valid values: `en`, `zh`.
        /// </summary>
        [Input("lang")]
        public Input<string>? Lang { get; set; }

        /// <summary>
        /// Proto. Valid values: ` TCP`, ` UDP`, `ANY`, `ICMP`.
        /// </summary>
        [Input("proto")]
        public Input<string>? Proto { get; set; }

        /// <summary>
        /// Specifies whether the access control policy is enabled. By default, an access control policy is enabled after it is created. Valid values: `true`, `false`.
        /// </summary>
        [Input("release")]
        public Input<string>? Release { get; set; }

        /// <summary>
        /// Source.
        /// </summary>
        [Input("source")]
        public Input<string>? Source { get; set; }

        /// <summary>
        /// The source ip.
        /// </summary>
        [Input("sourceIp")]
        public Input<string>? SourceIp { get; set; }

        /// <summary>
        /// SourceType. Valid values: If `direction` is `in`, the valid values are `net`, `group`, `location`. If `direction` is `out`, the valid values are `net`, `group`.
        /// </summary>
        [Input("sourceType")]
        public Input<string>? SourceType { get; set; }

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