1. Packages
  2. AWS Classic
  3. API Docs
  4. ec2
  5. getVpcPeeringConnections

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.ec2.getVpcPeeringConnections

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Use this data source to get IDs of Amazon VPC peering connections To get more details on each connection, use the data resource aws.ec2.VpcPeeringConnection

    Note: To use this data source in a count, the resources should exist before trying to access the data source.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    // Declare the data source
    const pcs = aws.ec2.getVpcPeeringConnections({
        filters: [{
            name: "requester-vpc-info.vpc-id",
            values: [foo.id],
        }],
    });
    // get the details of each resource
    const pc = .map(__index => (aws.ec2.getVpcPeeringConnection({
        id: _arg0_.ids[__index],
    })));
    
    import pulumi
    import pulumi_aws as aws
    
    # Declare the data source
    pcs = aws.ec2.get_vpc_peering_connections(filters=[{
        "name": "requester-vpc-info.vpc-id",
        "values": [foo["id"]],
    }])
    # get the details of each resource
    pc = [aws.ec2.get_vpc_peering_connection(id=pcs.ids[__index]) for __index in range(len(pcs.ids))]
    
    Coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        // Declare the data source
        var pcs = Aws.Ec2.GetVpcPeeringConnections.Invoke(new()
        {
            Filters = new[]
            {
                new Aws.Ec2.Inputs.GetVpcPeeringConnectionsFilterInputArgs
                {
                    Name = "requester-vpc-info.vpc-id",
                    Values = new[]
                    {
                        foo.Id,
                    },
                },
            },
        });
    
        // get the details of each resource
        var pc = ;
    
    });
    
    Coming soon!
    
    Coming soon!
    

    Using getVpcPeeringConnections

    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 getVpcPeeringConnections(args: GetVpcPeeringConnectionsArgs, opts?: InvokeOptions): Promise<GetVpcPeeringConnectionsResult>
    function getVpcPeeringConnectionsOutput(args: GetVpcPeeringConnectionsOutputArgs, opts?: InvokeOptions): Output<GetVpcPeeringConnectionsResult>
    def get_vpc_peering_connections(filters: Optional[Sequence[GetVpcPeeringConnectionsFilter]] = None,
                                    tags: Optional[Mapping[str, str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetVpcPeeringConnectionsResult
    def get_vpc_peering_connections_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcPeeringConnectionsFilterArgs]]]] = None,
                                    tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetVpcPeeringConnectionsResult]
    func GetVpcPeeringConnections(ctx *Context, args *GetVpcPeeringConnectionsArgs, opts ...InvokeOption) (*GetVpcPeeringConnectionsResult, error)
    func GetVpcPeeringConnectionsOutput(ctx *Context, args *GetVpcPeeringConnectionsOutputArgs, opts ...InvokeOption) GetVpcPeeringConnectionsResultOutput

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

    public static class GetVpcPeeringConnections 
    {
        public static Task<GetVpcPeeringConnectionsResult> InvokeAsync(GetVpcPeeringConnectionsArgs args, InvokeOptions? opts = null)
        public static Output<GetVpcPeeringConnectionsResult> Invoke(GetVpcPeeringConnectionsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVpcPeeringConnectionsResult> getVpcPeeringConnections(GetVpcPeeringConnectionsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ec2/getVpcPeeringConnections:getVpcPeeringConnections
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetVpcPeeringConnectionsFilter>
    Custom filter block as described below.
    Tags Dictionary<string, string>

    Mapping of tags, each pair of which must exactly match a pair on the desired VPC Peering Connection.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    Filters []GetVpcPeeringConnectionsFilter
    Custom filter block as described below.
    Tags map[string]string

    Mapping of tags, each pair of which must exactly match a pair on the desired VPC Peering Connection.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    filters List<GetVpcPeeringConnectionsFilter>
    Custom filter block as described below.
    tags Map<String,String>

    Mapping of tags, each pair of which must exactly match a pair on the desired VPC Peering Connection.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    filters GetVpcPeeringConnectionsFilter[]
    Custom filter block as described below.
    tags {[key: string]: string}

    Mapping of tags, each pair of which must exactly match a pair on the desired VPC Peering Connection.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    filters Sequence[GetVpcPeeringConnectionsFilter]
    Custom filter block as described below.
    tags Mapping[str, str]

    Mapping of tags, each pair of which must exactly match a pair on the desired VPC Peering Connection.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    filters List<Property Map>
    Custom filter block as described below.
    tags Map<String>

    Mapping of tags, each pair of which must exactly match a pair on the desired VPC Peering Connection.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    getVpcPeeringConnections Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    IDs of the VPC Peering Connections.
    Tags Dictionary<string, string>
    Filters List<GetVpcPeeringConnectionsFilter>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    IDs of the VPC Peering Connections.
    Tags map[string]string
    Filters []GetVpcPeeringConnectionsFilter
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    IDs of the VPC Peering Connections.
    tags Map<String,String>
    filters List<GetVpcPeeringConnectionsFilter>
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    IDs of the VPC Peering Connections.
    tags {[key: string]: string}
    filters GetVpcPeeringConnectionsFilter[]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    IDs of the VPC Peering Connections.
    tags Mapping[str, str]
    filters Sequence[GetVpcPeeringConnectionsFilter]
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    IDs of the VPC Peering Connections.
    tags Map<String>
    filters List<Property Map>

    Supporting Types

    GetVpcPeeringConnectionsFilter

    Name string
    Name of the field to filter by, as defined by the underlying AWS API.
    Values List<string>
    Set of values that are accepted for the given field. A VPC Peering Connection will be selected if any one of the given values matches.
    Name string
    Name of the field to filter by, as defined by the underlying AWS API.
    Values []string
    Set of values that are accepted for the given field. A VPC Peering Connection will be selected if any one of the given values matches.
    name String
    Name of the field to filter by, as defined by the underlying AWS API.
    values List<String>
    Set of values that are accepted for the given field. A VPC Peering Connection will be selected if any one of the given values matches.
    name string
    Name of the field to filter by, as defined by the underlying AWS API.
    values string[]
    Set of values that are accepted for the given field. A VPC Peering Connection will be selected if any one of the given values matches.
    name str
    Name of the field to filter by, as defined by the underlying AWS API.
    values Sequence[str]
    Set of values that are accepted for the given field. A VPC Peering Connection will be selected if any one of the given values matches.
    name String
    Name of the field to filter by, as defined by the underlying AWS API.
    values List<String>
    Set of values that are accepted for the given field. A VPC Peering Connection will be selected if any one of the given values matches.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi