getVpcPeeringConnection

The VPC Peering Connection data source provides details about a specific VPC peering connection.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetVpcPeeringConnectionArgs;
import com.pulumi.aws.ec2.RouteTable;
import com.pulumi.aws.ec2.RouteTableArgs;
import com.pulumi.aws.ec2.Route;
import com.pulumi.aws.ec2.RouteArgs;
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 pc = Ec2Functions.getVpcPeeringConnection(GetVpcPeeringConnectionArgs.builder()
.vpcId(aws_vpc.foo().id())
.peerCidrBlock("10.0.1.0/22")
.build());
var rt = new RouteTable("rt", RouteTableArgs.builder()
.vpcId(aws_vpc.foo().id())
.build());
var route = new Route("route", RouteArgs.builder()
.routeTableId(rt.id())
.destinationCidrBlock(pc.applyValue(getVpcPeeringConnectionResult -> getVpcPeeringConnectionResult.peerCidrBlock()))
.vpcPeeringConnectionId(pc.applyValue(getVpcPeeringConnectionResult -> getVpcPeeringConnectionResult.id()))
.build());
}
}

Return

A collection of values returned by getVpcPeeringConnection.

Parameters

argument

A collection of arguments for invoking getVpcPeeringConnection.


suspend fun getVpcPeeringConnection(cidrBlock: String? = null, filters: List<GetVpcPeeringConnectionFilter>? = null, id: String? = null, ownerId: String? = null, peerCidrBlock: String? = null, peerOwnerId: String? = null, peerRegion: String? = null, peerVpcId: String? = null, region: String? = null, status: String? = null, tags: Map<String, String>? = null, vpcId: String? = null): GetVpcPeeringConnectionResult

Return

A collection of values returned by getVpcPeeringConnection.

Parameters

cidrBlock

Primary CIDR block of the requester VPC of the specific VPC Peering Connection to retrieve.

filters

Custom filter block as described below.

id

ID of the specific VPC Peering Connection to retrieve.

ownerId

AWS account ID of the owner of the requester VPC of the specific VPC Peering Connection to retrieve.

peerCidrBlock

Primary CIDR block of the accepter VPC of the specific VPC Peering Connection to retrieve.

peerOwnerId

AWS account ID of the owner of the accepter VPC of the specific VPC Peering Connection to retrieve.

peerRegion

Region of the accepter VPC of the specific VPC Peering Connection to retrieve.

peerVpcId

ID of the accepter VPC of the specific VPC Peering Connection to retrieve.

region

Region of the requester VPC of the specific VPC Peering Connection to retrieve.

status

Status of the specific VPC Peering Connection to retrieve.

tags

Map 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:

vpcId

ID of the requester VPC of the specific VPC Peering Connection to retrieve.

See also


Return

A collection of values returned by getVpcPeeringConnection.

Parameters

argument

Builder for com.pulumi.aws.ec2.kotlin.inputs.GetVpcPeeringConnectionPlainArgs.

See also