1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. vpc
  5. getBgpGroups
Alibaba Cloud v3.45.1 published on Thursday, Dec 7, 2023 by Pulumi

alicloud.vpc.getBgpGroups

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.45.1 published on Thursday, Dec 7, 2023 by Pulumi

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

    NOTE: Available in v1.152.0+.

    Example Usage

    Basic Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Vpc.GetBgpGroups.Invoke(new()
        {
            Ids = new[]
            {
                "example_value",
            },
        });
    
        var nameRegex = AliCloud.Vpc.GetBgpGroups.Invoke(new()
        {
            NameRegex = "^my-BgpGroup",
        });
    
        return new Dictionary<string, object?>
        {
            ["vpcBgpGroupId1"] = ids.Apply(getBgpGroupsResult => getBgpGroupsResult.Groups[0]?.Id),
            ["vpcBgpGroupId2"] = nameRegex.Apply(getBgpGroupsResult => getBgpGroupsResult.Groups[0]?.Id),
        };
    });
    
    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.GetBgpGroups(ctx, &vpc.GetBgpGroupsArgs{
    			Ids: []string{
    				"example_value",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("vpcBgpGroupId1", ids.Groups[0].Id)
    		nameRegex, err := vpc.GetBgpGroups(ctx, &vpc.GetBgpGroupsArgs{
    			NameRegex: pulumi.StringRef("^my-BgpGroup"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("vpcBgpGroupId2", nameRegex.Groups[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.GetBgpGroupsArgs;
    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.getBgpGroups(GetBgpGroupsArgs.builder()
                .ids("example_value")
                .build());
    
            ctx.export("vpcBgpGroupId1", ids.applyValue(getBgpGroupsResult -> getBgpGroupsResult.groups()[0].id()));
            final var nameRegex = VpcFunctions.getBgpGroups(GetBgpGroupsArgs.builder()
                .nameRegex("^my-BgpGroup")
                .build());
    
            ctx.export("vpcBgpGroupId2", nameRegex.applyValue(getBgpGroupsResult -> getBgpGroupsResult.groups()[0].id()));
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.vpc.get_bgp_groups(ids=["example_value"])
    pulumi.export("vpcBgpGroupId1", ids.groups[0].id)
    name_regex = alicloud.vpc.get_bgp_groups(name_regex="^my-BgpGroup")
    pulumi.export("vpcBgpGroupId2", name_regex.groups[0].id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.vpc.getBgpGroups({
        ids: ["example_value"],
    });
    export const vpcBgpGroupId1 = ids.then(ids => ids.groups?.[0]?.id);
    const nameRegex = alicloud.vpc.getBgpGroups({
        nameRegex: "^my-BgpGroup",
    });
    export const vpcBgpGroupId2 = nameRegex.then(nameRegex => nameRegex.groups?.[0]?.id);
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:vpc:getBgpGroups
          Arguments:
            ids:
              - example_value
      nameRegex:
        fn::invoke:
          Function: alicloud:vpc:getBgpGroups
          Arguments:
            nameRegex: ^my-BgpGroup
    outputs:
      vpcBgpGroupId1: ${ids.groups[0].id}
      vpcBgpGroupId2: ${nameRegex.groups[0].id}
    

    Using getBgpGroups

    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 getBgpGroups(args: GetBgpGroupsArgs, opts?: InvokeOptions): Promise<GetBgpGroupsResult>
    function getBgpGroupsOutput(args: GetBgpGroupsOutputArgs, opts?: InvokeOptions): Output<GetBgpGroupsResult>
    def get_bgp_groups(ids: Optional[Sequence[str]] = None,
                       name_regex: Optional[str] = None,
                       output_file: Optional[str] = None,
                       router_id: Optional[str] = None,
                       status: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetBgpGroupsResult
    def get_bgp_groups_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                       name_regex: Optional[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[GetBgpGroupsResult]
    func GetBgpGroups(ctx *Context, args *GetBgpGroupsArgs, opts ...InvokeOption) (*GetBgpGroupsResult, error)
    func GetBgpGroupsOutput(ctx *Context, args *GetBgpGroupsOutputArgs, opts ...InvokeOption) GetBgpGroupsResultOutput

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

    public static class GetBgpGroups 
    {
        public static Task<GetBgpGroupsResult> InvokeAsync(GetBgpGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetBgpGroupsResult> Invoke(GetBgpGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetBgpGroupsResult> getBgpGroups(GetBgpGroupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:vpc/getBgpGroups:getBgpGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>

    A list of Bgp Group IDs.

    NameRegex string

    A regex string to filter results by Bgp Group name.

    OutputFile string

    File name where to save data source results (after running pulumi preview).

    RouterId string

    The ID of the VBR.

    Status string

    The status of the resource.

    Ids []string

    A list of Bgp Group IDs.

    NameRegex string

    A regex string to filter results by Bgp Group name.

    OutputFile string

    File name where to save data source results (after running pulumi preview).

    RouterId string

    The ID of the VBR.

    Status string

    The status of the resource.

    ids List<String>

    A list of Bgp Group IDs.

    nameRegex String

    A regex string to filter results by Bgp Group name.

    outputFile String

    File name where to save data source results (after running pulumi preview).

    routerId String

    The ID of the VBR.

    status String

    The status of the resource.

    ids string[]

    A list of Bgp Group IDs.

    nameRegex string

    A regex string to filter results by Bgp Group name.

    outputFile string

    File name where to save data source results (after running pulumi preview).

    routerId string

    The ID of the VBR.

    status string

    The status of the resource.

    ids Sequence[str]

    A list of Bgp Group IDs.

    name_regex str

    A regex string to filter results by Bgp Group name.

    output_file str

    File name where to save data source results (after running pulumi preview).

    router_id str

    The ID of the VBR.

    status str

    The status of the resource.

    ids List<String>

    A list of Bgp Group IDs.

    nameRegex String

    A regex string to filter results by Bgp Group name.

    outputFile String

    File name where to save data source results (after running pulumi preview).

    routerId String

    The ID of the VBR.

    status String

    The status of the resource.

    getBgpGroups Result

    The following output properties are available:

    Groups List<Pulumi.AliCloud.Vpc.Outputs.GetBgpGroupsGroup>
    Id string

    The provider-assigned unique ID for this managed resource.

    Ids List<string>
    Names List<string>
    NameRegex string
    OutputFile string
    RouterId string
    Status string
    Groups []GetBgpGroupsGroup
    Id string

    The provider-assigned unique ID for this managed resource.

    Ids []string
    Names []string
    NameRegex string
    OutputFile string
    RouterId string
    Status string
    groups List<GetBgpGroupsGroup>
    id String

    The provider-assigned unique ID for this managed resource.

    ids List<String>
    names List<String>
    nameRegex String
    outputFile String
    routerId String
    status String
    groups GetBgpGroupsGroup[]
    id string

    The provider-assigned unique ID for this managed resource.

    ids string[]
    names string[]
    nameRegex string
    outputFile string
    routerId string
    status string
    groups Sequence[GetBgpGroupsGroup]
    id str

    The provider-assigned unique ID for this managed resource.

    ids Sequence[str]
    names Sequence[str]
    name_regex str
    output_file str
    router_id str
    status str
    groups List<Property Map>
    id String

    The provider-assigned unique ID for this managed resource.

    ids List<String>
    names List<String>
    nameRegex String
    outputFile String
    routerId String
    status String

    Supporting Types

    GetBgpGroupsGroup

    AuthKey string

    The key used by the BGP group.

    BgpGroupName string

    The name of the BGP group.

    Description string

    Description of the BGP group.

    Hold string

    The hold time to wait for the incoming BGP message. If no message has been passed in after the hold time, the BGP neighbor is considered disconnected.

    Id string

    The ID of the Bgp Group.

    IpVersion string

    IP version.

    IsFakeAsn bool

    Whether the AS number is false.

    Keepalive string

    The keepalive time.

    LocalAsn int

    The local AS number.

    PeerAsn int

    The autonomous system (AS) number of the BGP peer.

    RouteLimit string

    Routing limits.

    RouterId string

    The ID of the VBR.

    Status string

    The status of the resource.

    AuthKey string

    The key used by the BGP group.

    BgpGroupName string

    The name of the BGP group.

    Description string

    Description of the BGP group.

    Hold string

    The hold time to wait for the incoming BGP message. If no message has been passed in after the hold time, the BGP neighbor is considered disconnected.

    Id string

    The ID of the Bgp Group.

    IpVersion string

    IP version.

    IsFakeAsn bool

    Whether the AS number is false.

    Keepalive string

    The keepalive time.

    LocalAsn int

    The local AS number.

    PeerAsn int

    The autonomous system (AS) number of the BGP peer.

    RouteLimit string

    Routing limits.

    RouterId string

    The ID of the VBR.

    Status string

    The status of the resource.

    authKey String

    The key used by the BGP group.

    bgpGroupName String

    The name of the BGP group.

    description String

    Description of the BGP group.

    hold String

    The hold time to wait for the incoming BGP message. If no message has been passed in after the hold time, the BGP neighbor is considered disconnected.

    id String

    The ID of the Bgp Group.

    ipVersion String

    IP version.

    isFakeAsn Boolean

    Whether the AS number is false.

    keepalive String

    The keepalive time.

    localAsn Integer

    The local AS number.

    peerAsn Integer

    The autonomous system (AS) number of the BGP peer.

    routeLimit String

    Routing limits.

    routerId String

    The ID of the VBR.

    status String

    The status of the resource.

    authKey string

    The key used by the BGP group.

    bgpGroupName string

    The name of the BGP group.

    description string

    Description of the BGP group.

    hold string

    The hold time to wait for the incoming BGP message. If no message has been passed in after the hold time, the BGP neighbor is considered disconnected.

    id string

    The ID of the Bgp Group.

    ipVersion string

    IP version.

    isFakeAsn boolean

    Whether the AS number is false.

    keepalive string

    The keepalive time.

    localAsn number

    The local AS number.

    peerAsn number

    The autonomous system (AS) number of the BGP peer.

    routeLimit string

    Routing limits.

    routerId string

    The ID of the VBR.

    status string

    The status of the resource.

    auth_key str

    The key used by the BGP group.

    bgp_group_name str

    The name of the BGP group.

    description str

    Description of the BGP group.

    hold str

    The hold time to wait for the incoming BGP message. If no message has been passed in after the hold time, the BGP neighbor is considered disconnected.

    id str

    The ID of the Bgp Group.

    ip_version str

    IP version.

    is_fake_asn bool

    Whether the AS number is false.

    keepalive str

    The keepalive time.

    local_asn int

    The local AS number.

    peer_asn int

    The autonomous system (AS) number of the BGP peer.

    route_limit str

    Routing limits.

    router_id str

    The ID of the VBR.

    status str

    The status of the resource.

    authKey String

    The key used by the BGP group.

    bgpGroupName String

    The name of the BGP group.

    description String

    Description of the BGP group.

    hold String

    The hold time to wait for the incoming BGP message. If no message has been passed in after the hold time, the BGP neighbor is considered disconnected.

    id String

    The ID of the Bgp Group.

    ipVersion String

    IP version.

    isFakeAsn Boolean

    Whether the AS number is false.

    keepalive String

    The keepalive time.

    localAsn Number

    The local AS number.

    peerAsn Number

    The autonomous system (AS) number of the BGP peer.

    routeLimit String

    Routing limits.

    routerId String

    The ID of the VBR.

    status String

    The status of the resource.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the alicloud Terraform Provider.

    alicloud logo
    Alibaba Cloud v3.45.1 published on Thursday, Dec 7, 2023 by Pulumi