scaleway.getVpcPublicGatewayDhcpReservation
Explore with Pulumi AI
Gets information about a DHCP entry. For further information, please see the API documentation.
Example Dynamic
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumi/scaleway";
import * as scaleway from "@pulumiverse/scaleway";
const main = new scaleway.network.PrivateNetwork("main", {});
const mainServer = new scaleway.instance.Server("main", {
image: "ubuntu_jammy",
type: "DEV1-S",
zone: "fr-par-1",
});
const mainPrivateNic = new scaleway.instance.PrivateNic("main", {
serverId: mainServer.id,
privateNetworkId: main.id,
});
const mainPublicGatewayIp = new scaleway.network.PublicGatewayIp("main", {});
const mainPublicGatewayDhcp = new scaleway.network.PublicGatewayDhcp("main", {subnet: "192.168.1.0/24"});
const mainPublicGateway = new scaleway.network.PublicGateway("main", {
name: "foobar",
type: "VPC-GW-S",
ipId: mainPublicGatewayIp.id,
});
const mainGatewayNetwork = new scaleway.network.GatewayNetwork("main", {
gatewayId: mainPublicGateway.id,
privateNetworkId: main.id,
dhcpId: mainPublicGatewayDhcp.id,
cleanupDhcp: true,
enableMasquerade: true,
});
//# Retrieve the dynamic entries generated by mac address & gateway network
const byMacAddressAndGwNetwork = scaleway.network.getPublicGatewayDhcpReservationOutput({
macAddress: mainPrivateNic.macAddress,
gatewayNetworkId: mainGatewayNetwork.id,
});
import pulumi
import pulumi_scaleway as scaleway
import pulumiverse_scaleway as scaleway
main = scaleway.network.PrivateNetwork("main")
main_server = scaleway.instance.Server("main",
image="ubuntu_jammy",
type="DEV1-S",
zone="fr-par-1")
main_private_nic = scaleway.instance.PrivateNic("main",
server_id=main_server.id,
private_network_id=main.id)
main_public_gateway_ip = scaleway.network.PublicGatewayIp("main")
main_public_gateway_dhcp = scaleway.network.PublicGatewayDhcp("main", subnet="192.168.1.0/24")
main_public_gateway = scaleway.network.PublicGateway("main",
name="foobar",
type="VPC-GW-S",
ip_id=main_public_gateway_ip.id)
main_gateway_network = scaleway.network.GatewayNetwork("main",
gateway_id=main_public_gateway.id,
private_network_id=main.id,
dhcp_id=main_public_gateway_dhcp.id,
cleanup_dhcp=True,
enable_masquerade=True)
## Retrieve the dynamic entries generated by mac address & gateway network
by_mac_address_and_gw_network = scaleway.network.get_public_gateway_dhcp_reservation_output(mac_address=main_private_nic.mac_address,
gateway_network_id=main_gateway_network.id)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/instance"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/network"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
main, err := network.NewPrivateNetwork(ctx, "main", nil)
if err != nil {
return err
}
mainServer, err := instance.NewServer(ctx, "main", &instance.ServerArgs{
Image: pulumi.String("ubuntu_jammy"),
Type: pulumi.String("DEV1-S"),
Zone: pulumi.String("fr-par-1"),
})
if err != nil {
return err
}
mainPrivateNic, err := instance.NewPrivateNic(ctx, "main", &instance.PrivateNicArgs{
ServerId: mainServer.ID(),
PrivateNetworkId: main.ID(),
})
if err != nil {
return err
}
mainPublicGatewayIp, err := network.NewPublicGatewayIp(ctx, "main", nil)
if err != nil {
return err
}
mainPublicGatewayDhcp, err := network.NewPublicGatewayDhcp(ctx, "main", &network.PublicGatewayDhcpArgs{
Subnet: pulumi.String("192.168.1.0/24"),
})
if err != nil {
return err
}
mainPublicGateway, err := network.NewPublicGateway(ctx, "main", &network.PublicGatewayArgs{
Name: pulumi.String("foobar"),
Type: pulumi.String("VPC-GW-S"),
IpId: mainPublicGatewayIp.ID(),
})
if err != nil {
return err
}
mainGatewayNetwork, err := network.NewGatewayNetwork(ctx, "main", &network.GatewayNetworkArgs{
GatewayId: mainPublicGateway.ID(),
PrivateNetworkId: main.ID(),
DhcpId: mainPublicGatewayDhcp.ID(),
CleanupDhcp: pulumi.Bool(true),
EnableMasquerade: pulumi.Bool(true),
})
if err != nil {
return err
}
// # Retrieve the dynamic entries generated by mac address & gateway network
_ = network.LookupPublicGatewayDhcpReservationOutput(ctx, network.GetPublicGatewayDhcpReservationOutputArgs{
MacAddress: mainPrivateNic.MacAddress,
GatewayNetworkId: mainGatewayNetwork.ID(),
}, nil)
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.PrivateNetwork("main");
var mainServer = new Scaleway.Instance.Server("main", new()
{
Image = "ubuntu_jammy",
Type = "DEV1-S",
Zone = "fr-par-1",
});
var mainPrivateNic = new Scaleway.Instance.PrivateNic("main", new()
{
ServerId = mainServer.Id,
PrivateNetworkId = main.Id,
});
var mainPublicGatewayIp = new Scaleway.Network.PublicGatewayIp("main");
var mainPublicGatewayDhcp = new Scaleway.Network.PublicGatewayDhcp("main", new()
{
Subnet = "192.168.1.0/24",
});
var mainPublicGateway = new Scaleway.Network.PublicGateway("main", new()
{
Name = "foobar",
Type = "VPC-GW-S",
IpId = mainPublicGatewayIp.Id,
});
var mainGatewayNetwork = new Scaleway.Network.GatewayNetwork("main", new()
{
GatewayId = mainPublicGateway.Id,
PrivateNetworkId = main.Id,
DhcpId = mainPublicGatewayDhcp.Id,
CleanupDhcp = true,
EnableMasquerade = true,
});
//# Retrieve the dynamic entries generated by mac address & gateway network
var byMacAddressAndGwNetwork = Scaleway.Network.GetPublicGatewayDhcpReservation.Invoke(new()
{
MacAddress = mainPrivateNic.MacAddress,
GatewayNetworkId = mainGatewayNetwork.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.network.PrivateNetwork;
import com.pulumi.scaleway.instance.Server;
import com.pulumi.scaleway.instance.ServerArgs;
import com.pulumi.scaleway.instance.PrivateNic;
import com.pulumi.scaleway.instance.PrivateNicArgs;
import com.pulumi.scaleway.network.PublicGatewayIp;
import com.pulumi.scaleway.network.PublicGatewayDhcp;
import com.pulumi.scaleway.network.PublicGatewayDhcpArgs;
import com.pulumi.scaleway.network.PublicGateway;
import com.pulumi.scaleway.network.PublicGatewayArgs;
import com.pulumi.scaleway.network.GatewayNetwork;
import com.pulumi.scaleway.network.GatewayNetworkArgs;
import com.pulumi.scaleway.network.NetworkFunctions;
import com.pulumi.scaleway.network.inputs.GetPublicGatewayDhcpReservationArgs;
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 PrivateNetwork("main");
var mainServer = new Server("mainServer", ServerArgs.builder()
.image("ubuntu_jammy")
.type("DEV1-S")
.zone("fr-par-1")
.build());
var mainPrivateNic = new PrivateNic("mainPrivateNic", PrivateNicArgs.builder()
.serverId(mainServer.id())
.privateNetworkId(main.id())
.build());
var mainPublicGatewayIp = new PublicGatewayIp("mainPublicGatewayIp");
var mainPublicGatewayDhcp = new PublicGatewayDhcp("mainPublicGatewayDhcp", PublicGatewayDhcpArgs.builder()
.subnet("192.168.1.0/24")
.build());
var mainPublicGateway = new PublicGateway("mainPublicGateway", PublicGatewayArgs.builder()
.name("foobar")
.type("VPC-GW-S")
.ipId(mainPublicGatewayIp.id())
.build());
var mainGatewayNetwork = new GatewayNetwork("mainGatewayNetwork", GatewayNetworkArgs.builder()
.gatewayId(mainPublicGateway.id())
.privateNetworkId(main.id())
.dhcpId(mainPublicGatewayDhcp.id())
.cleanupDhcp(true)
.enableMasquerade(true)
.build());
//# Retrieve the dynamic entries generated by mac address & gateway network
final var byMacAddressAndGwNetwork = NetworkFunctions.getPublicGatewayDhcpReservation(GetPublicGatewayDhcpReservationArgs.builder()
.macAddress(mainPrivateNic.macAddress())
.gatewayNetworkId(mainGatewayNetwork.id())
.build());
}
}
resources:
main:
type: scaleway:network:PrivateNetwork
mainServer:
type: scaleway:instance:Server
name: main
properties:
image: ubuntu_jammy
type: DEV1-S
zone: fr-par-1
mainPrivateNic:
type: scaleway:instance:PrivateNic
name: main
properties:
serverId: ${mainServer.id}
privateNetworkId: ${main.id}
mainPublicGatewayIp:
type: scaleway:network:PublicGatewayIp
name: main
mainPublicGatewayDhcp:
type: scaleway:network:PublicGatewayDhcp
name: main
properties:
subnet: 192.168.1.0/24
mainPublicGateway:
type: scaleway:network:PublicGateway
name: main
properties:
name: foobar
type: VPC-GW-S
ipId: ${mainPublicGatewayIp.id}
mainGatewayNetwork:
type: scaleway:network:GatewayNetwork
name: main
properties:
gatewayId: ${mainPublicGateway.id}
privateNetworkId: ${main.id}
dhcpId: ${mainPublicGatewayDhcp.id}
cleanupDhcp: true
enableMasquerade: true
variables:
## Retrieve the dynamic entries generated by mac address & gateway network
byMacAddressAndGwNetwork:
fn::invoke:
function: scaleway:network:getPublicGatewayDhcpReservation
arguments:
macAddress: ${mainPrivateNic.macAddress}
gatewayNetworkId: ${mainGatewayNetwork.id}
Example Static and PAT Rule
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumi/scaleway";
import * as scaleway from "@pulumiverse/scaleway";
const main = new scaleway.network.PrivateNetwork("main", {});
const mainSecurityGroup = new scaleway.instance.SecurityGroup("main", {
inboundDefaultPolicy: "drop",
outboundDefaultPolicy: "accept",
inboundRules: [{
action: "accept",
port: 22,
}],
});
const mainServer = new scaleway.instance.Server("main", {
image: "ubuntu_jammy",
type: "DEV1-S",
zone: "fr-par-1",
securityGroupId: mainSecurityGroup.id,
});
const mainPrivateNic = new scaleway.instance.PrivateNic("main", {
serverId: mainServer.id,
privateNetworkId: main.id,
});
const mainPublicGatewayIp = new scaleway.network.PublicGatewayIp("main", {});
const mainPublicGatewayDhcp = new scaleway.network.PublicGatewayDhcp("main", {subnet: "192.168.1.0/24"});
const mainPublicGateway = new scaleway.network.PublicGateway("main", {
name: "foobar",
type: "VPC-GW-S",
ipId: mainPublicGatewayIp.id,
});
const mainGatewayNetwork = new scaleway.network.GatewayNetwork("main", {
gatewayId: mainPublicGateway.id,
privateNetworkId: main.id,
dhcpId: mainPublicGatewayDhcp.id,
cleanupDhcp: true,
enableMasquerade: true,
});
const mainPublicGatewayDhcpReservation = new scaleway.network.PublicGatewayDhcpReservation("main", {
gatewayNetworkId: mainGatewayNetwork.id,
macAddress: mainPrivateNic.macAddress,
ipAddress: "192.168.1.4",
});
//## VPC PAT RULE
const mainPublicGatewayPatRule = new scaleway.network.PublicGatewayPatRule("main", {
gatewayId: mainPublicGateway.id,
privateIp: mainPublicGatewayDhcpReservation.ipAddress,
privatePort: 22,
publicPort: 2222,
protocol: "tcp",
});
const byId = scaleway.network.getPublicGatewayDhcpReservationOutput({
reservationId: mainPublicGatewayDhcpReservation.id,
});
import pulumi
import pulumi_scaleway as scaleway
import pulumiverse_scaleway as scaleway
main = scaleway.network.PrivateNetwork("main")
main_security_group = scaleway.instance.SecurityGroup("main",
inbound_default_policy="drop",
outbound_default_policy="accept",
inbound_rules=[{
"action": "accept",
"port": 22,
}])
main_server = scaleway.instance.Server("main",
image="ubuntu_jammy",
type="DEV1-S",
zone="fr-par-1",
security_group_id=main_security_group.id)
main_private_nic = scaleway.instance.PrivateNic("main",
server_id=main_server.id,
private_network_id=main.id)
main_public_gateway_ip = scaleway.network.PublicGatewayIp("main")
main_public_gateway_dhcp = scaleway.network.PublicGatewayDhcp("main", subnet="192.168.1.0/24")
main_public_gateway = scaleway.network.PublicGateway("main",
name="foobar",
type="VPC-GW-S",
ip_id=main_public_gateway_ip.id)
main_gateway_network = scaleway.network.GatewayNetwork("main",
gateway_id=main_public_gateway.id,
private_network_id=main.id,
dhcp_id=main_public_gateway_dhcp.id,
cleanup_dhcp=True,
enable_masquerade=True)
main_public_gateway_dhcp_reservation = scaleway.network.PublicGatewayDhcpReservation("main",
gateway_network_id=main_gateway_network.id,
mac_address=main_private_nic.mac_address,
ip_address="192.168.1.4")
### VPC PAT RULE
main_public_gateway_pat_rule = scaleway.network.PublicGatewayPatRule("main",
gateway_id=main_public_gateway.id,
private_ip=main_public_gateway_dhcp_reservation.ip_address,
private_port=22,
public_port=2222,
protocol="tcp")
by_id = scaleway.network.get_public_gateway_dhcp_reservation_output(reservation_id=main_public_gateway_dhcp_reservation.id)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/instance"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/network"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
main, err := network.NewPrivateNetwork(ctx, "main", nil)
if err != nil {
return err
}
mainSecurityGroup, err := instance.NewSecurityGroup(ctx, "main", &instance.SecurityGroupArgs{
InboundDefaultPolicy: pulumi.String("drop"),
OutboundDefaultPolicy: pulumi.String("accept"),
InboundRules: instance.SecurityGroupInboundRuleArray{
&instance.SecurityGroupInboundRuleArgs{
Action: pulumi.String("accept"),
Port: pulumi.Int(22),
},
},
})
if err != nil {
return err
}
mainServer, err := instance.NewServer(ctx, "main", &instance.ServerArgs{
Image: pulumi.String("ubuntu_jammy"),
Type: pulumi.String("DEV1-S"),
Zone: pulumi.String("fr-par-1"),
SecurityGroupId: mainSecurityGroup.ID(),
})
if err != nil {
return err
}
mainPrivateNic, err := instance.NewPrivateNic(ctx, "main", &instance.PrivateNicArgs{
ServerId: mainServer.ID(),
PrivateNetworkId: main.ID(),
})
if err != nil {
return err
}
mainPublicGatewayIp, err := network.NewPublicGatewayIp(ctx, "main", nil)
if err != nil {
return err
}
mainPublicGatewayDhcp, err := network.NewPublicGatewayDhcp(ctx, "main", &network.PublicGatewayDhcpArgs{
Subnet: pulumi.String("192.168.1.0/24"),
})
if err != nil {
return err
}
mainPublicGateway, err := network.NewPublicGateway(ctx, "main", &network.PublicGatewayArgs{
Name: pulumi.String("foobar"),
Type: pulumi.String("VPC-GW-S"),
IpId: mainPublicGatewayIp.ID(),
})
if err != nil {
return err
}
mainGatewayNetwork, err := network.NewGatewayNetwork(ctx, "main", &network.GatewayNetworkArgs{
GatewayId: mainPublicGateway.ID(),
PrivateNetworkId: main.ID(),
DhcpId: mainPublicGatewayDhcp.ID(),
CleanupDhcp: pulumi.Bool(true),
EnableMasquerade: pulumi.Bool(true),
})
if err != nil {
return err
}
mainPublicGatewayDhcpReservation, err := network.NewPublicGatewayDhcpReservation(ctx, "main", &network.PublicGatewayDhcpReservationArgs{
GatewayNetworkId: mainGatewayNetwork.ID(),
MacAddress: mainPrivateNic.MacAddress,
IpAddress: pulumi.String("192.168.1.4"),
})
if err != nil {
return err
}
// ## VPC PAT RULE
_, err = network.NewPublicGatewayPatRule(ctx, "main", &network.PublicGatewayPatRuleArgs{
GatewayId: mainPublicGateway.ID(),
PrivateIp: mainPublicGatewayDhcpReservation.IpAddress,
PrivatePort: pulumi.Int(22),
PublicPort: pulumi.Int(2222),
Protocol: pulumi.String("tcp"),
})
if err != nil {
return err
}
_ = network.LookupPublicGatewayDhcpReservationOutput(ctx, network.GetPublicGatewayDhcpReservationOutputArgs{
ReservationId: mainPublicGatewayDhcpReservation.ID(),
}, nil)
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.PrivateNetwork("main");
var mainSecurityGroup = new Scaleway.Instance.SecurityGroup("main", new()
{
InboundDefaultPolicy = "drop",
OutboundDefaultPolicy = "accept",
InboundRules = new[]
{
new Scaleway.Instance.Inputs.SecurityGroupInboundRuleArgs
{
Action = "accept",
Port = 22,
},
},
});
var mainServer = new Scaleway.Instance.Server("main", new()
{
Image = "ubuntu_jammy",
Type = "DEV1-S",
Zone = "fr-par-1",
SecurityGroupId = mainSecurityGroup.Id,
});
var mainPrivateNic = new Scaleway.Instance.PrivateNic("main", new()
{
ServerId = mainServer.Id,
PrivateNetworkId = main.Id,
});
var mainPublicGatewayIp = new Scaleway.Network.PublicGatewayIp("main");
var mainPublicGatewayDhcp = new Scaleway.Network.PublicGatewayDhcp("main", new()
{
Subnet = "192.168.1.0/24",
});
var mainPublicGateway = new Scaleway.Network.PublicGateway("main", new()
{
Name = "foobar",
Type = "VPC-GW-S",
IpId = mainPublicGatewayIp.Id,
});
var mainGatewayNetwork = new Scaleway.Network.GatewayNetwork("main", new()
{
GatewayId = mainPublicGateway.Id,
PrivateNetworkId = main.Id,
DhcpId = mainPublicGatewayDhcp.Id,
CleanupDhcp = true,
EnableMasquerade = true,
});
var mainPublicGatewayDhcpReservation = new Scaleway.Network.PublicGatewayDhcpReservation("main", new()
{
GatewayNetworkId = mainGatewayNetwork.Id,
MacAddress = mainPrivateNic.MacAddress,
IpAddress = "192.168.1.4",
});
//## VPC PAT RULE
var mainPublicGatewayPatRule = new Scaleway.Network.PublicGatewayPatRule("main", new()
{
GatewayId = mainPublicGateway.Id,
PrivateIp = mainPublicGatewayDhcpReservation.IpAddress,
PrivatePort = 22,
PublicPort = 2222,
Protocol = "tcp",
});
var byId = Scaleway.Network.GetPublicGatewayDhcpReservation.Invoke(new()
{
ReservationId = mainPublicGatewayDhcpReservation.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.network.PrivateNetwork;
import com.pulumi.scaleway.instance.SecurityGroup;
import com.pulumi.scaleway.instance.SecurityGroupArgs;
import com.pulumi.scaleway.instance.inputs.SecurityGroupInboundRuleArgs;
import com.pulumi.scaleway.instance.Server;
import com.pulumi.scaleway.instance.ServerArgs;
import com.pulumi.scaleway.instance.PrivateNic;
import com.pulumi.scaleway.instance.PrivateNicArgs;
import com.pulumi.scaleway.network.PublicGatewayIp;
import com.pulumi.scaleway.network.PublicGatewayDhcp;
import com.pulumi.scaleway.network.PublicGatewayDhcpArgs;
import com.pulumi.scaleway.network.PublicGateway;
import com.pulumi.scaleway.network.PublicGatewayArgs;
import com.pulumi.scaleway.network.GatewayNetwork;
import com.pulumi.scaleway.network.GatewayNetworkArgs;
import com.pulumi.scaleway.network.PublicGatewayDhcpReservation;
import com.pulumi.scaleway.network.PublicGatewayDhcpReservationArgs;
import com.pulumi.scaleway.network.PublicGatewayPatRule;
import com.pulumi.scaleway.network.PublicGatewayPatRuleArgs;
import com.pulumi.scaleway.network.NetworkFunctions;
import com.pulumi.scaleway.network.inputs.GetPublicGatewayDhcpReservationArgs;
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 PrivateNetwork("main");
var mainSecurityGroup = new SecurityGroup("mainSecurityGroup", SecurityGroupArgs.builder()
.inboundDefaultPolicy("drop")
.outboundDefaultPolicy("accept")
.inboundRules(SecurityGroupInboundRuleArgs.builder()
.action("accept")
.port("22")
.build())
.build());
var mainServer = new Server("mainServer", ServerArgs.builder()
.image("ubuntu_jammy")
.type("DEV1-S")
.zone("fr-par-1")
.securityGroupId(mainSecurityGroup.id())
.build());
var mainPrivateNic = new PrivateNic("mainPrivateNic", PrivateNicArgs.builder()
.serverId(mainServer.id())
.privateNetworkId(main.id())
.build());
var mainPublicGatewayIp = new PublicGatewayIp("mainPublicGatewayIp");
var mainPublicGatewayDhcp = new PublicGatewayDhcp("mainPublicGatewayDhcp", PublicGatewayDhcpArgs.builder()
.subnet("192.168.1.0/24")
.build());
var mainPublicGateway = new PublicGateway("mainPublicGateway", PublicGatewayArgs.builder()
.name("foobar")
.type("VPC-GW-S")
.ipId(mainPublicGatewayIp.id())
.build());
var mainGatewayNetwork = new GatewayNetwork("mainGatewayNetwork", GatewayNetworkArgs.builder()
.gatewayId(mainPublicGateway.id())
.privateNetworkId(main.id())
.dhcpId(mainPublicGatewayDhcp.id())
.cleanupDhcp(true)
.enableMasquerade(true)
.build());
var mainPublicGatewayDhcpReservation = new PublicGatewayDhcpReservation("mainPublicGatewayDhcpReservation", PublicGatewayDhcpReservationArgs.builder()
.gatewayNetworkId(mainGatewayNetwork.id())
.macAddress(mainPrivateNic.macAddress())
.ipAddress("192.168.1.4")
.build());
//## VPC PAT RULE
var mainPublicGatewayPatRule = new PublicGatewayPatRule("mainPublicGatewayPatRule", PublicGatewayPatRuleArgs.builder()
.gatewayId(mainPublicGateway.id())
.privateIp(mainPublicGatewayDhcpReservation.ipAddress())
.privatePort(22)
.publicPort(2222)
.protocol("tcp")
.build());
final var byId = NetworkFunctions.getPublicGatewayDhcpReservation(GetPublicGatewayDhcpReservationArgs.builder()
.reservationId(mainPublicGatewayDhcpReservation.id())
.build());
}
}
resources:
main:
type: scaleway:network:PrivateNetwork
mainSecurityGroup:
type: scaleway:instance:SecurityGroup
name: main
properties:
inboundDefaultPolicy: drop
outboundDefaultPolicy: accept
inboundRules:
- action: accept
port: '22'
mainServer:
type: scaleway:instance:Server
name: main
properties:
image: ubuntu_jammy
type: DEV1-S
zone: fr-par-1
securityGroupId: ${mainSecurityGroup.id}
mainPrivateNic:
type: scaleway:instance:PrivateNic
name: main
properties:
serverId: ${mainServer.id}
privateNetworkId: ${main.id}
mainPublicGatewayIp:
type: scaleway:network:PublicGatewayIp
name: main
mainPublicGatewayDhcp:
type: scaleway:network:PublicGatewayDhcp
name: main
properties:
subnet: 192.168.1.0/24
mainPublicGateway:
type: scaleway:network:PublicGateway
name: main
properties:
name: foobar
type: VPC-GW-S
ipId: ${mainPublicGatewayIp.id}
mainGatewayNetwork:
type: scaleway:network:GatewayNetwork
name: main
properties:
gatewayId: ${mainPublicGateway.id}
privateNetworkId: ${main.id}
dhcpId: ${mainPublicGatewayDhcp.id}
cleanupDhcp: true
enableMasquerade: true
mainPublicGatewayDhcpReservation:
type: scaleway:network:PublicGatewayDhcpReservation
name: main
properties:
gatewayNetworkId: ${mainGatewayNetwork.id}
macAddress: ${mainPrivateNic.macAddress}
ipAddress: 192.168.1.4
### VPC PAT RULE
mainPublicGatewayPatRule:
type: scaleway:network:PublicGatewayPatRule
name: main
properties:
gatewayId: ${mainPublicGateway.id}
privateIp: ${mainPublicGatewayDhcpReservation.ipAddress}
privatePort: 22
publicPort: 2222
protocol: tcp
variables:
byId:
fn::invoke:
function: scaleway:network:getPublicGatewayDhcpReservation
arguments:
reservationId: ${mainPublicGatewayDhcpReservation.id}
Using getVpcPublicGatewayDhcpReservation
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 getVpcPublicGatewayDhcpReservation(args: GetVpcPublicGatewayDhcpReservationArgs, opts?: InvokeOptions): Promise<GetVpcPublicGatewayDhcpReservationResult>
function getVpcPublicGatewayDhcpReservationOutput(args: GetVpcPublicGatewayDhcpReservationOutputArgs, opts?: InvokeOptions): Output<GetVpcPublicGatewayDhcpReservationResult>
def get_vpc_public_gateway_dhcp_reservation(gateway_network_id: Optional[str] = None,
mac_address: Optional[str] = None,
reservation_id: Optional[str] = None,
wait_for_dhcp: Optional[bool] = None,
zone: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVpcPublicGatewayDhcpReservationResult
def get_vpc_public_gateway_dhcp_reservation_output(gateway_network_id: Optional[pulumi.Input[str]] = None,
mac_address: Optional[pulumi.Input[str]] = None,
reservation_id: Optional[pulumi.Input[str]] = None,
wait_for_dhcp: Optional[pulumi.Input[bool]] = None,
zone: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVpcPublicGatewayDhcpReservationResult]
func LookupVpcPublicGatewayDhcpReservation(ctx *Context, args *LookupVpcPublicGatewayDhcpReservationArgs, opts ...InvokeOption) (*LookupVpcPublicGatewayDhcpReservationResult, error)
func LookupVpcPublicGatewayDhcpReservationOutput(ctx *Context, args *LookupVpcPublicGatewayDhcpReservationOutputArgs, opts ...InvokeOption) LookupVpcPublicGatewayDhcpReservationResultOutput
> Note: This function is named LookupVpcPublicGatewayDhcpReservation
in the Go SDK.
public static class GetVpcPublicGatewayDhcpReservation
{
public static Task<GetVpcPublicGatewayDhcpReservationResult> InvokeAsync(GetVpcPublicGatewayDhcpReservationArgs args, InvokeOptions? opts = null)
public static Output<GetVpcPublicGatewayDhcpReservationResult> Invoke(GetVpcPublicGatewayDhcpReservationInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVpcPublicGatewayDhcpReservationResult> getVpcPublicGatewayDhcpReservation(GetVpcPublicGatewayDhcpReservationArgs args, InvokeOptions options)
public static Output<GetVpcPublicGatewayDhcpReservationResult> getVpcPublicGatewayDhcpReservation(GetVpcPublicGatewayDhcpReservationArgs args, InvokeOptions options)
fn::invoke:
function: scaleway:index/getVpcPublicGatewayDhcpReservation:getVpcPublicGatewayDhcpReservation
arguments:
# arguments dictionary
The following arguments are supported:
- Gateway
Network stringId The ID of the owning GatewayNetwork.
Only one of
reservation_id
ormac_address
withgateway_network_id
should be specified.- Mac
Address string - The MAC address of the reservation to retrieve.
- Reservation
Id string - The ID of the reservation (DHCP entry) to retrieve.
- Wait
For boolDhcp - Whether to wait for
mac_address
to exist in DHCP. - Zone string
zone
). The zone in which the reservation exists.
- Gateway
Network stringId The ID of the owning GatewayNetwork.
Only one of
reservation_id
ormac_address
withgateway_network_id
should be specified.- Mac
Address string - The MAC address of the reservation to retrieve.
- Reservation
Id string - The ID of the reservation (DHCP entry) to retrieve.
- Wait
For boolDhcp - Whether to wait for
mac_address
to exist in DHCP. - Zone string
zone
). The zone in which the reservation exists.
- gateway
Network StringId The ID of the owning GatewayNetwork.
Only one of
reservation_id
ormac_address
withgateway_network_id
should be specified.- mac
Address String - The MAC address of the reservation to retrieve.
- reservation
Id String - The ID of the reservation (DHCP entry) to retrieve.
- wait
For BooleanDhcp - Whether to wait for
mac_address
to exist in DHCP. - zone String
zone
). The zone in which the reservation exists.
- gateway
Network stringId The ID of the owning GatewayNetwork.
Only one of
reservation_id
ormac_address
withgateway_network_id
should be specified.- mac
Address string - The MAC address of the reservation to retrieve.
- reservation
Id string - The ID of the reservation (DHCP entry) to retrieve.
- wait
For booleanDhcp - Whether to wait for
mac_address
to exist in DHCP. - zone string
zone
). The zone in which the reservation exists.
- gateway_
network_ strid The ID of the owning GatewayNetwork.
Only one of
reservation_id
ormac_address
withgateway_network_id
should be specified.- mac_
address str - The MAC address of the reservation to retrieve.
- reservation_
id str - The ID of the reservation (DHCP entry) to retrieve.
- wait_
for_ booldhcp - Whether to wait for
mac_address
to exist in DHCP. - zone str
zone
). The zone in which the reservation exists.
- gateway
Network StringId The ID of the owning GatewayNetwork.
Only one of
reservation_id
ormac_address
withgateway_network_id
should be specified.- mac
Address String - The MAC address of the reservation to retrieve.
- reservation
Id String - The ID of the reservation (DHCP entry) to retrieve.
- wait
For BooleanDhcp - Whether to wait for
mac_address
to exist in DHCP. - zone String
zone
). The zone in which the reservation exists.
getVpcPublicGatewayDhcpReservation Result
The following output properties are available:
- Created
At string - Hostname string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ip
Address string - Type string
- Updated
At string - Gateway
Network stringId - Mac
Address string - Reservation
Id string - Wait
For boolDhcp - Zone string
- Created
At string - Hostname string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ip
Address string - Type string
- Updated
At string - Gateway
Network stringId - Mac
Address string - Reservation
Id string - Wait
For boolDhcp - Zone string
- created
At String - hostname String
- id String
- The provider-assigned unique ID for this managed resource.
- ip
Address String - type String
- updated
At String - gateway
Network StringId - mac
Address String - reservation
Id String - wait
For BooleanDhcp - zone String
- created
At string - hostname string
- id string
- The provider-assigned unique ID for this managed resource.
- ip
Address string - type string
- updated
At string - gateway
Network stringId - mac
Address string - reservation
Id string - wait
For booleanDhcp - zone string
- created_
at str - hostname str
- id str
- The provider-assigned unique ID for this managed resource.
- ip_
address str - type str
- updated_
at str - gateway_
network_ strid - mac_
address str - reservation_
id str - wait_
for_ booldhcp - zone str
- created
At String - hostname String
- id String
- The provider-assigned unique ID for this managed resource.
- ip
Address String - type String
- updated
At String - gateway
Network StringId - mac
Address String - reservation
Id String - wait
For BooleanDhcp - zone String
Package Details
- Repository
- scaleway pulumiverse/pulumi-scaleway
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scaleway
Terraform Provider.