Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi
alicloud.vpc.getPeerConnections
Explore with Pulumi AI
This data source provides the Vpc Peer Connections of the current Alibaba Cloud user.
NOTE: Available in v1.186.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.vpc.getPeerConnections({});
export const vpcPeerConnectionId1 = ids.then(ids => ids.connections?.[0]?.id);
const nameRegex = alicloud.vpc.getPeerConnections({
nameRegex: "^my-PeerConnection",
});
export const vpcPeerConnectionId2 = nameRegex.then(nameRegex => nameRegex.connections?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.vpc.get_peer_connections()
pulumi.export("vpcPeerConnectionId1", ids.connections[0].id)
name_regex = alicloud.vpc.get_peer_connections(name_regex="^my-PeerConnection")
pulumi.export("vpcPeerConnectionId2", name_regex.connections[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := vpc.GetPeerConnections(ctx, nil, nil)
if err != nil {
return err
}
ctx.Export("vpcPeerConnectionId1", ids.Connections[0].Id)
nameRegex, err := vpc.GetPeerConnections(ctx, &vpc.GetPeerConnectionsArgs{
NameRegex: pulumi.StringRef("^my-PeerConnection"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcPeerConnectionId2", nameRegex.Connections[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Vpc.GetPeerConnections.Invoke();
var nameRegex = AliCloud.Vpc.GetPeerConnections.Invoke(new()
{
NameRegex = "^my-PeerConnection",
});
return new Dictionary<string, object?>
{
["vpcPeerConnectionId1"] = ids.Apply(getPeerConnectionsResult => getPeerConnectionsResult.Connections[0]?.Id),
["vpcPeerConnectionId2"] = nameRegex.Apply(getPeerConnectionsResult => getPeerConnectionsResult.Connections[0]?.Id),
};
});
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()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:vpc:getPeerConnections
Arguments: {}
nameRegex:
fn::invoke:
Function: alicloud:vpc:getPeerConnections
Arguments:
nameRegex: ^my-PeerConnection
outputs:
vpcPeerConnectionId1: ${ids.connections[0].id}
vpcPeerConnectionId2: ${nameRegex.connections[0].id}
Using getPeerConnections
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 getPeerConnections(args: GetPeerConnectionsArgs, opts?: InvokeOptions): Promise<GetPeerConnectionsResult>
function getPeerConnectionsOutput(args: GetPeerConnectionsOutputArgs, opts?: InvokeOptions): Output<GetPeerConnectionsResult>
def get_peer_connections(ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
peer_connection_name: Optional[str] = None,
status: Optional[str] = None,
vpc_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPeerConnectionsResult
def get_peer_connections_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
peer_connection_name: Optional[pulumi.Input[str]] = None,
status: Optional[pulumi.Input[str]] = None,
vpc_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetPeerConnectionsResult]
func GetPeerConnections(ctx *Context, args *GetPeerConnectionsArgs, opts ...InvokeOption) (*GetPeerConnectionsResult, error)
func GetPeerConnectionsOutput(ctx *Context, args *GetPeerConnectionsOutputArgs, opts ...InvokeOption) GetPeerConnectionsResultOutput
> Note: This function is named GetPeerConnections
in the Go SDK.
public static class GetPeerConnections
{
public static Task<GetPeerConnectionsResult> InvokeAsync(GetPeerConnectionsArgs args, InvokeOptions? opts = null)
public static Output<GetPeerConnectionsResult> Invoke(GetPeerConnectionsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPeerConnectionsResult> getPeerConnections(GetPeerConnectionsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:vpc/getPeerConnections:getPeerConnections
arguments:
# arguments dictionary
The following arguments are supported:
- Ids List<string>
- A list of PeerConnection IDs.
- Name
Regex string - A regex string to filter results by PeerConnection name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Peer
Connection stringName - The name of the resource.
- Status string
- The status of the resource. Valid values:
Accepting
,Activated
,Creating
,Deleted
,Deleting
,Expired
,Rejected
,Updating
. - Vpc
Id string - The ID of the requester VPC.
- Ids []string
- A list of PeerConnection IDs.
- Name
Regex string - A regex string to filter results by PeerConnection name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Peer
Connection stringName - The name of the resource.
- Status string
- The status of the resource. Valid values:
Accepting
,Activated
,Creating
,Deleted
,Deleting
,Expired
,Rejected
,Updating
. - Vpc
Id string - The ID of the requester VPC.
- ids List<String>
- A list of PeerConnection IDs.
- name
Regex String - A regex string to filter results by PeerConnection name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - peer
Connection StringName - The name of the resource.
- status String
- The status of the resource. Valid values:
Accepting
,Activated
,Creating
,Deleted
,Deleting
,Expired
,Rejected
,Updating
. - vpc
Id String - The ID of the requester VPC.
- ids string[]
- A list of PeerConnection IDs.
- name
Regex string - A regex string to filter results by PeerConnection name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - peer
Connection stringName - The name of the resource.
- status string
- The status of the resource. Valid values:
Accepting
,Activated
,Creating
,Deleted
,Deleting
,Expired
,Rejected
,Updating
. - vpc
Id string - The ID of the requester VPC.
- ids Sequence[str]
- A list of PeerConnection IDs.
- name_
regex str - A regex string to filter results by PeerConnection name.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - peer_
connection_ strname - The name of the resource.
- status str
- The status of the resource. Valid values:
Accepting
,Activated
,Creating
,Deleted
,Deleting
,Expired
,Rejected
,Updating
. - vpc_
id str - The ID of the requester VPC.
- ids List<String>
- A list of PeerConnection IDs.
- name
Regex String - A regex string to filter results by PeerConnection name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - peer
Connection StringName - The name of the resource.
- status String
- The status of the resource. Valid values:
Accepting
,Activated
,Creating
,Deleted
,Deleting
,Expired
,Rejected
,Updating
. - vpc
Id String - The ID of the requester VPC.
getPeerConnections Result
The following output properties are available:
- Connections
List<Pulumi.
Ali Cloud. Vpc. Outputs. Get Peer Connections Connection> - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Name
Regex string - Output
File string - Peer
Connection stringName - Status string
- Vpc
Id string
- Connections
[]Get
Peer Connections Connection - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Name
Regex string - Output
File string - Peer
Connection stringName - Status string
- Vpc
Id string
- connections
List<Get
Peer Connections Connection> - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- name
Regex String - output
File String - peer
Connection StringName - status String
- vpc
Id String
- connections
Get
Peer Connections Connection[] - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- name
Regex string - output
File string - peer
Connection stringName - status string
- vpc
Id string
- connections
Sequence[Get
Peer Connections Connection] - id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- name_
regex str - output_
file str - peer_
connection_ strname - status str
- vpc_
id str
- connections List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- name
Regex String - output
File String - peer
Connection StringName - status String
- vpc
Id String
Supporting Types
GetPeerConnectionsConnection
- Accepting
Ali intUid - The ID of the Alibaba Cloud account (primary account) of the receiving end of the VPC peering connection to be created.
- Accepting
Region stringId - The region ID of the recipient of the VPC peering connection to be created.
- Accepting
Vpc stringId - The VPC ID of the receiving end of the VPC peer connection.
- Bandwidth int
- The bandwidth of the VPC peering connection to be modified. Unit: Mbps.
- Create
Time string - The creation time of the resource.
- Description string
- The description of the VPC peer connection to be created.
- Id string
- The ID of the PeerConnection.
- Peer
Connection stringId - The first ID of the resource.
- Peer
Connection stringName - The name of the resource.
- Status string
- The status of the resource.
- Vpc
Id string - The ID of the requester VPC.
- Accepting
Ali intUid - The ID of the Alibaba Cloud account (primary account) of the receiving end of the VPC peering connection to be created.
- Accepting
Region stringId - The region ID of the recipient of the VPC peering connection to be created.
- Accepting
Vpc stringId - The VPC ID of the receiving end of the VPC peer connection.
- Bandwidth int
- The bandwidth of the VPC peering connection to be modified. Unit: Mbps.
- Create
Time string - The creation time of the resource.
- Description string
- The description of the VPC peer connection to be created.
- Id string
- The ID of the PeerConnection.
- Peer
Connection stringId - The first ID of the resource.
- Peer
Connection stringName - The name of the resource.
- Status string
- The status of the resource.
- Vpc
Id string - The ID of the requester VPC.
- accepting
Ali IntegerUid - The ID of the Alibaba Cloud account (primary account) of the receiving end of the VPC peering connection to be created.
- accepting
Region StringId - The region ID of the recipient of the VPC peering connection to be created.
- accepting
Vpc StringId - The VPC ID of the receiving end of the VPC peer connection.
- bandwidth Integer
- The bandwidth of the VPC peering connection to be modified. Unit: Mbps.
- create
Time String - The creation time of the resource.
- description String
- The description of the VPC peer connection to be created.
- id String
- The ID of the PeerConnection.
- peer
Connection StringId - The first ID of the resource.
- peer
Connection StringName - The name of the resource.
- status String
- The status of the resource.
- vpc
Id String - The ID of the requester VPC.
- accepting
Ali numberUid - The ID of the Alibaba Cloud account (primary account) of the receiving end of the VPC peering connection to be created.
- accepting
Region stringId - The region ID of the recipient of the VPC peering connection to be created.
- accepting
Vpc stringId - The VPC ID of the receiving end of the VPC peer connection.
- bandwidth number
- The bandwidth of the VPC peering connection to be modified. Unit: Mbps.
- create
Time string - The creation time of the resource.
- description string
- The description of the VPC peer connection to be created.
- id string
- The ID of the PeerConnection.
- peer
Connection stringId - The first ID of the resource.
- peer
Connection stringName - The name of the resource.
- status string
- The status of the resource.
- vpc
Id string - The ID of the requester VPC.
- accepting_
ali_ intuid - The ID of the Alibaba Cloud account (primary account) of the receiving end of the VPC peering connection to be created.
- accepting_
region_ strid - The region ID of the recipient of the VPC peering connection to be created.
- accepting_
vpc_ strid - The VPC ID of the receiving end of the VPC peer connection.
- bandwidth int
- The bandwidth of the VPC peering connection to be modified. Unit: Mbps.
- create_
time str - The creation time of the resource.
- description str
- The description of the VPC peer connection to be created.
- id str
- The ID of the PeerConnection.
- peer_
connection_ strid - The first ID of the resource.
- peer_
connection_ strname - The name of the resource.
- status str
- The status of the resource.
- vpc_
id str - The ID of the requester VPC.
- accepting
Ali NumberUid - The ID of the Alibaba Cloud account (primary account) of the receiving end of the VPC peering connection to be created.
- accepting
Region StringId - The region ID of the recipient of the VPC peering connection to be created.
- accepting
Vpc StringId - The VPC ID of the receiving end of the VPC peer connection.
- bandwidth Number
- The bandwidth of the VPC peering connection to be modified. Unit: Mbps.
- create
Time String - The creation time of the resource.
- description String
- The description of the VPC peer connection to be created.
- id String
- The ID of the PeerConnection.
- peer
Connection StringId - The first ID of the resource.
- peer
Connection StringName - The name of the resource.
- status String
- The status of the resource.
- vpc
Id String - The ID of the requester VPC.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.