Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.vpc.getIpv4Gateways
Explore with Pulumi AI
This data source provides the Vpc Ipv4 Gateways of the current Alibaba Cloud user.
NOTE: Available in v1.181.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.vpc.getIpv4Gateways({});
export const vpcIpv4GatewayId1 = ids.then(ids => ids.gateways?.[0]?.id);
const nameRegex = alicloud.vpc.getIpv4Gateways({
nameRegex: "^my-Ipv4Gateway",
});
export const vpcIpv4GatewayId2 = nameRegex.then(nameRegex => nameRegex.gateways?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.vpc.get_ipv4_gateways()
pulumi.export("vpcIpv4GatewayId1", ids.gateways[0].id)
name_regex = alicloud.vpc.get_ipv4_gateways(name_regex="^my-Ipv4Gateway")
pulumi.export("vpcIpv4GatewayId2", name_regex.gateways[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.GetIpv4Gateways(ctx, nil, nil)
if err != nil {
return err
}
ctx.Export("vpcIpv4GatewayId1", ids.Gateways[0].Id)
nameRegex, err := vpc.GetIpv4Gateways(ctx, &vpc.GetIpv4GatewaysArgs{
NameRegex: pulumi.StringRef("^my-Ipv4Gateway"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcIpv4GatewayId2", nameRegex.Gateways[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.GetIpv4Gateways.Invoke();
var nameRegex = AliCloud.Vpc.GetIpv4Gateways.Invoke(new()
{
NameRegex = "^my-Ipv4Gateway",
});
return new Dictionary<string, object?>
{
["vpcIpv4GatewayId1"] = ids.Apply(getIpv4GatewaysResult => getIpv4GatewaysResult.Gateways[0]?.Id),
["vpcIpv4GatewayId2"] = nameRegex.Apply(getIpv4GatewaysResult => getIpv4GatewaysResult.Gateways[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.GetIpv4GatewaysArgs;
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.getIpv4Gateways();
ctx.export("vpcIpv4GatewayId1", ids.applyValue(getIpv4GatewaysResult -> getIpv4GatewaysResult.gateways()[0].id()));
final var nameRegex = VpcFunctions.getIpv4Gateways(GetIpv4GatewaysArgs.builder()
.nameRegex("^my-Ipv4Gateway")
.build());
ctx.export("vpcIpv4GatewayId2", nameRegex.applyValue(getIpv4GatewaysResult -> getIpv4GatewaysResult.gateways()[0].id()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:vpc:getIpv4Gateways
Arguments: {}
nameRegex:
fn::invoke:
Function: alicloud:vpc:getIpv4Gateways
Arguments:
nameRegex: ^my-Ipv4Gateway
outputs:
vpcIpv4GatewayId1: ${ids.gateways[0].id}
vpcIpv4GatewayId2: ${nameRegex.gateways[0].id}
Using getIpv4Gateways
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 getIpv4Gateways(args: GetIpv4GatewaysArgs, opts?: InvokeOptions): Promise<GetIpv4GatewaysResult>
function getIpv4GatewaysOutput(args: GetIpv4GatewaysOutputArgs, opts?: InvokeOptions): Output<GetIpv4GatewaysResult>
def get_ipv4_gateways(ids: Optional[Sequence[str]] = None,
ipv4_gateway_name: Optional[str] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
status: Optional[str] = None,
vpc_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetIpv4GatewaysResult
def get_ipv4_gateways_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
ipv4_gateway_name: Optional[pulumi.Input[str]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
status: Optional[pulumi.Input[str]] = None,
vpc_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetIpv4GatewaysResult]
func GetIpv4Gateways(ctx *Context, args *GetIpv4GatewaysArgs, opts ...InvokeOption) (*GetIpv4GatewaysResult, error)
func GetIpv4GatewaysOutput(ctx *Context, args *GetIpv4GatewaysOutputArgs, opts ...InvokeOption) GetIpv4GatewaysResultOutput
> Note: This function is named GetIpv4Gateways
in the Go SDK.
public static class GetIpv4Gateways
{
public static Task<GetIpv4GatewaysResult> InvokeAsync(GetIpv4GatewaysArgs args, InvokeOptions? opts = null)
public static Output<GetIpv4GatewaysResult> Invoke(GetIpv4GatewaysInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetIpv4GatewaysResult> getIpv4Gateways(GetIpv4GatewaysArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:vpc/getIpv4Gateways:getIpv4Gateways
arguments:
# arguments dictionary
The following arguments are supported:
- Ids List<string>
- A list of Ipv4 Gateway IDs.
- Ipv4Gateway
Name string - The name of the IPv4 gateway.
- Name
Regex string - A regex string to filter results by Ipv4 Gateway name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Status string
- The status of the resource. Valid values:
Creating
,Created
,Deleting
,Pending
,Deleted
. - Vpc
Id string - The ID of the VPC associated with the IPv4 Gateway.
- Ids []string
- A list of Ipv4 Gateway IDs.
- Ipv4Gateway
Name string - The name of the IPv4 gateway.
- Name
Regex string - A regex string to filter results by Ipv4 Gateway name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Status string
- The status of the resource. Valid values:
Creating
,Created
,Deleting
,Pending
,Deleted
. - Vpc
Id string - The ID of the VPC associated with the IPv4 Gateway.
- ids List<String>
- A list of Ipv4 Gateway IDs.
- ipv4Gateway
Name String - The name of the IPv4 gateway.
- name
Regex String - A regex string to filter results by Ipv4 Gateway name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - status String
- The status of the resource. Valid values:
Creating
,Created
,Deleting
,Pending
,Deleted
. - vpc
Id String - The ID of the VPC associated with the IPv4 Gateway.
- ids string[]
- A list of Ipv4 Gateway IDs.
- ipv4Gateway
Name string - The name of the IPv4 gateway.
- name
Regex string - A regex string to filter results by Ipv4 Gateway name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - status string
- The status of the resource. Valid values:
Creating
,Created
,Deleting
,Pending
,Deleted
. - vpc
Id string - The ID of the VPC associated with the IPv4 Gateway.
- ids Sequence[str]
- A list of Ipv4 Gateway IDs.
- ipv4_
gateway_ strname - The name of the IPv4 gateway.
- name_
regex str - A regex string to filter results by Ipv4 Gateway name.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - status str
- The status of the resource. Valid values:
Creating
,Created
,Deleting
,Pending
,Deleted
. - vpc_
id str - The ID of the VPC associated with the IPv4 Gateway.
- ids List<String>
- A list of Ipv4 Gateway IDs.
- ipv4Gateway
Name String - The name of the IPv4 gateway.
- name
Regex String - A regex string to filter results by Ipv4 Gateway name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - status String
- The status of the resource. Valid values:
Creating
,Created
,Deleting
,Pending
,Deleted
. - vpc
Id String - The ID of the VPC associated with the IPv4 Gateway.
getIpv4Gateways Result
The following output properties are available:
- Gateways
List<Pulumi.
Ali Cloud. Vpc. Outputs. Get Ipv4Gateways Gateway> - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Ipv4Gateway
Name string - Name
Regex string - Output
File string - Status string
- Vpc
Id string
- Gateways
[]Get
Ipv4Gateways Gateway - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Ipv4Gateway
Name string - Name
Regex string - Output
File string - Status string
- Vpc
Id string
- gateways
List<Get
Ipv4Gateways Gateway> - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- ipv4Gateway
Name String - name
Regex String - output
File String - status String
- vpc
Id String
- gateways
Get
Ipv4Gateways Gateway[] - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- ipv4Gateway
Name string - name
Regex string - output
File string - status string
- vpc
Id string
- gateways
Sequence[Get
Ipv4Gateways Gateway] - id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- ipv4_
gateway_ strname - name_
regex str - output_
file str - status str
- vpc_
id str
- gateways List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- ipv4Gateway
Name String - name
Regex String - output
File String - status String
- vpc
Id String
Supporting Types
GetIpv4GatewaysGateway
- Create
Time string - The creation time of the resource.
- Enabled bool
- Indicates whether the IPv4 gateway is activated.
- Id string
- The ID of the Ipv4 Gateway.
- Ipv4Gateway
Description string - The description of the IPv4 gateway.
- Ipv4Gateway
Id string - The resource attribute field that represents the resource level 1 ID.
- Ipv4Gateway
Name string - The name of the IPv4 gateway.
- Ipv4Gateway
Route stringTable Id - ID of the route table associated with IPv4 Gateway.
- Status string
- The status of the resource.
- Vpc
Id string - The ID of the VPC associated with the IPv4 Gateway.
- Create
Time string - The creation time of the resource.
- Enabled bool
- Indicates whether the IPv4 gateway is activated.
- Id string
- The ID of the Ipv4 Gateway.
- Ipv4Gateway
Description string - The description of the IPv4 gateway.
- Ipv4Gateway
Id string - The resource attribute field that represents the resource level 1 ID.
- Ipv4Gateway
Name string - The name of the IPv4 gateway.
- Ipv4Gateway
Route stringTable Id - ID of the route table associated with IPv4 Gateway.
- Status string
- The status of the resource.
- Vpc
Id string - The ID of the VPC associated with the IPv4 Gateway.
- create
Time String - The creation time of the resource.
- enabled Boolean
- Indicates whether the IPv4 gateway is activated.
- id String
- The ID of the Ipv4 Gateway.
- ipv4Gateway
Description String - The description of the IPv4 gateway.
- ipv4Gateway
Id String - The resource attribute field that represents the resource level 1 ID.
- ipv4Gateway
Name String - The name of the IPv4 gateway.
- ipv4Gateway
Route StringTable Id - ID of the route table associated with IPv4 Gateway.
- status String
- The status of the resource.
- vpc
Id String - The ID of the VPC associated with the IPv4 Gateway.
- create
Time string - The creation time of the resource.
- enabled boolean
- Indicates whether the IPv4 gateway is activated.
- id string
- The ID of the Ipv4 Gateway.
- ipv4Gateway
Description string - The description of the IPv4 gateway.
- ipv4Gateway
Id string - The resource attribute field that represents the resource level 1 ID.
- ipv4Gateway
Name string - The name of the IPv4 gateway.
- ipv4Gateway
Route stringTable Id - ID of the route table associated with IPv4 Gateway.
- status string
- The status of the resource.
- vpc
Id string - The ID of the VPC associated with the IPv4 Gateway.
- create_
time str - The creation time of the resource.
- enabled bool
- Indicates whether the IPv4 gateway is activated.
- id str
- The ID of the Ipv4 Gateway.
- ipv4_
gateway_ strdescription - The description of the IPv4 gateway.
- ipv4_
gateway_ strid - The resource attribute field that represents the resource level 1 ID.
- ipv4_
gateway_ strname - The name of the IPv4 gateway.
- ipv4_
gateway_ strroute_ table_ id - ID of the route table associated with IPv4 Gateway.
- status str
- The status of the resource.
- vpc_
id str - The ID of the VPC associated with the IPv4 Gateway.
- create
Time String - The creation time of the resource.
- enabled Boolean
- Indicates whether the IPv4 gateway is activated.
- id String
- The ID of the Ipv4 Gateway.
- ipv4Gateway
Description String - The description of the IPv4 gateway.
- ipv4Gateway
Id String - The resource attribute field that represents the resource level 1 ID.
- ipv4Gateway
Name String - The name of the IPv4 gateway.
- ipv4Gateway
Route StringTable Id - ID of the route table associated with IPv4 Gateway.
- status String
- The status of the resource.
- vpc
Id String - The ID of the VPC associated with the IPv4 Gateway.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.