UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

198 lines 6.08 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getIpOutput = exports.getIp = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Gets information about IP addresses managed by Scaleway's IP Address Management (IPAM) service. IPAM is used for the DHCP bundled with VPC Private Networks. * * For more information about IPAM, see the main [documentation](https://www.scaleway.com/en/docs/vpc/concepts/#ipam). * * ## Examples * * ### IPAM IP ID * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumi/scaleway"; * * // Get info by ipam ip id * const byId = scaleway.ipam.getIp({ * ipamIpId: "11111111-1111-1111-1111-111111111111", * }); * ``` * * ### Instance Private Network IP * * Get an Instance's IP on a Private Network. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumi/scaleway"; * import * as scaleway from "@pulumiverse/scaleway"; * * // Connect your instance to a private network using a private nic. * const nic = new scaleway.instance.PrivateNic("nic", { * serverId: server.id, * privateNetworkId: pn.id, * }); * // Find server private IPv4 using private-nic mac address * const byMac = scaleway.ipam.getIpOutput({ * macAddress: nic.macAddress, * type: "ipv4", * }); * // Find server private IPv4 using private-nic id * const byId = scaleway.ipam.getIpOutput({ * resource: { * id: nic.id, * type: "instance_private_nic", * }, * type: "ipv4", * }); * ``` * * ### RDB instance * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumi/scaleway"; * import * as scaleway from "@pulumiverse/scaleway"; * * // Find the private IPv4 using resource name * const pn = new scaleway.network.PrivateNetwork("pn", {}); * const main = new scaleway.databases.Instance("main", { * name: "test-rdb", * nodeType: "DB-DEV-S", * engine: "PostgreSQL-15", * isHaCluster: true, * disableBackup: true, * userName: "my_initial_user", * password: "thiZ_is_v&ry_s3cret", * privateNetwork: { * pnId: pn.id, * }, * }); * const byName = scaleway.ipam.getIpOutput({ * resource: { * name: main.name, * type: "rdb_instance", * }, * type: "ipv4", * }); * ``` */ function getIp(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("scaleway:ipam/getIp:getIp", { "attached": args.attached, "ipamIpId": args.ipamIpId, "macAddress": args.macAddress, "privateNetworkId": args.privateNetworkId, "projectId": args.projectId, "region": args.region, "resource": args.resource, "tags": args.tags, "type": args.type, "zonal": args.zonal, }, opts); } exports.getIp = getIp; /** * Gets information about IP addresses managed by Scaleway's IP Address Management (IPAM) service. IPAM is used for the DHCP bundled with VPC Private Networks. * * For more information about IPAM, see the main [documentation](https://www.scaleway.com/en/docs/vpc/concepts/#ipam). * * ## Examples * * ### IPAM IP ID * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumi/scaleway"; * * // Get info by ipam ip id * const byId = scaleway.ipam.getIp({ * ipamIpId: "11111111-1111-1111-1111-111111111111", * }); * ``` * * ### Instance Private Network IP * * Get an Instance's IP on a Private Network. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumi/scaleway"; * import * as scaleway from "@pulumiverse/scaleway"; * * // Connect your instance to a private network using a private nic. * const nic = new scaleway.instance.PrivateNic("nic", { * serverId: server.id, * privateNetworkId: pn.id, * }); * // Find server private IPv4 using private-nic mac address * const byMac = scaleway.ipam.getIpOutput({ * macAddress: nic.macAddress, * type: "ipv4", * }); * // Find server private IPv4 using private-nic id * const byId = scaleway.ipam.getIpOutput({ * resource: { * id: nic.id, * type: "instance_private_nic", * }, * type: "ipv4", * }); * ``` * * ### RDB instance * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumi/scaleway"; * import * as scaleway from "@pulumiverse/scaleway"; * * // Find the private IPv4 using resource name * const pn = new scaleway.network.PrivateNetwork("pn", {}); * const main = new scaleway.databases.Instance("main", { * name: "test-rdb", * nodeType: "DB-DEV-S", * engine: "PostgreSQL-15", * isHaCluster: true, * disableBackup: true, * userName: "my_initial_user", * password: "thiZ_is_v&ry_s3cret", * privateNetwork: { * pnId: pn.id, * }, * }); * const byName = scaleway.ipam.getIpOutput({ * resource: { * name: main.name, * type: "rdb_instance", * }, * type: "ipv4", * }); * ``` */ function getIpOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("scaleway:ipam/getIp:getIp", { "attached": args.attached, "ipamIpId": args.ipamIpId, "macAddress": args.macAddress, "privateNetworkId": args.privateNetworkId, "projectId": args.projectId, "region": args.region, "resource": args.resource, "tags": args.tags, "type": args.type, "zonal": args.zonal, }, opts); } exports.getIpOutput = getIpOutput; //# sourceMappingURL=getIp.js.map