servicevcl

package
v0.0.0-...-fe0a372 Latest Latest
Warning

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

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

Documentation

Overview

Package servicevcl implements a service resource.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResource

func NewResource() func() resource.Resource

NewResource returns a new Terraform resource instance.

Types

type Resource

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

Resource defines the resource implementation.

func (Resource) ConfigValidators

func (r Resource) ConfigValidators(_ context.Context) []resource.ConfigValidator

ConfigValidators returns a list of functions which will all be performed during validation. https://developer.hashicorp.com/terraform/plugin/framework/resources/validate-configuration#configvalidators-method

func (*Resource) Configure

Configure includes provider-level data or clients.

func (*Resource) Create

Create is called when the provider must create a new resource. Config and planned state values should be read from the CreateRequest. New state values set on the CreateResponse.

func (*Resource) Delete

Delete is called when the provider must delete the resource. Config values may be read from the DeleteRequest.

If execution completes without error, the framework will automatically call DeleteResponse.State.RemoveResource().

func (*Resource) ImportState

ImportState is called when the provider must import the state of a resource instance.

The resource's ID is set into the state and its Read() method called. If we look at the Read() method in ./process_read.go we'll see it calls `ServiceAPI.GetServiceDetail()` passing in the ID the user specifies.

e.g. `terraform import ADDRESS ID` https://developer.hashicorp.com/terraform/cli/commands/import#usage`

The service resource then iterates over all nested resources populating the state for each nested resource.

func (*Resource) Metadata

Metadata should return the full name of the resource.

func (*Resource) Read

Read is called when the provider must read resource values in order to update state. Planned state values should be read from the ReadRequest. New state values set on the ReadResponse.

TODO: How to handle name/comment which are versionless and don't need `activate`.

func (*Resource) Schema

Schema should return the schema for this resource.

NOTE: Some optional attributes are also 'computed' so we can set a default.

func (*Resource) Update

Update is called to update the state of the resource. Config, planned state, and prior state values should be read from the UpdateRequest. New state values set on the UpdateResponse.

Jump to

Keyboard shortcuts

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