instance

package
v2.20.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LinodeInstanceCreateTimeout = 15 * time.Minute
	LinodeInstanceUpdateTimeout = time.Hour
	LinodeInstanceDeleteTimeout = 10 * time.Minute
)

Variables

View Source
var InterfaceSchema = &schema.Resource{
	Schema: map[string]*schema.Schema{
		"purpose": {
			Type:        schema.TypeString,
			Description: "The type of interface.",
			Required:    true,
			ValidateDiagFunc: validation.ToDiagFunc(
				validation.StringInSlice([]string{"public", "vlan", "vpc"}, true),
			),
		},
		"ipam_address": {
			Type: schema.TypeString,
			Description: "This Network Interface's private IP address in " +
				"Classless Inter-Domain Routing (CIDR) notation." +
				onlyAllowedForVLANMsg,
			Optional: true,
		},
		"label": {
			Type: schema.TypeString,
			Description: "The name of the VALN. " + requiredForVLANMsg +
				" " + onlyAllowedForVLANMsg,
			Optional: true,
		},
		"id": {
			Type:        schema.TypeInt,
			Description: "The ID of the interface.",
			Computed:    true,
		},
		"subnet_id": {
			Type: schema.TypeInt,
			Description: "The ID of the subnet which the VPC interface is connected to." +
				requiredForVPCMsg + onlyAllowedForVPCMsg,
			Optional: true,
		},
		"vpc_id": {
			Type: schema.TypeInt,
			Description: "The ID of VPC of the subnet which the VPC " +
				"interface is connected to.",
			Computed: true,
		},
		"primary": {
			Type: schema.TypeBool,
			Description: "Whether the interface is the primary interface that should " +
				"have the default route for this Linode.",
			Optional: true,
			Default:  false,
		},
		"active": {
			Type:        schema.TypeBool,
			Description: "Whether this interface is currently booted and active.",
			Computed:    true,
		},
		"ip_ranges": {
			Type:        schema.TypeList,
			Description: "List of VPC IPs or IP ranges inside the VPC subnet.",
			Optional:    true,
			Elem: &schema.Schema{
				Type: schema.TypeString,
				ValidateDiagFunc: validation.AnyDiag(
					helper.SDKv2ValidateIPv4Range,
					helper.SDKv2ValidateIPv6Range,
				),
			},
		},
		"ipv4": {
			Type: schema.TypeList,
			Description: "The IPv4 configuration of the VPC interface." +
				onlyAllowedForVPCMsg,
			Computed: true,
			Optional: true,
			MaxItems: 1,
			Elem: &schema.Resource{
				Schema: map[string]*schema.Schema{
					"vpc": {
						Type:        schema.TypeString,
						Description: "The IP from the VPC subnet to use for this interface.",
						Computed:    true,
						Optional:    true,
					},
					"nat_1_1": {
						Type: schema.TypeString,
						Description: "The public IP that will be used for the " +
							"one-to-one NAT purpose.",
						Computed: true,
						Optional: true,
						DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
							if new == "any" && old != "" {
								return true
							}
							return old == new
						},
					},
				},
			},
		},
	},
}

Functions

func BootInstanceAfterVPCInterfaceUpdate added in v2.14.0

func BootInstanceAfterVPCInterfaceUpdate(ctx context.Context, meta *helper.ProviderMeta, instanceID, targetConfigID, deadlineSeconds int) diag.Diagnostics

func BootInstanceSync added in v2.17.0

func BootInstanceSync(ctx context.Context, client *linodego.Client, instanceID, configID, deadlineSeconds int) error

func DataSource

func DataSource() *schema.Resource

func Resource

func Resource() *schema.Resource

func SafeShutdownInstance added in v2.17.0

func SafeShutdownInstance(ctx context.Context, client *linodego.Client, instanceID, deadlineSeconds int) error

func ShutdownInstanceForVPCInterfaceUpdate added in v2.14.0

func ShutdownInstanceForVPCInterfaceUpdate(ctx context.Context, client *linodego.Client, skipImplicitReboots bool, instanceID, deadlineSeconds int) error

func VPCInterfaceIncluded added in v2.14.0

func VPCInterfaceIncluded(
	interfaces1 []linodego.InstanceConfigInterface,
	interfaces2 []linodego.InstanceConfigInterfaceCreateOptions,
) bool

VPCInterfaceIncluded returns whether a VPC interface is included in either slice

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL