1. Packages
  2. Hpegl Provider
  3. API Docs
  4. MetalIp
hpegl 0.4.18 published on Friday, Apr 18, 2025 by hpe

hpegl.MetalIp

Explore with Pulumi AI

Provides an IP resource. This allows allocation, deallocation of IP addresses from IP Pool.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as hpegl from "@pulumi/hpegl";

const config = new pulumi.Config();
const location = config.get("location") || "USA:Texas:AUSL2";
const ipPoolId = config.requireObject("ipPoolId");
const ip = config.requireObject("ip");
const ipMetalIp = new hpegl.MetalIp("ipMetalIp", {
    ipPoolId: ipPoolId,
    ip: ip,
    usage: "Usage for ip",
});
Copy
import pulumi
import pulumi_hpegl as hpegl

config = pulumi.Config()
location = config.get("location")
if location is None:
    location = "USA:Texas:AUSL2"
ip_pool_id = config.require_object("ipPoolId")
ip = config.require_object("ip")
ip_metal_ip = hpegl.MetalIp("ipMetalIp",
    ip_pool_id=ip_pool_id,
    ip=ip,
    usage="Usage for ip")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/hpegl/hpegl"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		location := "USA:Texas:AUSL2"
		if param := cfg.Get("location"); param != "" {
			location = param
		}
		ipPoolId := cfg.RequireObject("ipPoolId")
		ip := cfg.RequireObject("ip")
		_, err := hpegl.NewMetalIp(ctx, "ipMetalIp", &hpegl.MetalIpArgs{
			IpPoolId: pulumi.Any(ipPoolId),
			Ip:       pulumi.Any(ip),
			Usage:    pulumi.String("Usage for ip"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Hpegl = Pulumi.Hpegl;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var location = config.Get("location") ?? "USA:Texas:AUSL2";
    var ipPoolId = config.RequireObject<dynamic>("ipPoolId");
    var ip = config.RequireObject<dynamic>("ip");
    var ipMetalIp = new Hpegl.MetalIp("ipMetalIp", new()
    {
        IpPoolId = ipPoolId,
        Ip = ip,
        Usage = "Usage for ip",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hpegl.MetalIp;
import com.pulumi.hpegl.MetalIpArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var config = ctx.config();
        final var location = config.get("location").orElse("USA:Texas:AUSL2");
        final var ipPoolId = config.get("ipPoolId");
        final var ip = config.get("ip");
        var ipMetalIp = new MetalIp("ipMetalIp", MetalIpArgs.builder()
            .ipPoolId(ipPoolId)
            .ip(ip)
            .usage("Usage for ip")
            .build());

    }
}
Copy
configuration:
  # (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
  location:
    type: string
    default: USA:Texas:AUSL2
  ipPoolId:
    type: dynamic
  ip:
    type: dynamic
resources:
  ipMetalIp:
    type: hpegl:MetalIp
    properties:
      ipPoolId: ${ipPoolId}
      ip: ${ip}
      usage: Usage for ip
Copy

Create MetalIp Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new MetalIp(name: string, args: MetalIpArgs, opts?: CustomResourceOptions);
@overload
def MetalIp(resource_name: str,
            args: MetalIpArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def MetalIp(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            ip: Optional[str] = None,
            ip_pool_id: Optional[str] = None,
            usage: Optional[str] = None,
            metal_ip_id: Optional[str] = None)
func NewMetalIp(ctx *Context, name string, args MetalIpArgs, opts ...ResourceOption) (*MetalIp, error)
public MetalIp(string name, MetalIpArgs args, CustomResourceOptions? opts = null)
public MetalIp(String name, MetalIpArgs args)
public MetalIp(String name, MetalIpArgs args, CustomResourceOptions options)
type: hpegl:MetalIp
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. MetalIpArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. MetalIpArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. MetalIpArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. MetalIpArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. MetalIpArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var metalIpResource = new Hpegl.MetalIp("metalIpResource", new()
{
    Ip = "string",
    IpPoolId = "string",
    Usage = "string",
    MetalIpId = "string",
});
Copy
example, err := hpegl.NewMetalIp(ctx, "metalIpResource", &hpegl.MetalIpArgs{
	Ip:        pulumi.String("string"),
	IpPoolId:  pulumi.String("string"),
	Usage:     pulumi.String("string"),
	MetalIpId: pulumi.String("string"),
})
Copy
var metalIpResource = new MetalIp("metalIpResource", MetalIpArgs.builder()
    .ip("string")
    .ipPoolId("string")
    .usage("string")
    .metalIpId("string")
    .build());
Copy
metal_ip_resource = hpegl.MetalIp("metalIpResource",
    ip="string",
    ip_pool_id="string",
    usage="string",
    metal_ip_id="string")
Copy
const metalIpResource = new hpegl.MetalIp("metalIpResource", {
    ip: "string",
    ipPoolId: "string",
    usage: "string",
    metalIpId: "string",
});
Copy
type: hpegl:MetalIp
properties:
    ip: string
    ipPoolId: string
    metalIpId: string
    usage: string
Copy

MetalIp Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The MetalIp resource accepts the following input properties:

Ip This property is required. string
IP address to be allocated
IpPoolId This property is required. string
IP pool ID from which the address will be allocated
Usage This property is required. string
Describe usage for the allocated IP
MetalIpId string
The ID of this resource.
Ip This property is required. string
IP address to be allocated
IpPoolId This property is required. string
IP pool ID from which the address will be allocated
Usage This property is required. string
Describe usage for the allocated IP
MetalIpId string
The ID of this resource.
ip This property is required. String
IP address to be allocated
ipPoolId This property is required. String
IP pool ID from which the address will be allocated
usage This property is required. String
Describe usage for the allocated IP
metalIpId String
The ID of this resource.
ip This property is required. string
IP address to be allocated
ipPoolId This property is required. string
IP pool ID from which the address will be allocated
usage This property is required. string
Describe usage for the allocated IP
metalIpId string
The ID of this resource.
ip This property is required. str
IP address to be allocated
ip_pool_id This property is required. str
IP pool ID from which the address will be allocated
usage This property is required. str
Describe usage for the allocated IP
metal_ip_id str
The ID of this resource.
ip This property is required. String
IP address to be allocated
ipPoolId This property is required. String
IP pool ID from which the address will be allocated
usage This property is required. String
Describe usage for the allocated IP
metalIpId String
The ID of this resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the MetalIp resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing MetalIp Resource

Get an existing MetalIp resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: MetalIpState, opts?: CustomResourceOptions): MetalIp
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        ip: Optional[str] = None,
        ip_pool_id: Optional[str] = None,
        metal_ip_id: Optional[str] = None,
        usage: Optional[str] = None) -> MetalIp
func GetMetalIp(ctx *Context, name string, id IDInput, state *MetalIpState, opts ...ResourceOption) (*MetalIp, error)
public static MetalIp Get(string name, Input<string> id, MetalIpState? state, CustomResourceOptions? opts = null)
public static MetalIp get(String name, Output<String> id, MetalIpState state, CustomResourceOptions options)
resources:  _:    type: hpegl:MetalIp    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Ip string
IP address to be allocated
IpPoolId string
IP pool ID from which the address will be allocated
MetalIpId string
The ID of this resource.
Usage string
Describe usage for the allocated IP
Ip string
IP address to be allocated
IpPoolId string
IP pool ID from which the address will be allocated
MetalIpId string
The ID of this resource.
Usage string
Describe usage for the allocated IP
ip String
IP address to be allocated
ipPoolId String
IP pool ID from which the address will be allocated
metalIpId String
The ID of this resource.
usage String
Describe usage for the allocated IP
ip string
IP address to be allocated
ipPoolId string
IP pool ID from which the address will be allocated
metalIpId string
The ID of this resource.
usage string
Describe usage for the allocated IP
ip str
IP address to be allocated
ip_pool_id str
IP pool ID from which the address will be allocated
metal_ip_id str
The ID of this resource.
usage str
Describe usage for the allocated IP
ip String
IP address to be allocated
ipPoolId String
IP pool ID from which the address will be allocated
metalIpId String
The ID of this resource.
usage String
Describe usage for the allocated IP

Package Details

Repository
hpegl hpe/terraform-provider-hpegl
License
Notes
This Pulumi package is based on the hpegl Terraform Provider.