UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

263 lines 11.8 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getVpcPublicGatewayDhcpReservationOutput = exports.getVpcPublicGatewayDhcpReservation = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * > **Important:** The data source `scaleway.network.PublicGatewayDhcpReservation` has been deprecated and will no longer be supported. * In 2023, DHCP functionality was moved from Public Gateways to Private Networks, DHCP resources are now no longer needed. * You can use IPAM to manage your IPs. For more information, please refer to the dedicated guide. * * Gets information about a DHCP entry. For further information, please see the * [API documentation](https://www.scaleway.com/en/developers/api/public-gateway/#path-dhcp-entries-list-dhcp-entries). * * ## Example Dynamic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * 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, * }); * ``` * * ## Example Static and PAT Rule * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * 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, * }); * ``` */ /** @deprecated scaleway.index/getvpcpublicgatewaydhcpreservation.getVpcPublicGatewayDhcpReservation has been deprecated in favor of scaleway.network/getpublicgatewaydhcpreservation.getPublicGatewayDhcpReservation */ function getVpcPublicGatewayDhcpReservation(args, opts) { pulumi.log.warn("getVpcPublicGatewayDhcpReservation is deprecated: scaleway.index/getvpcpublicgatewaydhcpreservation.getVpcPublicGatewayDhcpReservation has been deprecated in favor of scaleway.network/getpublicgatewaydhcpreservation.getPublicGatewayDhcpReservation"); args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("scaleway:index/getVpcPublicGatewayDhcpReservation:getVpcPublicGatewayDhcpReservation", { "gatewayNetworkId": args.gatewayNetworkId, "macAddress": args.macAddress, "reservationId": args.reservationId, "waitForDhcp": args.waitForDhcp, "zone": args.zone, }, opts); } exports.getVpcPublicGatewayDhcpReservation = getVpcPublicGatewayDhcpReservation; /** * > **Important:** The data source `scaleway.network.PublicGatewayDhcpReservation` has been deprecated and will no longer be supported. * In 2023, DHCP functionality was moved from Public Gateways to Private Networks, DHCP resources are now no longer needed. * You can use IPAM to manage your IPs. For more information, please refer to the dedicated guide. * * Gets information about a DHCP entry. For further information, please see the * [API documentation](https://www.scaleway.com/en/developers/api/public-gateway/#path-dhcp-entries-list-dhcp-entries). * * ## Example Dynamic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * 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, * }); * ``` * * ## Example Static and PAT Rule * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * 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, * }); * ``` */ /** @deprecated scaleway.index/getvpcpublicgatewaydhcpreservation.getVpcPublicGatewayDhcpReservation has been deprecated in favor of scaleway.network/getpublicgatewaydhcpreservation.getPublicGatewayDhcpReservation */ function getVpcPublicGatewayDhcpReservationOutput(args, opts) { pulumi.log.warn("getVpcPublicGatewayDhcpReservation is deprecated: scaleway.index/getvpcpublicgatewaydhcpreservation.getVpcPublicGatewayDhcpReservation has been deprecated in favor of scaleway.network/getpublicgatewaydhcpreservation.getPublicGatewayDhcpReservation"); args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("scaleway:index/getVpcPublicGatewayDhcpReservation:getVpcPublicGatewayDhcpReservation", { "gatewayNetworkId": args.gatewayNetworkId, "macAddress": args.macAddress, "reservationId": args.reservationId, "waitForDhcp": args.waitForDhcp, "zone": args.zone, }, opts); } exports.getVpcPublicGatewayDhcpReservationOutput = getVpcPublicGatewayDhcpReservationOutput; //# sourceMappingURL=getVpcPublicGatewayDhcpReservation.js.map