Class GetVpcPeeringConnection
Inheritance
System.Object
GetVpcPeeringConnection
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public static class GetVpcPeeringConnection
Methods
View SourceInvokeAsync(GetVpcPeeringConnectionArgs, InvokeOptions)
The VPC Peering Connection data source provides details about a specific VPC peering connection.
{{% examples %}}
Example Usage
{{% example %}}
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var pc = Output.Create(Aws.Ec2.GetVpcPeeringConnection.InvokeAsync(new Aws.Ec2.GetVpcPeeringConnectionArgs
{
PeerCidrBlock = "10.0.1.0/22",
VpcId = aws_vpc.Foo.Id,
}));
// Create a route table
var rt = new Aws.Ec2.RouteTable("rt", new Aws.Ec2.RouteTableArgs
{
VpcId = aws_vpc.Foo.Id,
});
// Create a route
var route = new Aws.Ec2.Route("route", new Aws.Ec2.RouteArgs
{
DestinationCidrBlock = pc.Apply(pc => pc.PeerCidrBlock),
RouteTableId = rt.Id,
VpcPeeringConnectionId = pc.Apply(pc => pc.Id),
});
}
}
{{% /example %}} {{% /examples %}}
Declaration
public static Task<GetVpcPeeringConnectionResult> InvokeAsync(GetVpcPeeringConnectionArgs args = null, InvokeOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetVpcPeeringConnectionArgs | args | |
| InvokeOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<GetVpcPeeringConnectionResult> |