1. Packages
  2. Scaleway
  3. API Docs
  4. network
  5. getGatewayNetwork
Scaleway v1.25.0 published on Saturday, Mar 22, 2025 by pulumiverse

scaleway.network.getGatewayNetwork

Explore with Pulumi AI

scaleway logo
Scaleway v1.25.0 published on Saturday, Mar 22, 2025 by pulumiverse

    Gets information about a GatewayNetwork (a connection between a Public Gateway and a Private Network).

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumi/scaleway";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const main = new scaleway.network.GatewayNetwork("main", {
        gatewayId: pg01.id,
        privateNetworkId: pn01.id,
        dhcpId: dhcp01.id,
        cleanupDhcp: true,
        enableMasquerade: true,
    });
    const byId = scaleway.network.getGatewayNetworkOutput({
        gatewayNetworkId: main.id,
    });
    const byGatewayAndPn = scaleway.network.getGatewayNetwork({
        gatewayId: pg01.id,
        privateNetworkId: pn01.id,
    });
    
    import pulumi
    import pulumi_scaleway as scaleway
    import pulumiverse_scaleway as scaleway
    
    main = scaleway.network.GatewayNetwork("main",
        gateway_id=pg01["id"],
        private_network_id=pn01["id"],
        dhcp_id=dhcp01["id"],
        cleanup_dhcp=True,
        enable_masquerade=True)
    by_id = scaleway.network.get_gateway_network_output(gateway_network_id=main.id)
    by_gateway_and_pn = scaleway.network.get_gateway_network(gateway_id=pg01["id"],
        private_network_id=pn01["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/network"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		main, err := network.NewGatewayNetwork(ctx, "main", &network.GatewayNetworkArgs{
    			GatewayId:        pulumi.Any(pg01.Id),
    			PrivateNetworkId: pulumi.Any(pn01.Id),
    			DhcpId:           pulumi.Any(dhcp01.Id),
    			CleanupDhcp:      pulumi.Bool(true),
    			EnableMasquerade: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_ = network.LookupGatewayNetworkOutput(ctx, network.GetGatewayNetworkOutputArgs{
    			GatewayNetworkId: main.ID(),
    		}, nil)
    		_, err = network.LookupGatewayNetwork(ctx, &network.LookupGatewayNetworkArgs{
    			GatewayId:        pulumi.StringRef(pg01.Id),
    			PrivateNetworkId: pulumi.StringRef(pn01.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumi.Scaleway;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var main = new Scaleway.Network.GatewayNetwork("main", new()
        {
            GatewayId = pg01.Id,
            PrivateNetworkId = pn01.Id,
            DhcpId = dhcp01.Id,
            CleanupDhcp = true,
            EnableMasquerade = true,
        });
    
        var byId = Scaleway.Network.GetGatewayNetwork.Invoke(new()
        {
            GatewayNetworkId = main.Id,
        });
    
        var byGatewayAndPn = Scaleway.Network.GetGatewayNetwork.Invoke(new()
        {
            GatewayId = pg01.Id,
            PrivateNetworkId = pn01.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.network.GatewayNetwork;
    import com.pulumi.scaleway.network.GatewayNetworkArgs;
    import com.pulumi.scaleway.network.NetworkFunctions;
    import com.pulumi.scaleway.network.inputs.GetGatewayNetworkArgs;
    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) {
            var main = new GatewayNetwork("main", GatewayNetworkArgs.builder()
                .gatewayId(pg01.id())
                .privateNetworkId(pn01.id())
                .dhcpId(dhcp01.id())
                .cleanupDhcp(true)
                .enableMasquerade(true)
                .build());
    
            final var byId = NetworkFunctions.getGatewayNetwork(GetGatewayNetworkArgs.builder()
                .gatewayNetworkId(main.id())
                .build());
    
            final var byGatewayAndPn = NetworkFunctions.getGatewayNetwork(GetGatewayNetworkArgs.builder()
                .gatewayId(pg01.id())
                .privateNetworkId(pn01.id())
                .build());
    
        }
    }
    
    resources:
      main:
        type: scaleway:network:GatewayNetwork
        properties:
          gatewayId: ${pg01.id}
          privateNetworkId: ${pn01.id}
          dhcpId: ${dhcp01.id}
          cleanupDhcp: true
          enableMasquerade: true
    variables:
      byId:
        fn::invoke:
          function: scaleway:network:getGatewayNetwork
          arguments:
            gatewayNetworkId: ${main.id}
      byGatewayAndPn:
        fn::invoke:
          function: scaleway:network:getGatewayNetwork
          arguments:
            gatewayId: ${pg01.id}
            privateNetworkId: ${pn01.id}
    

    Using getGatewayNetwork

    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 getGatewayNetwork(args: GetGatewayNetworkArgs, opts?: InvokeOptions): Promise<GetGatewayNetworkResult>
    function getGatewayNetworkOutput(args: GetGatewayNetworkOutputArgs, opts?: InvokeOptions): Output<GetGatewayNetworkResult>
    def get_gateway_network(dhcp_id: Optional[str] = None,
                            enable_masquerade: Optional[bool] = None,
                            gateway_id: Optional[str] = None,
                            gateway_network_id: Optional[str] = None,
                            private_network_id: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetGatewayNetworkResult
    def get_gateway_network_output(dhcp_id: Optional[pulumi.Input[str]] = None,
                            enable_masquerade: Optional[pulumi.Input[bool]] = None,
                            gateway_id: Optional[pulumi.Input[str]] = None,
                            gateway_network_id: Optional[pulumi.Input[str]] = None,
                            private_network_id: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetGatewayNetworkResult]
    func LookupGatewayNetwork(ctx *Context, args *LookupGatewayNetworkArgs, opts ...InvokeOption) (*LookupGatewayNetworkResult, error)
    func LookupGatewayNetworkOutput(ctx *Context, args *LookupGatewayNetworkOutputArgs, opts ...InvokeOption) LookupGatewayNetworkResultOutput

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

    public static class GetGatewayNetwork 
    {
        public static Task<GetGatewayNetworkResult> InvokeAsync(GetGatewayNetworkArgs args, InvokeOptions? opts = null)
        public static Output<GetGatewayNetworkResult> Invoke(GetGatewayNetworkInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGatewayNetworkResult> getGatewayNetwork(GetGatewayNetworkArgs args, InvokeOptions options)
    public static Output<GetGatewayNetworkResult> getGatewayNetwork(GetGatewayNetworkArgs args, InvokeOptions options)
    
    fn::invoke:
      function: scaleway:network/getGatewayNetwork:getGatewayNetwork
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DhcpId string
    EnableMasquerade bool
    GatewayId string
    GatewayNetworkId string
    ID of the GatewayNetwork.
    PrivateNetworkId string
    DhcpId string
    EnableMasquerade bool
    GatewayId string
    GatewayNetworkId string
    ID of the GatewayNetwork.
    PrivateNetworkId string
    dhcpId String
    enableMasquerade Boolean
    gatewayId String
    gatewayNetworkId String
    ID of the GatewayNetwork.
    privateNetworkId String
    dhcpId string
    enableMasquerade boolean
    gatewayId string
    gatewayNetworkId string
    ID of the GatewayNetwork.
    privateNetworkId string
    dhcpId String
    enableMasquerade Boolean
    gatewayId String
    gatewayNetworkId String
    ID of the GatewayNetwork.
    privateNetworkId String

    getGatewayNetwork Result

    The following output properties are available:

    CleanupDhcp bool
    CreatedAt string
    EnableDhcp bool
    Id string
    The provider-assigned unique ID for this managed resource.
    IpamConfigs List<Pulumiverse.Scaleway.Network.Outputs.GetGatewayNetworkIpamConfig>
    MacAddress string
    StaticAddress string
    Status string
    UpdatedAt string
    Zone string
    DhcpId string
    EnableMasquerade bool
    GatewayId string
    GatewayNetworkId string
    PrivateNetworkId string
    CleanupDhcp bool
    CreatedAt string
    EnableDhcp bool
    Id string
    The provider-assigned unique ID for this managed resource.
    IpamConfigs []GetGatewayNetworkIpamConfig
    MacAddress string
    StaticAddress string
    Status string
    UpdatedAt string
    Zone string
    DhcpId string
    EnableMasquerade bool
    GatewayId string
    GatewayNetworkId string
    PrivateNetworkId string
    cleanupDhcp Boolean
    createdAt String
    enableDhcp Boolean
    id String
    The provider-assigned unique ID for this managed resource.
    ipamConfigs List<GetGatewayNetworkIpamConfig>
    macAddress String
    staticAddress String
    status String
    updatedAt String
    zone String
    dhcpId String
    enableMasquerade Boolean
    gatewayId String
    gatewayNetworkId String
    privateNetworkId String
    cleanupDhcp boolean
    createdAt string
    enableDhcp boolean
    id string
    The provider-assigned unique ID for this managed resource.
    ipamConfigs GetGatewayNetworkIpamConfig[]
    macAddress string
    staticAddress string
    status string
    updatedAt string
    zone string
    dhcpId string
    enableMasquerade boolean
    gatewayId string
    gatewayNetworkId string
    privateNetworkId string
    cleanupDhcp Boolean
    createdAt String
    enableDhcp Boolean
    id String
    The provider-assigned unique ID for this managed resource.
    ipamConfigs List<Property Map>
    macAddress String
    staticAddress String
    status String
    updatedAt String
    zone String
    dhcpId String
    enableMasquerade Boolean
    gatewayId String
    gatewayNetworkId String
    privateNetworkId String

    Supporting Types

    GetGatewayNetworkIpamConfig

    IpamIpId string
    Use this IPAM-booked IP ID as the Gateway's IP in this Private Network
    PushDefaultRoute bool
    Defines whether the default route is enabled on that Gateway Network
    IpamIpId string
    Use this IPAM-booked IP ID as the Gateway's IP in this Private Network
    PushDefaultRoute bool
    Defines whether the default route is enabled on that Gateway Network
    ipamIpId String
    Use this IPAM-booked IP ID as the Gateway's IP in this Private Network
    pushDefaultRoute Boolean
    Defines whether the default route is enabled on that Gateway Network
    ipamIpId string
    Use this IPAM-booked IP ID as the Gateway's IP in this Private Network
    pushDefaultRoute boolean
    Defines whether the default route is enabled on that Gateway Network
    ipam_ip_id str
    Use this IPAM-booked IP ID as the Gateway's IP in this Private Network
    push_default_route bool
    Defines whether the default route is enabled on that Gateway Network
    ipamIpId String
    Use this IPAM-booked IP ID as the Gateway's IP in this Private Network
    pushDefaultRoute Boolean
    Defines whether the default route is enabled on that Gateway Network

    Package Details

    Repository
    scaleway pulumiverse/pulumi-scaleway
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the scaleway Terraform Provider.
    scaleway logo
    Scaleway v1.25.0 published on Saturday, Mar 22, 2025 by pulumiverse