1. Packages
  2. Civo
  3. API Docs
  4. InstanceReservedIpAssignment
Civo v2.3.14 published on Thursday, Mar 21, 2024 by Pulumi

civo.InstanceReservedIpAssignment

Explore with Pulumi AI

civo logo
Civo v2.3.14 published on Thursday, Mar 21, 2024 by Pulumi

    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,
    });
    
    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"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-civo/sdk/v2/go/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
    	})
    }
    
    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,
        });
    
    });
    
    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) {
            var www = new ReservedIp("www");
    
            var webserver_www = new InstanceReservedIpAssignment("webserver-www", InstanceReservedIpAssignmentArgs.builder()        
                .instanceId(civo_instance.www().id())
                .reservedIpId(civo_reserved_ip.web-server().id())
                .build());
    
        }
    }
    
    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}
    

    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,
                                     region: Optional[str] = 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 string
    The unique name of the resource.
    args InstanceReservedIpAssignmentArgs
    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 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 string
    The unique name of the resource.
    args InstanceReservedIpAssignmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args InstanceReservedIpAssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args InstanceReservedIpAssignmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var instanceReservedIpAssignmentResource = new Civo.InstanceReservedIpAssignment("instanceReservedIpAssignmentResource", new()
    {
        InstanceId = "string",
        ReservedIpId = "string",
        Region = "string",
    });
    
    example, err := civo.NewInstanceReservedIpAssignment(ctx, "instanceReservedIpAssignmentResource", &civo.InstanceReservedIpAssignmentArgs{
    	InstanceId:   pulumi.String("string"),
    	ReservedIpId: pulumi.String("string"),
    	Region:       pulumi.String("string"),
    })
    
    var instanceReservedIpAssignmentResource = new InstanceReservedIpAssignment("instanceReservedIpAssignmentResource", InstanceReservedIpAssignmentArgs.builder()        
        .instanceId("string")
        .reservedIpId("string")
        .region("string")
        .build());
    
    instance_reserved_ip_assignment_resource = civo.InstanceReservedIpAssignment("instanceReservedIpAssignmentResource",
        instance_id="string",
        reserved_ip_id="string",
        region="string")
    
    const instanceReservedIpAssignmentResource = new civo.InstanceReservedIpAssignment("instanceReservedIpAssignmentResource", {
        instanceId: "string",
        reservedIpId: "string",
        region: "string",
    });
    
    type: civo:InstanceReservedIpAssignment
    properties:
        instanceId: string
        region: string
        reservedIpId: string
    

    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

    The InstanceReservedIpAssignment resource accepts the following input properties:

    InstanceId string
    The instance id
    ReservedIpId string
    The reserved ip id
    Region string
    The region of the ip
    InstanceId string
    The instance id
    ReservedIpId string
    The reserved ip id
    Region string
    The region of the ip
    instanceId String
    The instance id
    reservedIpId String
    The reserved ip id
    region String
    The region of the ip
    instanceId string
    The instance id
    reservedIpId string
    The reserved ip id
    region string
    The region of the ip
    instance_id str
    The instance id
    reserved_ip_id str
    The reserved ip id
    region str
    The region of the ip
    instanceId String
    The instance id
    reservedIpId String
    The reserved ip id
    region String
    The region of the ip

    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,
            region: Optional[str] = None,
            reserved_ip_id: Optional[str] = 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)
    Resource lookup is not supported in YAML
    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:
    InstanceId string
    The instance id
    Region string
    The region of the ip
    ReservedIpId string
    The reserved ip id
    InstanceId string
    The instance id
    Region string
    The region of the ip
    ReservedIpId string
    The reserved ip id
    instanceId String
    The instance id
    region String
    The region of the ip
    reservedIpId String
    The reserved ip id
    instanceId string
    The instance id
    region string
    The region of the ip
    reservedIpId string
    The reserved ip id
    instance_id str
    The instance id
    region str
    The region of the ip
    reserved_ip_id str
    The reserved ip id
    instanceId String
    The instance id
    region String
    The region of the ip
    reservedIpId String
    The reserved ip id

    Package Details

    Repository
    Civo pulumi/pulumi-civo
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the civo Terraform Provider.
    civo logo
    Civo v2.3.14 published on Thursday, Mar 21, 2024 by Pulumi