@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
284 lines (283 loc) • 8.62 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* 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",
* });
* ```
*/
export declare function getIp(args?: GetIpArgs, opts?: pulumi.InvokeOptions): Promise<GetIpResult>;
/**
* A collection of arguments for invoking getIp.
*/
export interface GetIpArgs {
/**
* Defines whether to filter only for IPs which are attached to a resource. Cannot be used with `ipamIpId`.
*/
attached?: boolean;
/**
* The IPAM IP ID. Cannot be used with any other arguments.
*/
ipamIpId?: string;
/**
* The MAC address linked to the IP. Cannot be used with `ipamIpId`.
*/
macAddress?: string;
/**
* The ID of the Private Network the IP belongs to. Cannot be used with `ipamIpId`.
*/
privateNetworkId?: string;
/**
* `projectId`) The ID of the Project the IP is associated with.
*/
projectId?: string;
/**
* `region`) The region in which the IP exists.
*/
region?: string;
/**
* Filter by resource ID, type or name. Cannot be used with `ipamIpId`.
* If specified, `type` is required, and at least one of `id` or `name` must be set.
*/
resource?: inputs.ipam.GetIpResource;
/**
* The tags associated with the IP. Cannot be used with `ipamIpId`.
* As datasource only returns one IP, the search with given tags must return only one result.
*/
tags?: string[];
/**
* The type of IP to search for (`ipv4` or `ipv6`). Cannot be used with `ipamIpId`.
*/
type?: string;
/**
* Only IPs that are zonal, and in this zone, will be returned.
*/
zonal?: string;
}
/**
* A collection of values returned by getIp.
*/
export interface GetIpResult {
/**
* The IP address.
*/
readonly address: string;
/**
* the IP address in CIDR notation.
*/
readonly addressCidr: string;
readonly attached?: boolean;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly ipamIpId?: string;
readonly macAddress?: string;
readonly organizationId: string;
readonly privateNetworkId?: string;
readonly projectId: string;
readonly region: string;
readonly resource?: outputs.ipam.GetIpResource;
readonly tags?: string[];
readonly type?: string;
readonly zonal: string;
}
/**
* 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",
* });
* ```
*/
export declare function getIpOutput(args?: GetIpOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetIpResult>;
/**
* A collection of arguments for invoking getIp.
*/
export interface GetIpOutputArgs {
/**
* Defines whether to filter only for IPs which are attached to a resource. Cannot be used with `ipamIpId`.
*/
attached?: pulumi.Input<boolean>;
/**
* The IPAM IP ID. Cannot be used with any other arguments.
*/
ipamIpId?: pulumi.Input<string>;
/**
* The MAC address linked to the IP. Cannot be used with `ipamIpId`.
*/
macAddress?: pulumi.Input<string>;
/**
* The ID of the Private Network the IP belongs to. Cannot be used with `ipamIpId`.
*/
privateNetworkId?: pulumi.Input<string>;
/**
* `projectId`) The ID of the Project the IP is associated with.
*/
projectId?: pulumi.Input<string>;
/**
* `region`) The region in which the IP exists.
*/
region?: pulumi.Input<string>;
/**
* Filter by resource ID, type or name. Cannot be used with `ipamIpId`.
* If specified, `type` is required, and at least one of `id` or `name` must be set.
*/
resource?: pulumi.Input<inputs.ipam.GetIpResourceArgs>;
/**
* The tags associated with the IP. Cannot be used with `ipamIpId`.
* As datasource only returns one IP, the search with given tags must return only one result.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The type of IP to search for (`ipv4` or `ipv6`). Cannot be used with `ipamIpId`.
*/
type?: pulumi.Input<string>;
/**
* Only IPs that are zonal, and in this zone, will be returned.
*/
zonal?: pulumi.Input<string>;
}