get Peer Connections
This data source provides the Vpc Peer Connections of the current Alibaba Cloud user.
NOTE: Available in v1.186.0+.
Example Usage
Basic Usage
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.GetPeerConnectionsArgs;
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.getPeerConnections();
ctx.export("vpcPeerConnectionId1", ids.applyValue(getPeerConnectionsResult -> getPeerConnectionsResult.connections()[0].id()));
final var nameRegex = VpcFunctions.getPeerConnections(GetPeerConnectionsArgs.builder()
.nameRegex("^my-PeerConnection")
.build());
ctx.export("vpcPeerConnectionId2", nameRegex.applyValue(getPeerConnectionsResult -> getPeerConnectionsResult.connections()[0].id()));
}
}
Content copied to clipboard
Return
A collection of values returned by getPeerConnections.
Parameters
argument
A collection of arguments for invoking getPeerConnections.
suspend fun getPeerConnections(ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null, peerConnectionName: String? = null, status: String? = null, vpcId: String? = null): GetPeerConnectionsResult
Return
A collection of values returned by getPeerConnections.
See also
Parameters
ids
A list of PeerConnection IDs.
name Regex
A regex string to filter results by PeerConnection name.
output File
File name where to save data source results (after running pulumi preview
).
peer Connection Name
The name of the resource.
status
The status of the resource.
vpc Id
The ID of the requester VPC.
suspend fun getPeerConnections(argument: suspend GetPeerConnectionsPlainArgsBuilder.() -> Unit): GetPeerConnectionsResult
Return
A collection of values returned by getPeerConnections.
See also
Parameters
argument
Builder for com.pulumi.alicloud.vpc.kotlin.inputs.GetPeerConnectionsPlainArgs.