// *** 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 Cuemby.Equinix
{
    /// <summary>
    /// Resource `equinix.NetworkACLTemplate` allows creation and management of
    /// Equinix Network Edge device Access Control List templates.
    /// 
    /// Device ACL templates give possibility to define set of rules will allowed inbound
    /// traffic. Templates can be assigned to the network devices.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Equinix = Cuemby.Equinix;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         // Creates ACL template and assigns it to the network device
    ///         var myacl = new Equinix.NetworkACLTemplate("myacl", new Equinix.NetworkACLTemplateArgs
    ///         {
    ///             Description = "Test ACL template",
    ///             InboundRules = 
    ///             {
    ///                 new Equinix.Inputs.NetworkACLTemplateInboundRuleArgs
    ///                 {
    ///                     DstPort = "any",
    ///                     Protocol = "IP",
    ///                     SrcPort = "any",
    ///                     Subnet = "1.1.1.1/32",
    ///                 },
    ///                 new Equinix.Inputs.NetworkACLTemplateInboundRuleArgs
    ///                 {
    ///                     DstPort = "53,1045,2041",
    ///                     Protocol = "UDP",
    ///                     SrcPort = "any",
    ///                     Subnet = "172.16.25.0/24",
    ///                 },
    ///             },
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// ## Import
    /// 
    /// This resource can be imported using an existing ID
    /// 
    /// ```sh
    ///  $ pulumi import equinix:index/networkACLTemplate:NetworkACLTemplate example {existing_id}
    /// ```
    /// </summary>
    [EquinixResourceType("equinix:index/networkACLTemplate:NetworkACLTemplate")]
    public partial class NetworkACLTemplate : Pulumi.CustomResource
    {
        /// <summary>
        /// ACL template description.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// Status of ACL template provisioning process, where template was applied.
        /// One of `PROVISIONING`, `PROVISIONED`.
        /// </summary>
        [Output("deviceAclStatus")]
        public Output<string> DeviceAclStatus { get; private set; } = null!;

        /// <summary>
        /// List of the devices where the ACL template is applied.
        /// </summary>
        [Output("deviceDetails")]
        public Output<ImmutableArray<Outputs.NetworkACLTemplateDeviceDetail>> DeviceDetails { get; private set; } = null!;

        /// <summary>
        /// (Deprecated) Identifier of a network device where template was applied.
        /// </summary>
        [Output("deviceId")]
        public Output<string> DeviceId { get; private set; } = null!;

        /// <summary>
        /// One or more rules to specify allowed inbound traffic.
        /// Rules are ordered, matching traffic rule stops processing subsequent ones.
        /// </summary>
        [Output("inboundRules")]
        public Output<ImmutableArray<Outputs.NetworkACLTemplateInboundRule>> InboundRules { get; private set; } = null!;

        /// <summary>
        /// ACL template location metro code.
        /// </summary>
        [Output("metroCode")]
        public Output<string?> MetroCode { get; private set; } = null!;

        /// <summary>
        /// ACL template name.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

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


        /// <summary>
        /// Create a NetworkACLTemplate 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 NetworkACLTemplate(string name, NetworkACLTemplateArgs args, CustomResourceOptions? options = null)
            : base("equinix:index/networkACLTemplate:NetworkACLTemplate", name, args ?? new NetworkACLTemplateArgs(), MakeResourceOptions(options, ""))
        {
        }

        private NetworkACLTemplate(string name, Input<string> id, NetworkACLTemplateState? state = null, CustomResourceOptions? options = null)
            : base("equinix:index/networkACLTemplate:NetworkACLTemplate", 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/cuemby",
            };
            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 NetworkACLTemplate 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 NetworkACLTemplate Get(string name, Input<string> id, NetworkACLTemplateState? state = null, CustomResourceOptions? options = null)
        {
            return new NetworkACLTemplate(name, id, state, options);
        }
    }

    public sealed class NetworkACLTemplateArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// ACL template description.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        [Input("inboundRules", required: true)]
        private InputList<Inputs.NetworkACLTemplateInboundRuleArgs>? _inboundRules;

        /// <summary>
        /// One or more rules to specify allowed inbound traffic.
        /// Rules are ordered, matching traffic rule stops processing subsequent ones.
        /// </summary>
        public InputList<Inputs.NetworkACLTemplateInboundRuleArgs> InboundRules
        {
            get => _inboundRules ?? (_inboundRules = new InputList<Inputs.NetworkACLTemplateInboundRuleArgs>());
            set => _inboundRules = value;
        }

        /// <summary>
        /// ACL template location metro code.
        /// </summary>
        [Input("metroCode")]
        public Input<string>? MetroCode { get; set; }

        /// <summary>
        /// ACL template name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        public NetworkACLTemplateArgs()
        {
        }
    }

    public sealed class NetworkACLTemplateState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// ACL template description.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// Status of ACL template provisioning process, where template was applied.
        /// One of `PROVISIONING`, `PROVISIONED`.
        /// </summary>
        [Input("deviceAclStatus")]
        public Input<string>? DeviceAclStatus { get; set; }

        [Input("deviceDetails")]
        private InputList<Inputs.NetworkACLTemplateDeviceDetailGetArgs>? _deviceDetails;

        /// <summary>
        /// List of the devices where the ACL template is applied.
        /// </summary>
        public InputList<Inputs.NetworkACLTemplateDeviceDetailGetArgs> DeviceDetails
        {
            get => _deviceDetails ?? (_deviceDetails = new InputList<Inputs.NetworkACLTemplateDeviceDetailGetArgs>());
            set => _deviceDetails = value;
        }

        /// <summary>
        /// (Deprecated) Identifier of a network device where template was applied.
        /// </summary>
        [Input("deviceId")]
        public Input<string>? DeviceId { get; set; }

        [Input("inboundRules")]
        private InputList<Inputs.NetworkACLTemplateInboundRuleGetArgs>? _inboundRules;

        /// <summary>
        /// One or more rules to specify allowed inbound traffic.
        /// Rules are ordered, matching traffic rule stops processing subsequent ones.
        /// </summary>
        public InputList<Inputs.NetworkACLTemplateInboundRuleGetArgs> InboundRules
        {
            get => _inboundRules ?? (_inboundRules = new InputList<Inputs.NetworkACLTemplateInboundRuleGetArgs>());
            set => _inboundRules = value;
        }

        /// <summary>
        /// ACL template location metro code.
        /// </summary>
        [Input("metroCode")]
        public Input<string>? MetroCode { get; set; }

        /// <summary>
        /// ACL template name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Device uuid.
        /// </summary>
        [Input("uuid")]
        public Input<string>? Uuid { get; set; }

        public NetworkACLTemplateState()
        {
        }
    }
}
