vpcsubnet

package
v3.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DataSourceSchemaIPv6NestedObject = schema.NestedAttributeObject{
	Attributes: map[string]schema.Attribute{
		"range": schema.StringAttribute{
			Description: "An IPv6 range allocated to this subnet.",
			Computed:    true,
		},
	},
}
View Source
var DatabaseObjectType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"id":         types.Int64Type,
		"ipv4_range": types.StringType,
		"ipv6_ranges": types.ListType{
			ElemType: IPV6RangeObjectType,
		},
	},
}
View Source
var IPV6RangeObjectType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"range": types.StringType,
	},
}
View Source
var LinodeInterfaceObjectType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"id":        types.Int64Type,
		"config_id": types.Int64Type,
		"active":    types.BoolType,
	},
}
View Source
var LinodeObjectType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"id": types.Int64Type,
		"interfaces": types.ListType{
			ElemType: LinodeInterfaceObjectType,
		},
	},
}
View Source
var ResourceSchemaIPv6NestedObject = schema.NestedAttributeObject{
	Attributes: map[string]schema.Attribute{
		"range": schema.StringAttribute{
			Description: "An existing IPv6 prefix owned by the current account or a " +
				"forward slash (/) followed by a valid prefix length. " +
				"If unspecified, a range with the default prefix will be " +
				"allocated for this VPC.",
			Optional:   true,
			Computed:   true,
			CustomType: customtypes.LinodeAutoAllocRangeType{},
			PlanModifiers: []planmodifier.String{
				stringplanmodifier.RequiresReplace(),
				stringplanmodifier.UseStateForUnknown(),
			},
		},
		"allocated_range": schema.StringAttribute{
			Description: "The IPv6 range assigned to this subnet.",
			Computed:    true,
		},
	},
}

Functions

func FlattenSubnetDatabase added in v3.9.0

func FlattenSubnetDatabase(
	ctx context.Context,
	db linodego.VPCSubnetDatabase,
) (*types.Object, diag.Diagnostics)

func FlattenSubnetDatabases added in v3.9.0

func FlattenSubnetDatabases(
	ctx context.Context,
	subnetDatabases []linodego.VPCSubnetDatabase,
) (*types.List, diag.Diagnostics)

func FlattenSubnetLinode

func FlattenSubnetLinode(
	ctx context.Context,
	linode linodego.VPCSubnetLinode,
) (*types.Object, diag.Diagnostics)

func FlattenSubnetLinodes

func FlattenSubnetLinodes(
	ctx context.Context,
	subnetLinodes []linodego.VPCSubnetLinode,
) (*types.List, diag.Diagnostics)

func NewDataSource

func NewDataSource() datasource.DataSource

func NewResource

func NewResource() resource.Resource

Types

type BaseModel added in v3.4.0

type BaseModel struct {
	ID        types.String      `tfsdk:"id"`
	VPCId     types.Int64       `tfsdk:"vpc_id"`
	Label     types.String      `tfsdk:"label"`
	IPv4      types.String      `tfsdk:"ipv4"`
	Linodes   types.List        `tfsdk:"linodes"`
	Created   timetypes.RFC3339 `tfsdk:"created"`
	Updated   timetypes.RFC3339 `tfsdk:"updated"`
	Databases types.List        `tfsdk:"databases"`
}

func (*BaseModel) CopyFrom added in v3.4.0

func (m *BaseModel) CopyFrom(other BaseModel, preserveKnown bool)

func (*BaseModel) FlattenSubnet added in v3.4.0

func (d *BaseModel) FlattenSubnet(
	ctx context.Context,
	subnet *linodego.VPCSubnet,
	preserveKnown bool,
) diag.Diagnostics

type DataSource

type DataSource struct {
	helper.BaseDataSource
}

func (*DataSource) Read

type DataSourceModel added in v3.4.0

type DataSourceModel struct {
	BaseModel
	IPv6 types.List `tfsdk:"ipv6"`
}

func (*DataSourceModel) CopyFrom added in v3.4.0

func (m *DataSourceModel) CopyFrom(other DataSourceModel, preserveKnown bool)

func (*DataSourceModel) FlattenSubnet added in v3.4.0

func (m *DataSourceModel) FlattenSubnet(
	ctx context.Context,
	subnet *linodego.VPCSubnet,
	preserveKnown bool,
) diag.Diagnostics

type DataSourceModelIPv6 added in v3.4.0

type DataSourceModelIPv6 struct {
	Range customtypes.LinodeAutoAllocRangeValue `tfsdk:"range"`
}

type Resource

type Resource struct {
	helper.BaseResource
}

func (*Resource) Create

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

func (*Resource) Delete

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

func (*Resource) ImportState

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

func (*Resource) Read

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

func (*Resource) Update

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

type ResourceModel added in v3.4.0

type ResourceModel struct {
	BaseModel
	IPv6 types.List `tfsdk:"ipv6"`
}

func (*ResourceModel) CopyFrom added in v3.4.0

func (m *ResourceModel) CopyFrom(other ResourceModel, preserveKnown bool)

func (*ResourceModel) FlattenSubnet added in v3.4.0

func (m *ResourceModel) FlattenSubnet(
	ctx context.Context,
	subnet *linodego.VPCSubnet,
	preserveKnown bool,
) diag.Diagnostics

type ResourceModelIPv6 added in v3.4.0

type ResourceModelIPv6 struct {
	Range          customtypes.LinodeAutoAllocRangeValue `tfsdk:"range"`
	AllocatedRange types.String                          `tfsdk:"allocated_range"`
}

type SubnetDatabaseIPv6RangeModel added in v3.9.0

type SubnetDatabaseIPv6RangeModel struct {
	Range types.String `tfsdk:"range"`
}

type SubnetDatabaseModel added in v3.9.0

type SubnetDatabaseModel struct {
	ID         types.Int64  `tfsdk:"id"`
	IPv4Range  types.String `tfsdk:"ipv4_range"`
	IPv6Ranges types.List   `tfsdk:"ipv6_ranges"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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