vultr.InstanceIpv4
Explore with Pulumi AI
Provides a Vultr instance IPv4 resource. This can be used to create, read, and modify a IPv4 address. instance is rebooted by default.
Example Usage
Create a new IPv4 address for a instance:
import * as pulumi from "@pulumi/pulumi";
import * as vultr from "@ediri/vultr";
const myInstance = new vultr.Instance("myInstance", {
enableIpv6: true,
osId: 167,
plan: "vc2-1c-1gb",
region: "ewr",
});
const myInstanceIpv4 = new vultr.InstanceIpv4("myInstanceIpv4", {
instanceId: myInstance.id,
reboot: false,
});
import pulumi
import ediri_vultr as vultr
my_instance = vultr.Instance("myInstance",
enable_ipv6=True,
os_id=167,
plan="vc2-1c-1gb",
region="ewr")
my_instance_ipv4 = vultr.InstanceIpv4("myInstanceIpv4",
instance_id=my_instance.id,
reboot=False)
package main
import (
"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
myInstance, err := vultr.NewInstance(ctx, "myInstance", &vultr.InstanceArgs{
EnableIpv6: pulumi.Bool(true),
OsId: pulumi.Int(167),
Plan: pulumi.String("vc2-1c-1gb"),
Region: pulumi.String("ewr"),
})
if err != nil {
return err
}
_, err = vultr.NewInstanceIpv4(ctx, "myInstanceIpv4", &vultr.InstanceIpv4Args{
InstanceId: myInstance.ID(),
Reboot: pulumi.Bool(false),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vultr = ediri.Vultr;
return await Deployment.RunAsync(() =>
{
var myInstance = new Vultr.Instance("myInstance", new()
{
EnableIpv6 = true,
OsId = 167,
Plan = "vc2-1c-1gb",
Region = "ewr",
});
var myInstanceIpv4 = new Vultr.InstanceIpv4("myInstanceIpv4", new()
{
InstanceId = myInstance.Id,
Reboot = false,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vultr.Instance;
import com.pulumi.vultr.InstanceArgs;
import com.pulumi.vultr.InstanceIpv4;
import com.pulumi.vultr.InstanceIpv4Args;
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 myInstance = new Instance("myInstance", InstanceArgs.builder()
.enableIpv6(true)
.osId(167)
.plan("vc2-1c-1gb")
.region("ewr")
.build());
var myInstanceIpv4 = new InstanceIpv4("myInstanceIpv4", InstanceIpv4Args.builder()
.instanceId(myInstance.id())
.reboot(false)
.build());
}
}
resources:
myInstance:
type: vultr:Instance
properties:
enableIpv6: true
osId: 167
plan: vc2-1c-1gb
region: ewr
myInstanceIpv4:
type: vultr:InstanceIpv4
properties:
instanceId: ${myInstance.id}
reboot: false
Create InstanceIpv4 Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new InstanceIpv4(name: string, args: InstanceIpv4Args, opts?: CustomResourceOptions);
@overload
def InstanceIpv4(resource_name: str,
args: InstanceIpv4Args,
opts: Optional[ResourceOptions] = None)
@overload
def InstanceIpv4(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
reboot: Optional[bool] = None)
func NewInstanceIpv4(ctx *Context, name string, args InstanceIpv4Args, opts ...ResourceOption) (*InstanceIpv4, error)
public InstanceIpv4(string name, InstanceIpv4Args args, CustomResourceOptions? opts = null)
public InstanceIpv4(String name, InstanceIpv4Args args)
public InstanceIpv4(String name, InstanceIpv4Args args, CustomResourceOptions options)
type: vultr:InstanceIpv4
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 InstanceIpv4Args
- 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 InstanceIpv4Args
- 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 InstanceIpv4Args
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InstanceIpv4Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args InstanceIpv4Args
- 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 instanceIpv4Resource = new Vultr.InstanceIpv4("instanceIpv4Resource", new()
{
InstanceId = "string",
Reboot = false,
});
example, err := vultr.NewInstanceIpv4(ctx, "instanceIpv4Resource", &vultr.InstanceIpv4Args{
InstanceId: pulumi.String("string"),
Reboot: pulumi.Bool(false),
})
var instanceIpv4Resource = new InstanceIpv4("instanceIpv4Resource", InstanceIpv4Args.builder()
.instanceId("string")
.reboot(false)
.build());
instance_ipv4_resource = vultr.InstanceIpv4("instanceIpv4Resource",
instance_id="string",
reboot=False)
const instanceIpv4Resource = new vultr.InstanceIpv4("instanceIpv4Resource", {
instanceId: "string",
reboot: false,
});
type: vultr:InstanceIpv4
properties:
instanceId: string
reboot: false
InstanceIpv4 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 InstanceIpv4 resource accepts the following input properties:
- Instance
Id string - The ID of the instance to be assigned the IPv4 address.
- Reboot bool
- Default true. Determines whether or not the server is rebooted after adding the IPv4 address.
- Instance
Id string - The ID of the instance to be assigned the IPv4 address.
- Reboot bool
- Default true. Determines whether or not the server is rebooted after adding the IPv4 address.
- instance
Id String - The ID of the instance to be assigned the IPv4 address.
- reboot Boolean
- Default true. Determines whether or not the server is rebooted after adding the IPv4 address.
- instance
Id string - The ID of the instance to be assigned the IPv4 address.
- reboot boolean
- Default true. Determines whether or not the server is rebooted after adding the IPv4 address.
- instance_
id str - The ID of the instance to be assigned the IPv4 address.
- reboot bool
- Default true. Determines whether or not the server is rebooted after adding the IPv4 address.
- instance
Id String - The ID of the instance to be assigned the IPv4 address.
- reboot Boolean
- Default true. Determines whether or not the server is rebooted after adding the IPv4 address.
Outputs
All input properties are implicitly available as output properties. Additionally, the InstanceIpv4 resource produces the following output properties:
Look up Existing InstanceIpv4 Resource
Get an existing InstanceIpv4 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?: InstanceIpv4State, opts?: CustomResourceOptions): InstanceIpv4
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
gateway: Optional[str] = None,
instance_id: Optional[str] = None,
ip: Optional[str] = None,
netmask: Optional[str] = None,
reboot: Optional[bool] = None,
reverse: Optional[str] = None) -> InstanceIpv4
func GetInstanceIpv4(ctx *Context, name string, id IDInput, state *InstanceIpv4State, opts ...ResourceOption) (*InstanceIpv4, error)
public static InstanceIpv4 Get(string name, Input<string> id, InstanceIpv4State? state, CustomResourceOptions? opts = null)
public static InstanceIpv4 get(String name, Output<String> id, InstanceIpv4State 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.
- Gateway string
- The gateway IP address.
- Instance
Id string - The ID of the instance to be assigned the IPv4 address.
- Ip string
- The IPv4 address in canonical format.
- Netmask string
- The IPv4 netmask in dot-decimal notation.
- Reboot bool
- Default true. Determines whether or not the server is rebooted after adding the IPv4 address.
- Reverse string
- The reverse DNS information for this IP address.
- Gateway string
- The gateway IP address.
- Instance
Id string - The ID of the instance to be assigned the IPv4 address.
- Ip string
- The IPv4 address in canonical format.
- Netmask string
- The IPv4 netmask in dot-decimal notation.
- Reboot bool
- Default true. Determines whether or not the server is rebooted after adding the IPv4 address.
- Reverse string
- The reverse DNS information for this IP address.
- gateway String
- The gateway IP address.
- instance
Id String - The ID of the instance to be assigned the IPv4 address.
- ip String
- The IPv4 address in canonical format.
- netmask String
- The IPv4 netmask in dot-decimal notation.
- reboot Boolean
- Default true. Determines whether or not the server is rebooted after adding the IPv4 address.
- reverse String
- The reverse DNS information for this IP address.
- gateway string
- The gateway IP address.
- instance
Id string - The ID of the instance to be assigned the IPv4 address.
- ip string
- The IPv4 address in canonical format.
- netmask string
- The IPv4 netmask in dot-decimal notation.
- reboot boolean
- Default true. Determines whether or not the server is rebooted after adding the IPv4 address.
- reverse string
- The reverse DNS information for this IP address.
- gateway str
- The gateway IP address.
- instance_
id str - The ID of the instance to be assigned the IPv4 address.
- ip str
- The IPv4 address in canonical format.
- netmask str
- The IPv4 netmask in dot-decimal notation.
- reboot bool
- Default true. Determines whether or not the server is rebooted after adding the IPv4 address.
- reverse str
- The reverse DNS information for this IP address.
- gateway String
- The gateway IP address.
- instance
Id String - The ID of the instance to be assigned the IPv4 address.
- ip String
- The IPv4 address in canonical format.
- netmask String
- The IPv4 netmask in dot-decimal notation.
- reboot Boolean
- Default true. Determines whether or not the server is rebooted after adding the IPv4 address.
- reverse String
- The reverse DNS information for this IP address.
Package Details
- Repository
- vultr dirien/pulumi-vultr
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vultr
Terraform Provider.