UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

285 lines (284 loc) 10.8 kB
import * as pulumi from "@pulumi/pulumi"; /** * > **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 "@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, * }); * ``` * * ## Example Static and PAT Rule * * ```typescript * 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, * }); * ``` */ export declare function getPublicGatewayDhcpReservation(args?: GetPublicGatewayDhcpReservationArgs, opts?: pulumi.InvokeOptions): Promise<GetPublicGatewayDhcpReservationResult>; /** * A collection of arguments for invoking getPublicGatewayDhcpReservation. */ export interface GetPublicGatewayDhcpReservationArgs { /** * The ID of the owning GatewayNetwork. * * > Only one of `reservationId` or `macAddress` with `gatewayNetworkId` should be specified. */ gatewayNetworkId?: string; /** * The MAC address of the reservation to retrieve. */ macAddress?: string; /** * The ID of the reservation (DHCP entry) to retrieve. */ reservationId?: string; /** * Whether to wait for `macAddress` to exist in DHCP. */ waitForDhcp?: boolean; /** * `zone`). The zone in which the reservation exists. */ zone?: string; } /** * A collection of values returned by getPublicGatewayDhcpReservation. */ export interface GetPublicGatewayDhcpReservationResult { readonly createdAt: string; readonly gatewayNetworkId?: string; readonly hostname: string; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly ipAddress: string; readonly macAddress?: string; readonly reservationId?: string; readonly type: string; readonly updatedAt: string; readonly waitForDhcp?: boolean; readonly zone?: string; } /** * > **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 "@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, * }); * ``` * * ## Example Static and PAT Rule * * ```typescript * 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, * }); * ``` */ export declare function getPublicGatewayDhcpReservationOutput(args?: GetPublicGatewayDhcpReservationOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetPublicGatewayDhcpReservationResult>; /** * A collection of arguments for invoking getPublicGatewayDhcpReservation. */ export interface GetPublicGatewayDhcpReservationOutputArgs { /** * The ID of the owning GatewayNetwork. * * > Only one of `reservationId` or `macAddress` with `gatewayNetworkId` should be specified. */ gatewayNetworkId?: pulumi.Input<string>; /** * The MAC address of the reservation to retrieve. */ macAddress?: pulumi.Input<string>; /** * The ID of the reservation (DHCP entry) to retrieve. */ reservationId?: pulumi.Input<string>; /** * Whether to wait for `macAddress` to exist in DHCP. */ waitForDhcp?: pulumi.Input<boolean>; /** * `zone`). The zone in which the reservation exists. */ zone?: pulumi.Input<string>; }