// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.network;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.network.RouteServerBgpConnectionArgs;
import com.pulumi.azure.network.inputs.RouteServerBgpConnectionState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Integer;
import java.lang.String;
import javax.annotation.Nullable;

/**
 * Manages a Bgp Connection for a Route Server
 * 
 * ## Example Usage
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.network.VirtualNetwork;
 * import com.pulumi.azure.network.VirtualNetworkArgs;
 * import com.pulumi.azure.network.Subnet;
 * import com.pulumi.azure.network.SubnetArgs;
 * import com.pulumi.azure.network.PublicIp;
 * import com.pulumi.azure.network.PublicIpArgs;
 * import com.pulumi.azure.network.RouteServer;
 * import com.pulumi.azure.network.RouteServerArgs;
 * import com.pulumi.azure.network.RouteServerBgpConnection;
 * import com.pulumi.azure.network.RouteServerBgpConnectionArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * 
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 * 
 *     public static void stack(Context ctx) {
 *         var exampleResourceGroup = new ResourceGroup(&#34;exampleResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         var exampleVirtualNetwork = new VirtualNetwork(&#34;exampleVirtualNetwork&#34;, VirtualNetworkArgs.builder()        
 *             .addressSpaces(&#34;10.0.0.0/16&#34;)
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .tags(Map.of(&#34;environment&#34;, &#34;Production&#34;))
 *             .build());
 * 
 *         var exampleSubnet = new Subnet(&#34;exampleSubnet&#34;, SubnetArgs.builder()        
 *             .virtualNetworkName(exampleVirtualNetwork.name())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .addressPrefixes(&#34;10.0.1.0/24&#34;)
 *             .build());
 * 
 *         var examplePublicIp = new PublicIp(&#34;examplePublicIp&#34;, PublicIpArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .allocationMethod(&#34;Static&#34;)
 *             .sku(&#34;Standard&#34;)
 *             .build());
 * 
 *         var exampleRouteServer = new RouteServer(&#34;exampleRouteServer&#34;, RouteServerArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .sku(&#34;Standard&#34;)
 *             .publicIpAddressId(examplePublicIp.id())
 *             .subnetId(exampleSubnet.id())
 *             .branchToBranchTrafficEnabled(true)
 *             .build());
 * 
 *         var exampleRouteServerBgpConnection = new RouteServerBgpConnection(&#34;exampleRouteServerBgpConnection&#34;, RouteServerBgpConnectionArgs.builder()        
 *             .routeServerId(exampleRouteServer.id())
 *             .peerAsn(65501)
 *             .peerIp(&#34;169.254.21.5&#34;)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Route Server Bgp Connections can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:network/routeServerBgpConnection:RouteServerBgpConnection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/virtualHubs/routeServer1/bgpConnections/connection1
 * ```
 * 
 */
@ResourceType(type="azure:network/routeServerBgpConnection:RouteServerBgpConnection")
public class RouteServerBgpConnection extends com.pulumi.resources.CustomResource {
    /**
     * The name which should be used for this Route Server Bgp Connection. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return The name which should be used for this Route Server Bgp Connection. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The peer autonomous system number for the Route Server Bgp Connection. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="peerAsn", refs={Integer.class}, tree="[0]")
    private Output<Integer> peerAsn;

    /**
     * @return The peer autonomous system number for the Route Server Bgp Connection. Changing this forces a new resource to be created.
     * 
     */
    public Output<Integer> peerAsn() {
        return this.peerAsn;
    }
    /**
     * The peer ip address for the Route Server Bgp Connection. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="peerIp", refs={String.class}, tree="[0]")
    private Output<String> peerIp;

    /**
     * @return The peer ip address for the Route Server Bgp Connection. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> peerIp() {
        return this.peerIp;
    }
    /**
     * The ID of the Route Server within which this Bgp connection should be created. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="routeServerId", refs={String.class}, tree="[0]")
    private Output<String> routeServerId;

    /**
     * @return The ID of the Route Server within which this Bgp connection should be created. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> routeServerId() {
        return this.routeServerId;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public RouteServerBgpConnection(String name) {
        this(name, RouteServerBgpConnectionArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public RouteServerBgpConnection(String name, RouteServerBgpConnectionArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public RouteServerBgpConnection(String name, RouteServerBgpConnectionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:network/routeServerBgpConnection:RouteServerBgpConnection", name, args == null ? RouteServerBgpConnectionArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private RouteServerBgpConnection(String name, Output<String> id, @Nullable RouteServerBgpConnectionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:network/routeServerBgpConnection:RouteServerBgpConnection", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static RouteServerBgpConnection get(String name, Output<String> id, @Nullable RouteServerBgpConnectionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new RouteServerBgpConnection(name, id, state, options);
    }
}
