1. Packages
  2. Ionoscloud
  3. API Docs
  4. compute
  5. IPBlock
IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud

ionoscloud.compute.IPBlock

Explore with Pulumi AI

ionoscloud logo
IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud

    Manages IP Blocks on IonosCloud. IP Blocks contain reserved public IP addresses that can be assigned servers or other resources.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@ionos-cloud/sdk-pulumi";
    
    const example = new ionoscloud.compute.IPBlock("example", {
        location: "us/las",
        size: 1,
        name: "IP Block Example",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.compute.IPBlock("example",
        location="us/las",
        size=1,
        name="IP Block Example")
    
    package main
    
    import (
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewIPBlock(ctx, "example", &compute.IPBlockArgs{
    			Location: pulumi.String("us/las"),
    			Size:     pulumi.Int(1),
    			Name:     pulumi.String("IP Block Example"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Ionoscloud.Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Ionoscloud.Compute.IPBlock("example", new()
        {
            Location = "us/las",
            Size = 1,
            Name = "IP Block Example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.compute.IPBlock;
    import com.pulumi.ionoscloud.compute.IPBlockArgs;
    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) {
            var example = new IPBlock("example", IPBlockArgs.builder()
                .location("us/las")
                .size(1)
                .name("IP Block Example")
                .build());
    
        }
    }
    
    resources:
      example:
        type: ionoscloud:compute:IPBlock
        properties:
          location: us/las
          size: 1
          name: IP Block Example
    

    Create IPBlock Resource

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

    Constructor syntax

    new IPBlock(name: string, args: IPBlockArgs, opts?: CustomResourceOptions);
    @overload
    def IPBlock(resource_name: str,
                args: IPBlockArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def IPBlock(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                location: Optional[str] = None,
                size: Optional[int] = None,
                ip_consumers: Optional[Sequence[IPBlockIpConsumerArgs]] = None,
                name: Optional[str] = None)
    func NewIPBlock(ctx *Context, name string, args IPBlockArgs, opts ...ResourceOption) (*IPBlock, error)
    public IPBlock(string name, IPBlockArgs args, CustomResourceOptions? opts = null)
    public IPBlock(String name, IPBlockArgs args)
    public IPBlock(String name, IPBlockArgs args, CustomResourceOptions options)
    
    type: ionoscloud:compute:IPBlock
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args IPBlockArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args IPBlockArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args IPBlockArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IPBlockArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IPBlockArgs
    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 ipblockResource = new Ionoscloud.Compute.IPBlock("ipblockResource", new()
    {
        Location = "string",
        Size = 0,
        IpConsumers = new[]
        {
            new Ionoscloud.Compute.Inputs.IPBlockIpConsumerArgs
            {
                DatacenterId = "string",
                DatacenterName = "string",
                Ip = "string",
                K8sClusterUuid = "string",
                K8sNodepoolUuid = "string",
                Mac = "string",
                NicId = "string",
                ServerId = "string",
                ServerName = "string",
            },
        },
        Name = "string",
    });
    
    example, err := compute.NewIPBlock(ctx, "ipblockResource", &compute.IPBlockArgs{
    	Location: pulumi.String("string"),
    	Size:     pulumi.Int(0),
    	IpConsumers: compute.IPBlockIpConsumerArray{
    		&compute.IPBlockIpConsumerArgs{
    			DatacenterId:    pulumi.String("string"),
    			DatacenterName:  pulumi.String("string"),
    			Ip:              pulumi.String("string"),
    			K8sClusterUuid:  pulumi.String("string"),
    			K8sNodepoolUuid: pulumi.String("string"),
    			Mac:             pulumi.String("string"),
    			NicId:           pulumi.String("string"),
    			ServerId:        pulumi.String("string"),
    			ServerName:      pulumi.String("string"),
    		},
    	},
    	Name: pulumi.String("string"),
    })
    
    var ipblockResource = new IPBlock("ipblockResource", IPBlockArgs.builder()
        .location("string")
        .size(0)
        .ipConsumers(IPBlockIpConsumerArgs.builder()
            .datacenterId("string")
            .datacenterName("string")
            .ip("string")
            .k8sClusterUuid("string")
            .k8sNodepoolUuid("string")
            .mac("string")
            .nicId("string")
            .serverId("string")
            .serverName("string")
            .build())
        .name("string")
        .build());
    
    ipblock_resource = ionoscloud.compute.IPBlock("ipblockResource",
        location="string",
        size=0,
        ip_consumers=[{
            "datacenter_id": "string",
            "datacenter_name": "string",
            "ip": "string",
            "k8s_cluster_uuid": "string",
            "k8s_nodepool_uuid": "string",
            "mac": "string",
            "nic_id": "string",
            "server_id": "string",
            "server_name": "string",
        }],
        name="string")
    
    const ipblockResource = new ionoscloud.compute.IPBlock("ipblockResource", {
        location: "string",
        size: 0,
        ipConsumers: [{
            datacenterId: "string",
            datacenterName: "string",
            ip: "string",
            k8sClusterUuid: "string",
            k8sNodepoolUuid: "string",
            mac: "string",
            nicId: "string",
            serverId: "string",
            serverName: "string",
        }],
        name: "string",
    });
    
    type: ionoscloud:compute:IPBlock
    properties:
        ipConsumers:
            - datacenterId: string
              datacenterName: string
              ip: string
              k8sClusterUuid: string
              k8sNodepoolUuid: string
              mac: string
              nicId: string
              serverId: string
              serverName: string
        location: string
        name: string
        size: 0
    

    IPBlock 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 IPBlock resource accepts the following input properties:

    Location string
    [string] The regional location for this IP Block: us/las, us/ewr, de/fra, de/fkb.
    Size int
    [integer] The number of IP addresses to reserve for this block.
    IpConsumers List<Ionoscloud.IPBlockIpConsumer>
    Read-Only attribute. Lists consumption detail of an individual ip
    Name string
    [string] The name of Ip Block
    Location string
    [string] The regional location for this IP Block: us/las, us/ewr, de/fra, de/fkb.
    Size int
    [integer] The number of IP addresses to reserve for this block.
    IpConsumers []IPBlockIpConsumerArgs
    Read-Only attribute. Lists consumption detail of an individual ip
    Name string
    [string] The name of Ip Block
    location String
    [string] The regional location for this IP Block: us/las, us/ewr, de/fra, de/fkb.
    size Integer
    [integer] The number of IP addresses to reserve for this block.
    ipConsumers List<IPBlockIpConsumer>
    Read-Only attribute. Lists consumption detail of an individual ip
    name String
    [string] The name of Ip Block
    location string
    [string] The regional location for this IP Block: us/las, us/ewr, de/fra, de/fkb.
    size number
    [integer] The number of IP addresses to reserve for this block.
    ipConsumers IPBlockIpConsumer[]
    Read-Only attribute. Lists consumption detail of an individual ip
    name string
    [string] The name of Ip Block
    location str
    [string] The regional location for this IP Block: us/las, us/ewr, de/fra, de/fkb.
    size int
    [integer] The number of IP addresses to reserve for this block.
    ip_consumers Sequence[IPBlockIpConsumerArgs]
    Read-Only attribute. Lists consumption detail of an individual ip
    name str
    [string] The name of Ip Block
    location String
    [string] The regional location for this IP Block: us/las, us/ewr, de/fra, de/fkb.
    size Number
    [integer] The number of IP addresses to reserve for this block.
    ipConsumers List<Property Map>
    Read-Only attribute. Lists consumption detail of an individual ip
    name String
    [string] The name of Ip Block

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Ips List<string>
    [integer] The list of IP addresses associated with this block.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ips []string
    [integer] The list of IP addresses associated with this block.
    id String
    The provider-assigned unique ID for this managed resource.
    ips List<String>
    [integer] The list of IP addresses associated with this block.
    id string
    The provider-assigned unique ID for this managed resource.
    ips string[]
    [integer] The list of IP addresses associated with this block.
    id str
    The provider-assigned unique ID for this managed resource.
    ips Sequence[str]
    [integer] The list of IP addresses associated with this block.
    id String
    The provider-assigned unique ID for this managed resource.
    ips List<String>
    [integer] The list of IP addresses associated with this block.

    Look up Existing IPBlock Resource

    Get an existing IPBlock 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?: IPBlockState, opts?: CustomResourceOptions): IPBlock
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            ip_consumers: Optional[Sequence[IPBlockIpConsumerArgs]] = None,
            ips: Optional[Sequence[str]] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            size: Optional[int] = None) -> IPBlock
    func GetIPBlock(ctx *Context, name string, id IDInput, state *IPBlockState, opts ...ResourceOption) (*IPBlock, error)
    public static IPBlock Get(string name, Input<string> id, IPBlockState? state, CustomResourceOptions? opts = null)
    public static IPBlock get(String name, Output<String> id, IPBlockState state, CustomResourceOptions options)
    resources:  _:    type: ionoscloud:compute:IPBlock    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    IpConsumers List<Ionoscloud.IPBlockIpConsumer>
    Read-Only attribute. Lists consumption detail of an individual ip
    Ips List<string>
    [integer] The list of IP addresses associated with this block.
    Location string
    [string] The regional location for this IP Block: us/las, us/ewr, de/fra, de/fkb.
    Name string
    [string] The name of Ip Block
    Size int
    [integer] The number of IP addresses to reserve for this block.
    IpConsumers []IPBlockIpConsumerArgs
    Read-Only attribute. Lists consumption detail of an individual ip
    Ips []string
    [integer] The list of IP addresses associated with this block.
    Location string
    [string] The regional location for this IP Block: us/las, us/ewr, de/fra, de/fkb.
    Name string
    [string] The name of Ip Block
    Size int
    [integer] The number of IP addresses to reserve for this block.
    ipConsumers List<IPBlockIpConsumer>
    Read-Only attribute. Lists consumption detail of an individual ip
    ips List<String>
    [integer] The list of IP addresses associated with this block.
    location String
    [string] The regional location for this IP Block: us/las, us/ewr, de/fra, de/fkb.
    name String
    [string] The name of Ip Block
    size Integer
    [integer] The number of IP addresses to reserve for this block.
    ipConsumers IPBlockIpConsumer[]
    Read-Only attribute. Lists consumption detail of an individual ip
    ips string[]
    [integer] The list of IP addresses associated with this block.
    location string
    [string] The regional location for this IP Block: us/las, us/ewr, de/fra, de/fkb.
    name string
    [string] The name of Ip Block
    size number
    [integer] The number of IP addresses to reserve for this block.
    ip_consumers Sequence[IPBlockIpConsumerArgs]
    Read-Only attribute. Lists consumption detail of an individual ip
    ips Sequence[str]
    [integer] The list of IP addresses associated with this block.
    location str
    [string] The regional location for this IP Block: us/las, us/ewr, de/fra, de/fkb.
    name str
    [string] The name of Ip Block
    size int
    [integer] The number of IP addresses to reserve for this block.
    ipConsumers List<Property Map>
    Read-Only attribute. Lists consumption detail of an individual ip
    ips List<String>
    [integer] The list of IP addresses associated with this block.
    location String
    [string] The regional location for this IP Block: us/las, us/ewr, de/fra, de/fkb.
    name String
    [string] The name of Ip Block
    size Number
    [integer] The number of IP addresses to reserve for this block.

    Supporting Types

    IPBlockIpConsumer, IPBlockIpConsumerArgs

    DatacenterId string
    DatacenterName string
    Ip string
    K8sClusterUuid string
    K8sNodepoolUuid string
    Mac string
    NicId string
    ServerId string
    ServerName string
    DatacenterId string
    DatacenterName string
    Ip string
    K8sClusterUuid string
    K8sNodepoolUuid string
    Mac string
    NicId string
    ServerId string
    ServerName string
    datacenterId String
    datacenterName String
    ip String
    k8sClusterUuid String
    k8sNodepoolUuid String
    mac String
    nicId String
    serverId String
    serverName String
    datacenterId string
    datacenterName string
    ip string
    k8sClusterUuid string
    k8sNodepoolUuid string
    mac string
    nicId string
    serverId string
    serverName string
    datacenterId String
    datacenterName String
    ip String
    k8sClusterUuid String
    k8sNodepoolUuid String
    mac String
    nicId String
    serverId String
    serverName String

    Import

    Resource Ipblock can be imported using the resource id, e.g.

    $ pulumi import ionoscloud:compute/iPBlock:IPBlock myipblock ipblock uuid
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    ionoscloud ionos-cloud/pulumi-ionoscloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud