Try AWS Native preview for resources not in the classic version.
aws.ec2.getVpcPeeringConnections
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
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
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var pcs = Aws.Ec2.GetVpcPeeringConnections.Invoke(new()
{
Filters = new[]
{
new Aws.Ec2.Inputs.GetVpcPeeringConnectionsFilterInputArgs
{
Name = "requester-vpc-info.vpc-id",
Values = new[]
{
aws_vpc.Foo.Id,
},
},
},
});
var pc = ;
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
pcs, err := ec2.GetVpcPeeringConnections(ctx, &ec2.GetVpcPeeringConnectionsArgs{
Filters: []ec2.GetVpcPeeringConnectionsFilter{
{
Name: "requester-vpc-info.vpc-id",
Values: interface{}{
aws_vpc.Foo.Id,
},
},
},
}, nil);
if err != nil {
return err
}
_ := "TODO: For expression";
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws as aws
pcs = aws.ec2.get_vpc_peering_connections(filters=[aws.ec2.GetVpcPeeringConnectionsFilterArgs(
name="requester-vpc-info.vpc-id",
values=[aws_vpc["foo"]["id"]],
)])
pc = [aws.ec2.get_vpc_peering_connection(id=pcs.ids[__index]) for __index in range(len(pcs.ids))]
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const pcs = aws.ec2.getVpcPeeringConnections({
filters: [{
name: "requester-vpc-info.vpc-id",
values: [aws_vpc.foo.id],
}],
});
const pc = .map(__index => (aws.ec2.getVpcPeeringConnection({
id: _arg0_.ids[__index],
})));
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<Get
Vpc Peering Connections Filter> Custom filter block as described below.
- 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
[]Get
Vpc Peering Connections Filter Custom filter block as described below.
- 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<Get
Vpc Peering Connections Filter> Custom filter block as described below.
- 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
Get
Vpc Peering Connections Filter[] Custom filter block as described below.
- {[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[Get
Vpc Peering Connections Filter] Custom filter block as described below.
- 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.
- 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.
- Dictionary<string, string>
- Filters
List<Get
Vpc Peering Connections Filter>
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
IDs of the VPC Peering Connections.
- map[string]string
- Filters
[]Get
Vpc Peering Connections Filter
- id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
IDs of the VPC Peering Connections.
- Map<String,String>
- filters
List<Get
Vpc Peering Connections Filter>
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
IDs of the VPC Peering Connections.
- {[key: string]: string}
- filters
Get
Vpc Peering Connections Filter[]
- id str
The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
IDs of the VPC Peering Connections.
- Mapping[str, str]
- filters
Sequence[Get
Vpc Peering Connections Filter]
- id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
IDs of the VPC Peering Connections.
- 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.
Try AWS Native preview for resources not in the classic version.