Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getBgpNetworks

This data source provides the Vpc Bgp Networks of the current Alibaba Cloud user.

NOTE: Available in v1.153.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var ids = Output.Create(AliCloud.Vpc.GetBgpNetworks.InvokeAsync(new AliCloud.Vpc.GetBgpNetworksArgs
        {
            Ids = 
            {
                "example_value",
            },
        }));
        this.VpcBgpNetworkId1 = ids.Apply(ids => ids.Networks?[0]?.Id);
        var routerId = Output.Create(AliCloud.Vpc.GetBgpNetworks.InvokeAsync(new AliCloud.Vpc.GetBgpNetworksArgs
        {
            RouterId = "example_value",
        }));
        this.VpcBgpNetworkId2 = routerId.Apply(routerId => routerId.Networks?[0]?.Id);
        var status = Output.Create(AliCloud.Vpc.GetBgpNetworks.InvokeAsync(new AliCloud.Vpc.GetBgpNetworksArgs
        {
            Status = "Available",
        }));
        this.VpcBgpNetworkId3 = status.Apply(status => status.Networks?[0]?.Id);
    }

    [Output("vpcBgpNetworkId1")]
    public Output<string> VpcBgpNetworkId1 { get; set; }
    [Output("vpcBgpNetworkId2")]
    public Output<string> VpcBgpNetworkId2 { get; set; }
    [Output("vpcBgpNetworkId3")]
    public Output<string> VpcBgpNetworkId3 { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := vpc.GetBgpNetworks(ctx, &vpc.GetBgpNetworksArgs{
			Ids: []string{
				"example_value",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("vpcBgpNetworkId1", ids.Networks[0].Id)
		routerId, err := vpc.GetBgpNetworks(ctx, &vpc.GetBgpNetworksArgs{
			RouterId: pulumi.StringRef("example_value"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("vpcBgpNetworkId2", routerId.Networks[0].Id)
		status, err := vpc.GetBgpNetworks(ctx, &vpc.GetBgpNetworksArgs{
			Status: pulumi.StringRef("Available"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("vpcBgpNetworkId3", status.Networks[0].Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetBgpNetworksArgs;
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) {
        final var ids = VpcFunctions.getBgpNetworks(GetBgpNetworksArgs.builder()
            .ids("example_value")
            .build());

        ctx.export("vpcBgpNetworkId1", ids.applyValue(getBgpNetworksResult -> getBgpNetworksResult.networks()[0].id()));
        final var routerId = VpcFunctions.getBgpNetworks(GetBgpNetworksArgs.builder()
            .routerId("example_value")
            .build());

        ctx.export("vpcBgpNetworkId2", routerId.applyValue(getBgpNetworksResult -> getBgpNetworksResult.networks()[0].id()));
        final var status = VpcFunctions.getBgpNetworks(GetBgpNetworksArgs.builder()
            .status("Available")
            .build());

        ctx.export("vpcBgpNetworkId3", status.applyValue(getBgpNetworksResult -> getBgpNetworksResult.networks()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.vpc.get_bgp_networks(ids=["example_value"])
pulumi.export("vpcBgpNetworkId1", ids.networks[0].id)
router_id = alicloud.vpc.get_bgp_networks(router_id="example_value")
pulumi.export("vpcBgpNetworkId2", router_id.networks[0].id)
status = alicloud.vpc.get_bgp_networks(status="Available")
pulumi.export("vpcBgpNetworkId3", status.networks[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.vpc.getBgpNetworks({
    ids: ["example_value"],
});
export const vpcBgpNetworkId1 = ids.then(ids => ids.networks?[0]?.id);
const routerId = alicloud.vpc.getBgpNetworks({
    routerId: "example_value",
});
export const vpcBgpNetworkId2 = routerId.then(routerId => routerId.networks?[0]?.id);
const status = alicloud.vpc.getBgpNetworks({
    status: "Available",
});
export const vpcBgpNetworkId3 = status.then(status => status.networks?[0]?.id);
variables:
  ids:
    Fn::Invoke:
      Function: alicloud:vpc:getBgpNetworks
      Arguments:
        ids:
          - example_value
  routerId:
    Fn::Invoke:
      Function: alicloud:vpc:getBgpNetworks
      Arguments:
        routerId: example_value
  status:
    Fn::Invoke:
      Function: alicloud:vpc:getBgpNetworks
      Arguments:
        status: Available
outputs:
  vpcBgpNetworkId1: ${ids.networks[0].id}
  vpcBgpNetworkId2: ${routerId.networks[0].id}
  vpcBgpNetworkId3: ${status.networks[0].id}

Using getBgpNetworks

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getBgpNetworks(args: GetBgpNetworksArgs, opts?: InvokeOptions): Promise<GetBgpNetworksResult>
function getBgpNetworksOutput(args: GetBgpNetworksOutputArgs, opts?: InvokeOptions): Output<GetBgpNetworksResult>
def get_bgp_networks(ids: Optional[Sequence[str]] = None,
                     output_file: Optional[str] = None,
                     router_id: Optional[str] = None,
                     status: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetBgpNetworksResult
def get_bgp_networks_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     output_file: Optional[pulumi.Input[str]] = None,
                     router_id: Optional[pulumi.Input[str]] = None,
                     status: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetBgpNetworksResult]
func GetBgpNetworks(ctx *Context, args *GetBgpNetworksArgs, opts ...InvokeOption) (*GetBgpNetworksResult, error)
func GetBgpNetworksOutput(ctx *Context, args *GetBgpNetworksOutputArgs, opts ...InvokeOption) GetBgpNetworksResultOutput

> Note: This function is named GetBgpNetworks in the Go SDK.

public static class GetBgpNetworks 
{
    public static Task<GetBgpNetworksResult> InvokeAsync(GetBgpNetworksArgs args, InvokeOptions? opts = null)
    public static Output<GetBgpNetworksResult> Invoke(GetBgpNetworksInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetBgpNetworksResult> getBgpNetworks(GetBgpNetworksArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: alicloud:vpc/getBgpNetworks:getBgpNetworks
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Ids List<string>

A list of Bgp Network IDs.

OutputFile string
RouterId string

The ID of the vRouter.

Status string

The state of the advertised BGP network.

Ids []string

A list of Bgp Network IDs.

OutputFile string
RouterId string

The ID of the vRouter.

Status string

The state of the advertised BGP network.

ids List<String>

A list of Bgp Network IDs.

outputFile String
routerId String

The ID of the vRouter.

status String

The state of the advertised BGP network.

ids string[]

A list of Bgp Network IDs.

outputFile string
routerId string

The ID of the vRouter.

status string

The state of the advertised BGP network.

ids Sequence[str]

A list of Bgp Network IDs.

output_file str
router_id str

The ID of the vRouter.

status str

The state of the advertised BGP network.

ids List<String>

A list of Bgp Network IDs.

outputFile String
routerId String

The ID of the vRouter.

status String

The state of the advertised BGP network.

getBgpNetworks Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Networks List<Pulumi.AliCloud.Vpc.Outputs.GetBgpNetworksNetwork>
OutputFile string
RouterId string
Status string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Networks []GetBgpNetworksNetwork
OutputFile string
RouterId string
Status string
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
networks List<GetBgpNetworksNetwork>
outputFile String
routerId String
status String
id string

The provider-assigned unique ID for this managed resource.

ids string[]
networks GetBgpNetworksNetwork[]
outputFile string
routerId string
status string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
networks Sequence[GetBgpNetworksNetwork]
output_file str
router_id str
status str
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
networks List<Property Map>
outputFile String
routerId String
status String

Supporting Types

GetBgpNetworksNetwork

DstCidrBlock string

Advertised BGP networks.

Id string

The ID of the Bgp Network. The value formats as <router_id>:<dst_cidr_block>.

RouterId string

The ID of the vRouter.

Status string

The state of the advertised BGP network.

DstCidrBlock string

Advertised BGP networks.

Id string

The ID of the Bgp Network. The value formats as <router_id>:<dst_cidr_block>.

RouterId string

The ID of the vRouter.

Status string

The state of the advertised BGP network.

dstCidrBlock String

Advertised BGP networks.

id String

The ID of the Bgp Network. The value formats as <router_id>:<dst_cidr_block>.

routerId String

The ID of the vRouter.

status String

The state of the advertised BGP network.

dstCidrBlock string

Advertised BGP networks.

id string

The ID of the Bgp Network. The value formats as <router_id>:<dst_cidr_block>.

routerId string

The ID of the vRouter.

status string

The state of the advertised BGP network.

dst_cidr_block str

Advertised BGP networks.

id str

The ID of the Bgp Network. The value formats as <router_id>:<dst_cidr_block>.

router_id str

The ID of the vRouter.

status str

The state of the advertised BGP network.

dstCidrBlock String

Advertised BGP networks.

id String

The ID of the Bgp Network. The value formats as <router_id>:<dst_cidr_block>.

routerId String

The ID of the vRouter.

status String

The state of the advertised BGP network.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.