1. Packages
  2. Civo Provider
  3. API Docs
  4. InstanceReservedIpAssignment
civo 1.1.5 published on Thursday, Feb 6, 2025 by civo

civo.InstanceReservedIpAssignment

Explore with Pulumi AI

The instance reserved ip assignment resource schema definition

Example Usage

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

// Send to create a reserved IP
const www = new civo.ReservedIp("www", {});
// We assign the reserved IP to the instance
const webserver_www = new civo.InstanceReservedIpAssignment("webserver-www", {
    instanceId: civo_instance.www.id,
    reservedIpId: civo_reserved_ip["web-server"].id,
});
Copy
import pulumi
import pulumi_civo as civo

# Send to create a reserved IP
www = civo.ReservedIp("www")
# We assign the reserved IP to the instance
webserver_www = civo.InstanceReservedIpAssignment("webserver-www",
    instance_id=civo_instance["www"]["id"],
    reserved_ip_id=civo_reserved_ip["web-server"]["id"])
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Send to create a reserved IP
		_, err := civo.NewReservedIp(ctx, "www", nil)
		if err != nil {
			return err
		}
		// We assign the reserved IP to the instance
		_, err = civo.NewInstanceReservedIpAssignment(ctx, "webserver-www", &civo.InstanceReservedIpAssignmentArgs{
			InstanceId:   pulumi.Any(civo_instance.Www.Id),
			ReservedIpId: pulumi.Any(civo_reserved_ip.WebServer.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Civo = Pulumi.Civo;

return await Deployment.RunAsync(() => 
{
    // Send to create a reserved IP
    var www = new Civo.ReservedIp("www");

    // We assign the reserved IP to the instance
    var webserver_www = new Civo.InstanceReservedIpAssignment("webserver-www", new()
    {
        InstanceId = civo_instance.Www.Id,
        ReservedIpId = civo_reserved_ip.Web_server.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.civo.ReservedIp;
import com.pulumi.civo.InstanceReservedIpAssignment;
import com.pulumi.civo.InstanceReservedIpAssignmentArgs;
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) {
        // Send to create a reserved IP
        var www = new ReservedIp("www");

        // We assign the reserved IP to the instance
        var webserver_www = new InstanceReservedIpAssignment("webserver-www", InstanceReservedIpAssignmentArgs.builder()
            .instanceId(civo_instance.www().id())
            .reservedIpId(civo_reserved_ip.web-server().id())
            .build());

    }
}
Copy
resources:
  # Send to create a reserved IP
  www:
    type: civo:ReservedIp
  # We assign the reserved IP to the instance
  webserver-www:
    type: civo:InstanceReservedIpAssignment
    properties:
      instanceId: ${civo_instance.www.id}
      reservedIpId: ${civo_reserved_ip"web-server"[%!s(MISSING)].id}
Copy

Create InstanceReservedIpAssignment Resource

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

Constructor syntax

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

@overload
def InstanceReservedIpAssignment(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 instance_id: Optional[str] = None,
                                 reserved_ip_id: Optional[str] = None,
                                 instance_reserved_ip_assignment_id: Optional[str] = None,
                                 region: Optional[str] = None,
                                 timeouts: Optional[InstanceReservedIpAssignmentTimeoutsArgs] = None)
func NewInstanceReservedIpAssignment(ctx *Context, name string, args InstanceReservedIpAssignmentArgs, opts ...ResourceOption) (*InstanceReservedIpAssignment, error)
public InstanceReservedIpAssignment(string name, InstanceReservedIpAssignmentArgs args, CustomResourceOptions? opts = null)
public InstanceReservedIpAssignment(String name, InstanceReservedIpAssignmentArgs args)
public InstanceReservedIpAssignment(String name, InstanceReservedIpAssignmentArgs args, CustomResourceOptions options)
type: civo:InstanceReservedIpAssignment
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. InstanceReservedIpAssignmentArgs
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. InstanceReservedIpAssignmentArgs
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. InstanceReservedIpAssignmentArgs
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. InstanceReservedIpAssignmentArgs
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. InstanceReservedIpAssignmentArgs
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 instanceReservedIpAssignmentResource = new Civo.InstanceReservedIpAssignment("instanceReservedIpAssignmentResource", new()
{
    InstanceId = "string",
    ReservedIpId = "string",
    InstanceReservedIpAssignmentId = "string",
    Region = "string",
    Timeouts = new Civo.Inputs.InstanceReservedIpAssignmentTimeoutsArgs
    {
        Create = "string",
    },
});
Copy
example, err := civo.NewInstanceReservedIpAssignment(ctx, "instanceReservedIpAssignmentResource", &civo.InstanceReservedIpAssignmentArgs{
InstanceId: pulumi.String("string"),
ReservedIpId: pulumi.String("string"),
InstanceReservedIpAssignmentId: pulumi.String("string"),
Region: pulumi.String("string"),
Timeouts: &.InstanceReservedIpAssignmentTimeoutsArgs{
Create: pulumi.String("string"),
},
})
Copy
var instanceReservedIpAssignmentResource = new InstanceReservedIpAssignment("instanceReservedIpAssignmentResource", InstanceReservedIpAssignmentArgs.builder()
    .instanceId("string")
    .reservedIpId("string")
    .instanceReservedIpAssignmentId("string")
    .region("string")
    .timeouts(InstanceReservedIpAssignmentTimeoutsArgs.builder()
        .create("string")
        .build())
    .build());
Copy
instance_reserved_ip_assignment_resource = civo.InstanceReservedIpAssignment("instanceReservedIpAssignmentResource",
    instance_id="string",
    reserved_ip_id="string",
    instance_reserved_ip_assignment_id="string",
    region="string",
    timeouts={
        "create": "string",
    })
Copy
const instanceReservedIpAssignmentResource = new civo.InstanceReservedIpAssignment("instanceReservedIpAssignmentResource", {
    instanceId: "string",
    reservedIpId: "string",
    instanceReservedIpAssignmentId: "string",
    region: "string",
    timeouts: {
        create: "string",
    },
});
Copy
type: civo:InstanceReservedIpAssignment
properties:
    instanceId: string
    instanceReservedIpAssignmentId: string
    region: string
    reservedIpId: string
    timeouts:
        create: string
Copy

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

InstanceId This property is required. string
The instance id
ReservedIpId This property is required. string
The reserved ip id
InstanceReservedIpAssignmentId string
The ID of this resource.
Region string
The region of the ip
Timeouts InstanceReservedIpAssignmentTimeouts
InstanceId This property is required. string
The instance id
ReservedIpId This property is required. string
The reserved ip id
InstanceReservedIpAssignmentId string
The ID of this resource.
Region string
The region of the ip
Timeouts InstanceReservedIpAssignmentTimeoutsArgs
instanceId This property is required. String
The instance id
reservedIpId This property is required. String
The reserved ip id
instanceReservedIpAssignmentId String
The ID of this resource.
region String
The region of the ip
timeouts InstanceReservedIpAssignmentTimeouts
instanceId This property is required. string
The instance id
reservedIpId This property is required. string
The reserved ip id
instanceReservedIpAssignmentId string
The ID of this resource.
region string
The region of the ip
timeouts InstanceReservedIpAssignmentTimeouts
instance_id This property is required. str
The instance id
reserved_ip_id This property is required. str
The reserved ip id
instance_reserved_ip_assignment_id str
The ID of this resource.
region str
The region of the ip
timeouts InstanceReservedIpAssignmentTimeoutsArgs
instanceId This property is required. String
The instance id
reservedIpId This property is required. String
The reserved ip id
instanceReservedIpAssignmentId String
The ID of this resource.
region String
The region of the ip
timeouts Property Map

Outputs

All input properties are implicitly available as output properties. Additionally, the InstanceReservedIpAssignment 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 InstanceReservedIpAssignment Resource

Get an existing InstanceReservedIpAssignment 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?: InstanceReservedIpAssignmentState, opts?: CustomResourceOptions): InstanceReservedIpAssignment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        instance_id: Optional[str] = None,
        instance_reserved_ip_assignment_id: Optional[str] = None,
        region: Optional[str] = None,
        reserved_ip_id: Optional[str] = None,
        timeouts: Optional[InstanceReservedIpAssignmentTimeoutsArgs] = None) -> InstanceReservedIpAssignment
func GetInstanceReservedIpAssignment(ctx *Context, name string, id IDInput, state *InstanceReservedIpAssignmentState, opts ...ResourceOption) (*InstanceReservedIpAssignment, error)
public static InstanceReservedIpAssignment Get(string name, Input<string> id, InstanceReservedIpAssignmentState? state, CustomResourceOptions? opts = null)
public static InstanceReservedIpAssignment get(String name, Output<String> id, InstanceReservedIpAssignmentState state, CustomResourceOptions options)
resources:  _:    type: civo:InstanceReservedIpAssignment    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:
InstanceId string
The instance id
InstanceReservedIpAssignmentId string
The ID of this resource.
Region string
The region of the ip
ReservedIpId string
The reserved ip id
Timeouts InstanceReservedIpAssignmentTimeouts
InstanceId string
The instance id
InstanceReservedIpAssignmentId string
The ID of this resource.
Region string
The region of the ip
ReservedIpId string
The reserved ip id
Timeouts InstanceReservedIpAssignmentTimeoutsArgs
instanceId String
The instance id
instanceReservedIpAssignmentId String
The ID of this resource.
region String
The region of the ip
reservedIpId String
The reserved ip id
timeouts InstanceReservedIpAssignmentTimeouts
instanceId string
The instance id
instanceReservedIpAssignmentId string
The ID of this resource.
region string
The region of the ip
reservedIpId string
The reserved ip id
timeouts InstanceReservedIpAssignmentTimeouts
instance_id str
The instance id
instance_reserved_ip_assignment_id str
The ID of this resource.
region str
The region of the ip
reserved_ip_id str
The reserved ip id
timeouts InstanceReservedIpAssignmentTimeoutsArgs
instanceId String
The instance id
instanceReservedIpAssignmentId String
The ID of this resource.
region String
The region of the ip
reservedIpId String
The reserved ip id
timeouts Property Map

Supporting Types

InstanceReservedIpAssignmentTimeouts
, InstanceReservedIpAssignmentTimeoutsArgs

Create string
Create string
create String
create string
create str
create String

Package Details

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