Documentation ¶
Index ¶
- Constants
- Variables
- func NewDataSource() datasource.DataSource
- func NewResource() resource.Resource
- type DataSource
- type DataSourceModel
- type Resource
- func (r *Resource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *Resource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *Resource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type ResourceModel
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 ¶
Types ¶
type DataSource ¶
type DataSource struct {
helper.BaseDataSource
}
func (*DataSource) Read ¶
func (d *DataSource) Read( ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse, )
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)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.