UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

180 lines 6.84 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.IpamIp = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Books and manages IPAM IPs. * * For more information about IPAM, see the main [documentation](https://www.scaleway.com/en/docs/vpc/concepts/#ipam). * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const vpc01 = new scaleway.network.Vpc("vpc01", {name: "my vpc"}); * const pn01 = new scaleway.network.PrivateNetwork("pn01", { * vpcId: vpc01.id, * ipv4Subnet: { * subnet: "172.16.32.0/22", * }, * }); * const ip01 = new scaleway.ipam.Ip("ip01", {sources: [{ * privateNetworkId: pn01.id, * }]}); * ``` * * ### Request a specific IPv4 address * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const vpc01 = new scaleway.network.Vpc("vpc01", {name: "my vpc"}); * const pn01 = new scaleway.network.PrivateNetwork("pn01", { * vpcId: vpc01.id, * ipv4Subnet: { * subnet: "172.16.32.0/22", * }, * }); * const ip01 = new scaleway.ipam.Ip("ip01", { * address: "172.16.32.7", * sources: [{ * privateNetworkId: pn01.id, * }], * }); * ``` * * ### Request an IPv6 address * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const vpc01 = new scaleway.network.Vpc("vpc01", {name: "my vpc"}); * const pn01 = new scaleway.network.PrivateNetwork("pn01", { * vpcId: vpc01.id, * ipv6Subnets: [{ * subnet: "fd46:78ab:30b8:177c::/64", * }], * }); * const ip01 = new scaleway.ipam.Ip("ip01", { * isIpv6: true, * sources: [{ * privateNetworkId: pn01.id, * }], * }); * ``` * * ### Book an IP for a custom resource * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const vpc01 = new scaleway.network.Vpc("vpc01", {name: "my vpc"}); * const pn01 = new scaleway.network.PrivateNetwork("pn01", { * vpcId: vpc01.id, * ipv4Subnet: { * subnet: "172.16.32.0/22", * }, * }); * const ip01 = new scaleway.ipam.Ip("ip01", { * address: "172.16.32.7", * sources: [{ * privateNetworkId: pn01.id, * }], * customResources: [{ * macAddress: "bc:24:11:74:d0:6a", * }], * }); * ``` * * ## Import * * IPAM IPs can be imported using `{region}/{id}`, e.g. * * bash * * ```sh * $ pulumi import scaleway:index/ipamIp:IpamIp ip_demo fr-par/11111111-1111-1111-1111-111111111111 * ``` * * @deprecated scaleway.index/ipamip.IpamIp has been deprecated in favor of scaleway.ipam/ip.Ip */ class IpamIp extends pulumi.CustomResource { /** * Get an existing IpamIp resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { pulumi.log.warn("IpamIp is deprecated: scaleway.index/ipamip.IpamIp has been deprecated in favor of scaleway.ipam/ip.Ip"); return new IpamIp(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of IpamIp. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === IpamIp.__pulumiType; } /** @deprecated scaleway.index/ipamip.IpamIp has been deprecated in favor of scaleway.ipam/ip.Ip */ constructor(name, argsOrState, opts) { pulumi.log.warn("IpamIp is deprecated: scaleway.index/ipamip.IpamIp has been deprecated in favor of scaleway.ipam/ip.Ip"); let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["address"] = state ? state.address : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["customResources"] = state ? state.customResources : undefined; resourceInputs["isIpv6"] = state ? state.isIpv6 : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["resources"] = state ? state.resources : undefined; resourceInputs["reverses"] = state ? state.reverses : undefined; resourceInputs["sources"] = state ? state.sources : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; resourceInputs["zone"] = state ? state.zone : undefined; } else { const args = argsOrState; if ((!args || args.sources === undefined) && !opts.urn) { throw new Error("Missing required property 'sources'"); } resourceInputs["address"] = args ? args.address : undefined; resourceInputs["customResources"] = args ? args.customResources : undefined; resourceInputs["isIpv6"] = args ? args.isIpv6 : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["sources"] = args ? args.sources : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["resources"] = undefined /*out*/; resourceInputs["reverses"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; resourceInputs["zone"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(IpamIp.__pulumiType, name, resourceInputs, opts); } } exports.IpamIp = IpamIp; /** @internal */ IpamIp.__pulumiType = 'scaleway:index/ipamIp:IpamIp'; //# sourceMappingURL=ipamIp.js.map