v1

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateResourceRequest

type CreateResourceRequest struct {
	// ResourceData is the data the user must provider to handle correctly.
	ResourceData string
}

type CreateResourceResponse

type CreateResourceResponse struct {
	// The ID that tracks this resource.
	ID string
}

type DataSourcePlugin added in v0.2.0

type DataSourcePlugin interface {
	// ReadDataSource will be responsible of:
	//
	// - Using the provided arguments to return a result.
	ReadDataSource(ctx context.Context, r ReadDataSourceRequest) (*ReadDataSourceResponse, error)
}

DataSourcePlugin knows how to handle a Terraform data source by implementing gathering data operations.

type DeleteResourceRequest

type DeleteResourceRequest struct {
	// ResourceData is the data the user must provider to handle correctly.
	ID string
}

type DeleteResourceResponse

type DeleteResourceResponse struct{}

type NewDataSourcePlugin added in v0.2.0

type NewDataSourcePlugin = func(options string) (DataSourcePlugin, error)

NewDataSourcePlugin is the function that the plugin engine will load and run to get the data source plugin that will be executed afterwards. E.g:

func NewDataSourcePlugin(options string) (apiv1.DataSourcePlugin, error) {
	//...
	return myDataSourcePlugin{}, nil
}

type NewResourcePlugin

type NewResourcePlugin = func(options string) (ResourcePlugin, error)

NewResourcePlugin is the function that the plugin engine will load and run to get the plugin that will be executed afterwards. E.g:

func NewResourcePlugin(options string) (apiv1.ResourcePlugin, error) {
	//...
	return myPlugin{}, nil
}

type ReadDataSourceRequest added in v0.2.0

type ReadDataSourceRequest struct {
	// Arguments is the data the user must provide so the data source can return a result.
	Arguments string
}

type ReadDataSourceResponse added in v0.2.0

type ReadDataSourceResponse struct {
	// Result is the result the plugin will return to Terraform.
	Result string
}

type ReadResourceRequest

type ReadResourceRequest struct {
	// The ID that tracks this resource.
	ID string
}

type ReadResourceResponse

type ReadResourceResponse struct {
	// ResourceData is the data the user must provider to handle correctly.
	ResourceData string
}

type ResourcePlugin

type ResourcePlugin interface {
	// CreateResource will be responsible of:
	//
	// - Creating the resource.
	// - Returning the correct ID that will be used from now on to identify the resource.
	// - Generating the ID with the required information to identify a resource (e.g aggregation of 2 properties as a single ID).
	CreateResource(ctx context.Context, r CreateResourceRequest) (*CreateResourceResponse, error)

	// ReadResource will be responsible of:
	//
	// - Using the ID for getting the current real data of the resource (Used on plans and imports).
	ReadResource(ctx context.Context, r ReadResourceRequest) (*ReadResourceResponse, error)

	// UpdateResource will be responsible of:
	//
	// - Using the resource data and ID update the resource if required.
	// - Use the latest applied resource data (state data) to get diffs if required to patch/update specific parts.
	UpdateResource(ctx context.Context, r UpdateResourceRequest) (*UpdateResourceResponse, error)

	// DeleteResource will be responsible of:
	//
	// - Deleting the resource using the ID.
	DeleteResource(ctx context.Context, r DeleteResourceRequest) (*DeleteResourceResponse, error)
}

ResourcePlugin knows how to handle a Terraform resource by implementing the common Terraform CRUD operations.

type UpdateResourceRequest

type UpdateResourceRequest struct {
	// ResourceData is the data the user must provider to handle correctly.
	ID string
	// ResourceData is the data the user must provider to handle correctly.
	ResourceData string
	// ResourceDataState is the same as ResourceData but is the resource data used on the previous
	// terraform apply execution.
	//
	// This field is not normally used except we want to make decisions based on previous terraform apply
	// changes. (E.g: A resource data attribute can't be changed after the creation, so if changes we return an error)
	ResourceDataState string
}

type UpdateResourceResponse

type UpdateResourceResponse struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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