// *** 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 Address Book resource.
    /// 
    /// For information about Cloud Firewall Address Book and how to use it, see [What is Address Book](https://www.alibabacloud.com/help/en/cloud-firewall/latest/describeaddressbook).
    /// 
    /// &gt; **NOTE:** Available in v1.178.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.AddressBook("example", new()
    ///     {
    ///         AutoAddTagEcs = 0,
    ///         Description = "example_value",
    ///         EcsTags = new[]
    ///         {
    ///             new AliCloud.CloudFirewall.Inputs.AddressBookEcsTagArgs
    ///             {
    ///                 TagKey = "created",
    ///                 TagValue = "tfTestAcc0",
    ///             },
    ///         },
    ///         GroupName = "example_value",
    ///         GroupType = "tag",
    ///         TagRelation = "and",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Cloud Firewall Address Book can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:cloudfirewall/addressBook:AddressBook example &lt;id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:cloudfirewall/addressBook:AddressBook")]
    public partial class AddressBook : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The list of addresses.
        /// </summary>
        [Output("addressLists")]
        public Output<ImmutableArray<string>> AddressLists { get; private set; } = null!;

        /// <summary>
        /// Whether you want to automatically add new matching tags of the ECS IP address to the Address Book. Valid values: `0`, `1`.
        /// </summary>
        [Output("autoAddTagEcs")]
        public Output<int?> AutoAddTagEcs { get; private set; } = null!;

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

        /// <summary>
        /// A list of ECS tags. See the following `Block ecs_tags`.
        /// </summary>
        [Output("ecsTags")]
        public Output<ImmutableArray<Outputs.AddressBookEcsTag>> EcsTags { get; private set; } = null!;

        /// <summary>
        /// The name of the Address Book.
        /// </summary>
        [Output("groupName")]
        public Output<string> GroupName { get; private set; } = null!;

        /// <summary>
        /// The type of the Address Book. Valid values:  `ip`, `tag`.
        /// </summary>
        [Output("groupType")]
        public Output<string> GroupType { get; private set; } = null!;

        /// <summary>
        /// The language of the content within the request and response. Valid values: `en`, `zh`.
        /// </summary>
        [Output("lang")]
        public Output<string?> Lang { get; private set; } = null!;

        /// <summary>
        /// The logical relation among the ECS tags that to be matched. Valid values:
        /// - **and**: Only the public IP addresses of ECS instances that match all the specified tags can be added to the Address Book. This is the default value.
        /// - **or**: The public IP addresses of ECS instances that match one of the specified tags can be added to the Address Book.
        /// </summary>
        [Output("tagRelation")]
        public Output<string?> TagRelation { get; private set; } = null!;


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

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

    public sealed class AddressBookArgs : global::Pulumi.ResourceArgs
    {
        [Input("addressLists")]
        private InputList<string>? _addressLists;

        /// <summary>
        /// The list of addresses.
        /// </summary>
        public InputList<string> AddressLists
        {
            get => _addressLists ?? (_addressLists = new InputList<string>());
            set => _addressLists = value;
        }

        /// <summary>
        /// Whether you want to automatically add new matching tags of the ECS IP address to the Address Book. Valid values: `0`, `1`.
        /// </summary>
        [Input("autoAddTagEcs")]
        public Input<int>? AutoAddTagEcs { get; set; }

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

        [Input("ecsTags")]
        private InputList<Inputs.AddressBookEcsTagArgs>? _ecsTags;

        /// <summary>
        /// A list of ECS tags. See the following `Block ecs_tags`.
        /// </summary>
        public InputList<Inputs.AddressBookEcsTagArgs> EcsTags
        {
            get => _ecsTags ?? (_ecsTags = new InputList<Inputs.AddressBookEcsTagArgs>());
            set => _ecsTags = value;
        }

        /// <summary>
        /// The name of the Address Book.
        /// </summary>
        [Input("groupName", required: true)]
        public Input<string> GroupName { get; set; } = null!;

        /// <summary>
        /// The type of the Address Book. Valid values:  `ip`, `tag`.
        /// </summary>
        [Input("groupType", required: true)]
        public Input<string> GroupType { get; set; } = null!;

        /// <summary>
        /// The language of the content within the request and response. Valid values: `en`, `zh`.
        /// </summary>
        [Input("lang")]
        public Input<string>? Lang { get; set; }

        /// <summary>
        /// The logical relation among the ECS tags that to be matched. Valid values:
        /// - **and**: Only the public IP addresses of ECS instances that match all the specified tags can be added to the Address Book. This is the default value.
        /// - **or**: The public IP addresses of ECS instances that match one of the specified tags can be added to the Address Book.
        /// </summary>
        [Input("tagRelation")]
        public Input<string>? TagRelation { get; set; }

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

    public sealed class AddressBookState : global::Pulumi.ResourceArgs
    {
        [Input("addressLists")]
        private InputList<string>? _addressLists;

        /// <summary>
        /// The list of addresses.
        /// </summary>
        public InputList<string> AddressLists
        {
            get => _addressLists ?? (_addressLists = new InputList<string>());
            set => _addressLists = value;
        }

        /// <summary>
        /// Whether you want to automatically add new matching tags of the ECS IP address to the Address Book. Valid values: `0`, `1`.
        /// </summary>
        [Input("autoAddTagEcs")]
        public Input<int>? AutoAddTagEcs { get; set; }

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

        [Input("ecsTags")]
        private InputList<Inputs.AddressBookEcsTagGetArgs>? _ecsTags;

        /// <summary>
        /// A list of ECS tags. See the following `Block ecs_tags`.
        /// </summary>
        public InputList<Inputs.AddressBookEcsTagGetArgs> EcsTags
        {
            get => _ecsTags ?? (_ecsTags = new InputList<Inputs.AddressBookEcsTagGetArgs>());
            set => _ecsTags = value;
        }

        /// <summary>
        /// The name of the Address Book.
        /// </summary>
        [Input("groupName")]
        public Input<string>? GroupName { get; set; }

        /// <summary>
        /// The type of the Address Book. Valid values:  `ip`, `tag`.
        /// </summary>
        [Input("groupType")]
        public Input<string>? GroupType { get; set; }

        /// <summary>
        /// The language of the content within the request and response. Valid values: `en`, `zh`.
        /// </summary>
        [Input("lang")]
        public Input<string>? Lang { get; set; }

        /// <summary>
        /// The logical relation among the ECS tags that to be matched. Valid values:
        /// - **and**: Only the public IP addresses of ECS instances that match all the specified tags can be added to the Address Book. This is the default value.
        /// - **or**: The public IP addresses of ECS instances that match one of the specified tags can be added to the Address Book.
        /// </summary>
        [Input("tagRelation")]
        public Input<string>? TagRelation { get; set; }

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