1. Packages
  2. Ucloud Provider
  3. API Docs
  4. getNatGateways
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.getNatGateways

Explore with Pulumi AI

ucloud logo
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

    This data source providers a list of Nat Gateway resources according to their ID and name.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const example = ucloud.getNatGateways({});
    export const first = example.then(example => example.natGateways?.[0]?.id);
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    example = ucloud.get_nat_gateways()
    pulumi.export("first", example.nat_gateways[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ucloud.GetNatGateways(ctx, &ucloud.GetNatGatewaysArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("first", example.NatGateways[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ucloud.GetNatGateways.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["first"] = example.Apply(getNatGatewaysResult => getNatGatewaysResult.NatGateways[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ucloud.UcloudFunctions;
    import com.pulumi.ucloud.inputs.GetNatGatewaysArgs;
    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 example = UcloudFunctions.getNatGateways();
    
            ctx.export("first", example.applyValue(getNatGatewaysResult -> getNatGatewaysResult.natGateways()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ucloud:getNatGateways
          arguments: {}
    outputs:
      first: ${example.natGateways[0].id}
    

    Using getNatGateways

    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 getNatGateways(args: GetNatGatewaysArgs, opts?: InvokeOptions): Promise<GetNatGatewaysResult>
    function getNatGatewaysOutput(args: GetNatGatewaysOutputArgs, opts?: InvokeOptions): Output<GetNatGatewaysResult>
    def get_nat_gateways(id: Optional[str] = None,
                         ids: Optional[Sequence[str]] = None,
                         name_regex: Optional[str] = None,
                         output_file: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetNatGatewaysResult
    def get_nat_gateways_output(id: Optional[pulumi.Input[str]] = None,
                         ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                         name_regex: Optional[pulumi.Input[str]] = None,
                         output_file: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetNatGatewaysResult]
    func GetNatGateways(ctx *Context, args *GetNatGatewaysArgs, opts ...InvokeOption) (*GetNatGatewaysResult, error)
    func GetNatGatewaysOutput(ctx *Context, args *GetNatGatewaysOutputArgs, opts ...InvokeOption) GetNatGatewaysResultOutput

    > Note: This function is named GetNatGateways in the Go SDK.

    public static class GetNatGateways 
    {
        public static Task<GetNatGatewaysResult> InvokeAsync(GetNatGatewaysArgs args, InvokeOptions? opts = null)
        public static Output<GetNatGatewaysResult> Invoke(GetNatGatewaysInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNatGatewaysResult> getNatGateways(GetNatGatewaysArgs args, InvokeOptions options)
    public static Output<GetNatGatewaysResult> getNatGateways(GetNatGatewaysArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ucloud:index/getNatGateways:getNatGateways
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The ID of Nat Gateway.
    Ids List<string>
    A list of Nat Gateway IDs, all the Nat Gateways belongs to the defined region will be retrieved if this argument is [].
    NameRegex string
    A regex string to filter resulting Nat Gateways by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Id string
    The ID of Nat Gateway.
    Ids []string
    A list of Nat Gateway IDs, all the Nat Gateways belongs to the defined region will be retrieved if this argument is [].
    NameRegex string
    A regex string to filter resulting Nat Gateways by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    id String
    The ID of Nat Gateway.
    ids List<String>
    A list of Nat Gateway IDs, all the Nat Gateways belongs to the defined region will be retrieved if this argument is [].
    nameRegex String
    A regex string to filter resulting Nat Gateways by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    id string
    The ID of Nat Gateway.
    ids string[]
    A list of Nat Gateway IDs, all the Nat Gateways belongs to the defined region will be retrieved if this argument is [].
    nameRegex string
    A regex string to filter resulting Nat Gateways by name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    id str
    The ID of Nat Gateway.
    ids Sequence[str]
    A list of Nat Gateway IDs, all the Nat Gateways belongs to the defined region will be retrieved if this argument is [].
    name_regex str
    A regex string to filter resulting Nat Gateways by name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    id String
    The ID of Nat Gateway.
    ids List<String>
    A list of Nat Gateway IDs, all the Nat Gateways belongs to the defined region will be retrieved if this argument is [].
    nameRegex String
    A regex string to filter resulting Nat Gateways by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getNatGateways Result

    The following output properties are available:

    Id string
    The ID of Nat Gateway.
    Ids List<string>
    NatGateways List<GetNatGatewaysNatGateway>
    It is a nested type. Nat Gateways documented below.
    TotalCount double
    Total number of Nat Gateways that satisfy the condition.
    NameRegex string
    OutputFile string
    Id string
    The ID of Nat Gateway.
    Ids []string
    NatGateways []GetNatGatewaysNatGateway
    It is a nested type. Nat Gateways documented below.
    TotalCount float64
    Total number of Nat Gateways that satisfy the condition.
    NameRegex string
    OutputFile string
    id String
    The ID of Nat Gateway.
    ids List<String>
    natGateways List<GetNatGatewaysNatGateway>
    It is a nested type. Nat Gateways documented below.
    totalCount Double
    Total number of Nat Gateways that satisfy the condition.
    nameRegex String
    outputFile String
    id string
    The ID of Nat Gateway.
    ids string[]
    natGateways GetNatGatewaysNatGateway[]
    It is a nested type. Nat Gateways documented below.
    totalCount number
    Total number of Nat Gateways that satisfy the condition.
    nameRegex string
    outputFile string
    id str
    The ID of Nat Gateway.
    ids Sequence[str]
    nat_gateways Sequence[GetNatGatewaysNatGateway]
    It is a nested type. Nat Gateways documented below.
    total_count float
    Total number of Nat Gateways that satisfy the condition.
    name_regex str
    output_file str
    id String
    The ID of Nat Gateway.
    ids List<String>
    natGateways List<Property Map>
    It is a nested type. Nat Gateways documented below.
    totalCount Number
    Total number of Nat Gateways that satisfy the condition.
    nameRegex String
    outputFile String

    Supporting Types

    GetNatGatewaysNatGateway

    CreateTime string
    The time of creation for Nat Gateway, formatted in RFC3339 time string.
    Id string
    The ID of Nat Gateway.
    IpSets List<GetNatGatewaysNatGatewayIpSet>
    It is a nested type which documented below.
    Name string
    The name of the Nat Gateway.
    Remark string
    The remarks of Nat Gateway.
    SecurityGroup string
    The ID of the associated security group.
    SubnetIds List<string>
    The list of subnet ID under the VPC.
    Tag string
    A tag assigned to the Nat Gateway.
    VpcId string
    The ID of VPC linked to the Nat Gateway.
    CreateTime string
    The time of creation for Nat Gateway, formatted in RFC3339 time string.
    Id string
    The ID of Nat Gateway.
    IpSets []GetNatGatewaysNatGatewayIpSet
    It is a nested type which documented below.
    Name string
    The name of the Nat Gateway.
    Remark string
    The remarks of Nat Gateway.
    SecurityGroup string
    The ID of the associated security group.
    SubnetIds []string
    The list of subnet ID under the VPC.
    Tag string
    A tag assigned to the Nat Gateway.
    VpcId string
    The ID of VPC linked to the Nat Gateway.
    createTime String
    The time of creation for Nat Gateway, formatted in RFC3339 time string.
    id String
    The ID of Nat Gateway.
    ipSets List<GetNatGatewaysNatGatewayIpSet>
    It is a nested type which documented below.
    name String
    The name of the Nat Gateway.
    remark String
    The remarks of Nat Gateway.
    securityGroup String
    The ID of the associated security group.
    subnetIds List<String>
    The list of subnet ID under the VPC.
    tag String
    A tag assigned to the Nat Gateway.
    vpcId String
    The ID of VPC linked to the Nat Gateway.
    createTime string
    The time of creation for Nat Gateway, formatted in RFC3339 time string.
    id string
    The ID of Nat Gateway.
    ipSets GetNatGatewaysNatGatewayIpSet[]
    It is a nested type which documented below.
    name string
    The name of the Nat Gateway.
    remark string
    The remarks of Nat Gateway.
    securityGroup string
    The ID of the associated security group.
    subnetIds string[]
    The list of subnet ID under the VPC.
    tag string
    A tag assigned to the Nat Gateway.
    vpcId string
    The ID of VPC linked to the Nat Gateway.
    create_time str
    The time of creation for Nat Gateway, formatted in RFC3339 time string.
    id str
    The ID of Nat Gateway.
    ip_sets Sequence[GetNatGatewaysNatGatewayIpSet]
    It is a nested type which documented below.
    name str
    The name of the Nat Gateway.
    remark str
    The remarks of Nat Gateway.
    security_group str
    The ID of the associated security group.
    subnet_ids Sequence[str]
    The list of subnet ID under the VPC.
    tag str
    A tag assigned to the Nat Gateway.
    vpc_id str
    The ID of VPC linked to the Nat Gateway.
    createTime String
    The time of creation for Nat Gateway, formatted in RFC3339 time string.
    id String
    The ID of Nat Gateway.
    ipSets List<Property Map>
    It is a nested type which documented below.
    name String
    The name of the Nat Gateway.
    remark String
    The remarks of Nat Gateway.
    securityGroup String
    The ID of the associated security group.
    subnetIds List<String>
    The list of subnet ID under the VPC.
    tag String
    A tag assigned to the Nat Gateway.
    vpcId String
    The ID of VPC linked to the Nat Gateway.

    GetNatGatewaysNatGatewayIpSet

    InternetType string
    Type of Elastic IP routes.
    Ip string
    Elastic IP address.
    InternetType string
    Type of Elastic IP routes.
    Ip string
    Elastic IP address.
    internetType String
    Type of Elastic IP routes.
    ip String
    Elastic IP address.
    internetType string
    Type of Elastic IP routes.
    ip string
    Elastic IP address.
    internet_type str
    Type of Elastic IP routes.
    ip str
    Elastic IP address.
    internetType String
    Type of Elastic IP routes.
    ip String
    Elastic IP address.

    Package Details

    Repository
    ucloud ucloud/terraform-provider-ucloud
    License
    Notes
    This Pulumi package is based on the ucloud Terraform Provider.
    ucloud logo
    ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud