instance

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AttachedNICType = types.ObjectType{}.WithAttributeTypes(
	map[string]attr.Type{
		"id":          types.StringType,
		"name":        types.StringType,
		"description": types.StringType,
		"subnet_id":   types.StringType,
		"vpc_id":      types.StringType,
		"instance_id": types.StringType,
		"primary":     types.BoolType,
		"mac_address": types.StringType,
		"ip_stack": types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"v4": types.ObjectType{
					AttrTypes: map[string]attr.Type{
						"ip": types.StringType,
					},
				},
				"v6": types.ObjectType{
					AttrTypes: map[string]attr.Type{
						"ip": types.StringType,
					},
				},
			},
		},
		"time_created":  types.StringType,
		"time_modified": types.StringType,
	},
)

Functions

func ModifyPlanForHostnameDeprecation

func ModifyPlanForHostnameDeprecation(
	ctx context.Context,
	req planmodifier.StringRequest,
	resp *stringplanmodifier.RequiresReplaceIfFuncResponse,
)

ModifyPlanForHostnameDeprecation modifies the plan to support the deprecation of `host_name` in favor of `hostname`. This must be added to both the deprecated `host_name` attribute and the new `hostname` attribute. This function is responsible for setting stringplanmodifier.RequiresReplaceIfFuncResponse.RequiresReplace to `true` when it's deemed the user is actually changing the hostname value in the configuration or `false` when the user is just updating their configuration to comply with the deprecation.

func NewResource

func NewResource() resource.Resource

NewResource is a helper function to simplify the provider implementation.

Types

type AttachedNICResourceModel

type AttachedNICResourceModel struct {
	ID           types.String         `tfsdk:"id"`
	Name         types.String         `tfsdk:"name"`
	Description  types.String         `tfsdk:"description"`
	SubnetID     types.String         `tfsdk:"subnet_id"`
	VPCID        types.String         `tfsdk:"vpc_id"`
	InstanceID   types.String         `tfsdk:"instance_id"`
	Primary      types.Bool           `tfsdk:"primary"`
	MAC          types.String         `tfsdk:"mac_address"`
	IPStack      IPStackResourceModel `tfsdk:"ip_stack"`
	TimeCreated  types.String         `tfsdk:"time_created"`
	TimeModified types.String         `tfsdk:"time_modified"`
}

type EphemeralIPResourceModel

type EphemeralIPResourceModel struct {
	PoolID    types.String `tfsdk:"pool_id"`
	IPVersion types.String `tfsdk:"ip_version"`
}

type ExternalIPResourceModel

type ExternalIPResourceModel struct {
	Ephemeral []EphemeralIPResourceModel `tfsdk:"ephemeral"`
	Floating  []FloatingIPResourceModel  `tfsdk:"floating"`
}

func (*ExternalIPResourceModel) Empty

func (ip *ExternalIPResourceModel) Empty() bool

type FloatingIPResourceModel

type FloatingIPResourceModel struct {
	ID types.String `tfsdk:"id"`
}

type IPConfigResourceModel

type IPConfigResourceModel struct {
	V4 *IPConfigV4ResourceModel `tfsdk:"v4"`
	V6 *IPConfigV6ResourceModel `tfsdk:"v6"`
}

type IPConfigV4ResourceModel

type IPConfigV4ResourceModel struct {
	IP types.String `tfsdk:"ip"`
}

type IPConfigV6ResourceModel

type IPConfigV6ResourceModel struct {
	IP types.String `tfsdk:"ip"`
}

type IPStackResourceModel

type IPStackResourceModel struct {
	V4 *IPStackV4ResourceModel `tfsdk:"v4"`
	V6 *IPStackV6ResourceModel `tfsdk:"v6"`
}

type IPStackV4ResourceModel

type IPStackV4ResourceModel struct {
	IP types.String `tfsdk:"ip"`
}

type IPStackV6ResourceModel

type IPStackV6ResourceModel struct {
	IP types.String `tfsdk:"ip"`
}

type NICResourceModel

type NICResourceModel struct {
	Name        types.String          `tfsdk:"name"`
	Description types.String          `tfsdk:"description"`
	SubnetID    types.String          `tfsdk:"subnet_id"`
	VPCID       types.String          `tfsdk:"vpc_id"`
	IPConfig    IPConfigResourceModel `tfsdk:"ip_config"`
}

func (NICResourceModel) Hash

func (nic NICResourceModel) Hash() string

type Resource

type Resource struct {
	// contains filtered or unexported fields
}

Resource is the resource implementation.

func (*Resource) Configure

Configure adds the provider configured client to the data source.

func (*Resource) Create

func (r *Resource) Create(
	ctx context.Context,
	req resource.CreateRequest,
	resp *resource.CreateResponse,
)

Create creates the resource and sets the initial Terraform state.

func (*Resource) Delete

func (r *Resource) Delete(
	ctx context.Context,
	req resource.DeleteRequest,
	resp *resource.DeleteResponse,
)

Delete deletes the resource and removes the Terraform state on success.

func (*Resource) ImportState

func (r *Resource) ImportState(
	ctx context.Context,
	req resource.ImportStateRequest,
	resp *resource.ImportStateResponse,
)

ImportState imports an existing instance resource into Terraform state.

func (*Resource) Metadata

Metadata returns the resource type name.

func (*Resource) Read

func (r *Resource) Read(
	ctx context.Context,
	req resource.ReadRequest,
	resp *resource.ReadResponse,
)

Read refreshes the Terraform state with the latest data.

func (*Resource) Schema

Schema defines the schema for the resource.

func (*Resource) Update

func (r *Resource) Update(
	ctx context.Context,
	req resource.UpdateRequest,
	resp *resource.UpdateResponse,
)

Update updates the resource and sets the updated Terraform state on success.

func (*Resource) UpgradeState

func (r *Resource) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader

type ResourceModel

type ResourceModel struct {
	AntiAffinityGroups        types.Set                `tfsdk:"anti_affinity_groups"`
	AutoRestartPolicy         types.String             `tfsdk:"auto_restart_policy"`
	BootDiskID                types.String             `tfsdk:"boot_disk_id"`
	CPUPlatform               types.String             `tfsdk:"cpu_platform"`
	Description               types.String             `tfsdk:"description"`
	DiskAttachments           types.Set                `tfsdk:"disk_attachments"`
	EnableJumboFrames         types.Bool               `tfsdk:"enable_jumbo_frames"`
	ExternalIPs               *ExternalIPResourceModel `tfsdk:"external_ips"`
	Hostname                  types.String             `tfsdk:"hostname"`
	ID                        types.String             `tfsdk:"id"`
	Memory                    types.Int64              `tfsdk:"memory"`
	Name                      types.String             `tfsdk:"name"`
	NetworkInterfaces         []NICResourceModel       `tfsdk:"network_interfaces"`
	AttachedNetworkInterfaces types.Map                `tfsdk:"attached_network_interfaces"`
	NCPUs                     types.Int64              `tfsdk:"ncpus"`
	ProjectID                 types.String             `tfsdk:"project_id"`
	SSHPublicKeys             types.Set                `tfsdk:"ssh_public_keys"`
	StartOnCreate             types.Bool               `tfsdk:"start_on_create"`
	TimeCreated               types.String             `tfsdk:"time_created"`
	TimeModified              types.String             `tfsdk:"time_modified"`
	Timeouts                  timeouts.Value           `tfsdk:"timeouts"`
	UserData                  types.String             `tfsdk:"user_data"`
}

Jump to

Keyboard shortcuts

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