1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. vpc
  5. getIpv4Gateways
Alibaba Cloud v3.59.0 published on Friday, Jul 12, 2024 by Pulumi

alicloud.vpc.getIpv4Gateways

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.59.0 published on Friday, Jul 12, 2024 by Pulumi

    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.
    Ipv4GatewayName string
    The name of the IPv4 gateway.
    NameRegex string
    A regex string to filter results by Ipv4 Gateway name.
    OutputFile 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.
    VpcId string
    The ID of the VPC associated with the IPv4 Gateway.
    Ids []string
    A list of Ipv4 Gateway IDs.
    Ipv4GatewayName string
    The name of the IPv4 gateway.
    NameRegex string
    A regex string to filter results by Ipv4 Gateway name.
    OutputFile 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.
    VpcId string
    The ID of the VPC associated with the IPv4 Gateway.
    ids List<String>
    A list of Ipv4 Gateway IDs.
    ipv4GatewayName String
    The name of the IPv4 gateway.
    nameRegex String
    A regex string to filter results by Ipv4 Gateway name.
    outputFile 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.
    vpcId String
    The ID of the VPC associated with the IPv4 Gateway.
    ids string[]
    A list of Ipv4 Gateway IDs.
    ipv4GatewayName string
    The name of the IPv4 gateway.
    nameRegex string
    A regex string to filter results by Ipv4 Gateway name.
    outputFile 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.
    vpcId string
    The ID of the VPC associated with the IPv4 Gateway.
    ids Sequence[str]
    A list of Ipv4 Gateway IDs.
    ipv4_gateway_name str
    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.
    ipv4GatewayName String
    The name of the IPv4 gateway.
    nameRegex String
    A regex string to filter results by Ipv4 Gateway name.
    outputFile 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.
    vpcId String
    The ID of the VPC associated with the IPv4 Gateway.

    getIpv4Gateways Result

    The following output properties are available:

    Gateways List<Pulumi.AliCloud.Vpc.Outputs.GetIpv4GatewaysGateway>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    Ipv4GatewayName string
    NameRegex string
    OutputFile string
    Status string
    VpcId string
    Gateways []GetIpv4GatewaysGateway
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    Ipv4GatewayName string
    NameRegex string
    OutputFile string
    Status string
    VpcId string
    gateways List<GetIpv4GatewaysGateway>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    ipv4GatewayName String
    nameRegex String
    outputFile String
    status String
    vpcId String
    gateways GetIpv4GatewaysGateway[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    ipv4GatewayName string
    nameRegex string
    outputFile string
    status string
    vpcId string
    gateways Sequence[GetIpv4GatewaysGateway]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    ipv4_gateway_name str
    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>
    ipv4GatewayName String
    nameRegex String
    outputFile String
    status String
    vpcId String

    Supporting Types

    GetIpv4GatewaysGateway

    CreateTime string
    The creation time of the resource.
    Enabled bool
    Indicates whether the IPv4 gateway is activated.
    Id string
    The ID of the Ipv4 Gateway.
    Ipv4GatewayDescription string
    The description of the IPv4 gateway.
    Ipv4GatewayId string
    The resource attribute field that represents the resource level 1 ID.
    Ipv4GatewayName string
    The name of the IPv4 gateway.
    Ipv4GatewayRouteTableId string
    ID of the route table associated with IPv4 Gateway.
    Status string
    The status of the resource.
    VpcId string
    The ID of the VPC associated with the IPv4 Gateway.
    CreateTime string
    The creation time of the resource.
    Enabled bool
    Indicates whether the IPv4 gateway is activated.
    Id string
    The ID of the Ipv4 Gateway.
    Ipv4GatewayDescription string
    The description of the IPv4 gateway.
    Ipv4GatewayId string
    The resource attribute field that represents the resource level 1 ID.
    Ipv4GatewayName string
    The name of the IPv4 gateway.
    Ipv4GatewayRouteTableId string
    ID of the route table associated with IPv4 Gateway.
    Status string
    The status of the resource.
    VpcId string
    The ID of the VPC associated with the IPv4 Gateway.
    createTime String
    The creation time of the resource.
    enabled Boolean
    Indicates whether the IPv4 gateway is activated.
    id String
    The ID of the Ipv4 Gateway.
    ipv4GatewayDescription String
    The description of the IPv4 gateway.
    ipv4GatewayId String
    The resource attribute field that represents the resource level 1 ID.
    ipv4GatewayName String
    The name of the IPv4 gateway.
    ipv4GatewayRouteTableId String
    ID of the route table associated with IPv4 Gateway.
    status String
    The status of the resource.
    vpcId String
    The ID of the VPC associated with the IPv4 Gateway.
    createTime string
    The creation time of the resource.
    enabled boolean
    Indicates whether the IPv4 gateway is activated.
    id string
    The ID of the Ipv4 Gateway.
    ipv4GatewayDescription string
    The description of the IPv4 gateway.
    ipv4GatewayId string
    The resource attribute field that represents the resource level 1 ID.
    ipv4GatewayName string
    The name of the IPv4 gateway.
    ipv4GatewayRouteTableId string
    ID of the route table associated with IPv4 Gateway.
    status string
    The status of the resource.
    vpcId 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_description str
    The description of the IPv4 gateway.
    ipv4_gateway_id str
    The resource attribute field that represents the resource level 1 ID.
    ipv4_gateway_name str
    The name of the IPv4 gateway.
    ipv4_gateway_route_table_id str
    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.
    createTime String
    The creation time of the resource.
    enabled Boolean
    Indicates whether the IPv4 gateway is activated.
    id String
    The ID of the Ipv4 Gateway.
    ipv4GatewayDescription String
    The description of the IPv4 gateway.
    ipv4GatewayId String
    The resource attribute field that represents the resource level 1 ID.
    ipv4GatewayName String
    The name of the IPv4 gateway.
    ipv4GatewayRouteTableId String
    ID of the route table associated with IPv4 Gateway.
    status String
    The status of the resource.
    vpcId 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.
    alicloud logo
    Alibaba Cloud v3.59.0 published on Friday, Jul 12, 2024 by Pulumi