<filename>sdk/dotnet/Vpc/BgpPeer.cs// *** 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.Vpc
{
    /// <summary>
    /// Provides a VPC Bgp Peer resource.
    /// 
    /// For information about VPC Bgp Peer and how to use it, see [What is Bgp Peer](https://www.alibabacloud.com/help/en/doc-detail/91267.html).
    /// 
    /// &gt; **NOTE:** Available in v1.153.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var defaultPhysicalConnections = AliCloud.ExpressConnect.GetPhysicalConnections.Invoke();
    /// 
    ///     var defaultVirtualBorderRouter = new AliCloud.ExpressConnect.VirtualBorderRouter("defaultVirtualBorderRouter", new()
    ///     {
    ///         LocalGatewayIp = "10.0.0.1",
    ///         PeerGatewayIp = "10.0.0.2",
    ///         PeeringSubnetMask = "255.255.255.252",
    ///         PhysicalConnectionId = defaultPhysicalConnections.Apply(getPhysicalConnectionsResult =&gt; getPhysicalConnectionsResult.Connections[0]?.Id),
    ///         VirtualBorderRouterName = "example_value",
    ///         VlanId = 120,
    ///         MinRxInterval = 1000,
    ///         MinTxInterval = 1000,
    ///         DetectMultiplier = 10,
    ///     });
    /// 
    ///     var defaultBgpGroup = new AliCloud.Vpc.BgpGroup("defaultBgpGroup", new()
    ///     {
    ///         AuthKey = "YourPassword+12345678",
    ///         BgpGroupName = "example_value",
    ///         Description = "example_value",
    ///         LocalAsn = 64512,
    ///         PeerAsn = 1111,
    ///         RouterId = defaultVirtualBorderRouter.Id,
    ///     });
    /// 
    ///     var defaultBgpPeer = new AliCloud.Vpc.BgpPeer("defaultBgpPeer", new()
    ///     {
    ///         BfdMultiHop = 10,
    ///         BgpGroupId = defaultBgpGroup.Id,
    ///         EnableBfd = true,
    ///         IpVersion = "IPV4",
    ///         PeerIpAddress = "1.1.1.1",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// VPC Bgp Peer can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:vpc/bgpPeer:BgpPeer example &lt;id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:vpc/bgpPeer:BgpPeer")]
    public partial class BgpPeer : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The BFD hop count. Valid values: `1` to `255`. **NOTE:** The attribute is valid when the attribute `enable_bfd` is `true`. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.
        /// </summary>
        [Output("bfdMultiHop")]
        public Output<int?> BfdMultiHop { get; private set; } = null!;

        /// <summary>
        /// The ID of the BGP group.
        /// </summary>
        [Output("bgpGroupId")]
        public Output<string> BgpGroupId { get; private set; } = null!;

        /// <summary>
        /// Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.
        /// </summary>
        [Output("enableBfd")]
        public Output<bool?> EnableBfd { get; private set; } = null!;

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

        /// <summary>
        /// The IP address of the BGP peer.
        /// </summary>
        [Output("peerIpAddress")]
        public Output<string?> PeerIpAddress { get; private set; } = null!;

        /// <summary>
        /// The status of the BGP peer.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;


        /// <summary>
        /// Create a BgpPeer 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 BgpPeer(string name, BgpPeerArgs args, CustomResourceOptions? options = null)
            : base("alicloud:vpc/bgpPeer:BgpPeer", name, args ?? new BgpPeerArgs(), MakeResourceOptions(options, ""))
        {
        }

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

    public sealed class BgpPeerArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The BFD hop count. Valid values: `1` to `255`. **NOTE:** The attribute is valid when the attribute `enable_bfd` is `true`. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.
        /// </summary>
        [Input("bfdMultiHop")]
        public Input<int>? BfdMultiHop { get; set; }

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

        /// <summary>
        /// Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.
        /// </summary>
        [Input("enableBfd")]
        public Input<bool>? EnableBfd { get; set; }

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

        /// <summary>
        /// The IP address of the BGP peer.
        /// </summary>
        [Input("peerIpAddress")]
        public Input<string>? PeerIpAddress { get; set; }

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

    public sealed class BgpPeerState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The BFD hop count. Valid values: `1` to `255`. **NOTE:** The attribute is valid when the attribute `enable_bfd` is `true`. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.
        /// </summary>
        [Input("bfdMultiHop")]
        public Input<int>? BfdMultiHop { get; set; }

        /// <summary>
        /// The ID of the BGP group.
        /// </summary>
        [Input("bgpGroupId")]
        public Input<string>? BgpGroupId { get; set; }

        /// <summary>
        /// Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.
        /// </summary>
        [Input("enableBfd")]
        public Input<bool>? EnableBfd { get; set; }

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

        /// <summary>
        /// The IP address of the BGP peer.
        /// </summary>
        [Input("peerIpAddress")]
        public Input<string>? PeerIpAddress { get; set; }

        /// <summary>
        /// The status of the BGP peer.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

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