sshkey

package
v2.20.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	SSHKeyLabelRegex        = "^[a-zA-Z0-9_-]*$"
	SSHKeyLabelErrorMessage = "Labels may only contain letters, number, dashes, and underscores."
)

Variables

View Source
var SSHKeyAttributes = map[string]schema.Attribute{
	"label": schema.StringAttribute{
		Description: "The label of the Linode SSH Key.",
		Required:    true,
		Validators: []validator.String{
			stringvalidator.LengthBetween(0, 64),
			helper.RegexMatches(SSHKeyLabelRegex, SSHKeyLabelErrorMessage),
		},
	},
	"ssh_key": schema.StringAttribute{
		Description: "The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.",
		Computed:    true,
	},
	"created": schema.StringAttribute{
		CustomType:  timetypes.RFC3339Type{},
		Description: "The date this key was added.",
		Computed:    true,
	},
	"id": schema.StringAttribute{
		Description: "A unique identifier for this datasource.",
		Optional:    true,
	},
}

Functions

func NewDataSource

func NewDataSource() datasource.DataSource

func NewResource

func NewResource() resource.Resource

Types

type DataSource

type DataSource struct {
	helper.BaseDataSource
}

func (*DataSource) Read

type DataSourceModel

type DataSourceModel struct {
	Label   types.String      `tfsdk:"label"`
	SSHKey  types.String      `tfsdk:"ssh_key"`
	Created timetypes.RFC3339 `tfsdk:"created"`
	ID      types.String      `tfsdk:"id"`
}

func (*DataSourceModel) ParseSSHKey

func (data *DataSourceModel) ParseSSHKey(ssh *linodego.SSHKey) diag.Diagnostics

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) 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

type ResourceModel struct {
	Label   types.String      `tfsdk:"label"`
	SSHKey  types.String      `tfsdk:"ssh_key"`
	Created timetypes.RFC3339 `tfsdk:"created"`
	ID      types.String      `tfsdk:"id"`
}

ResourceModel describes the Terraform resource rm model to match the resource schema.

func (*ResourceModel) CopyFrom added in v2.15.0

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

func (*ResourceModel) FlattenSSHKey added in v2.15.0

func (rm *ResourceModel) FlattenSSHKey(key *linodego.SSHKey, preserveKnown bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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