frameworkprovider

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MPL-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package frameworkprovider provides a provider.Provider implementation for managing Nobl9 resources. It is built using the terraform-plugin-framework.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(version string) provider.Provider

func NewServiceResource

func NewServiceResource() resource.Resource

Types

type LabelBlockModel

type LabelBlockModel struct {
	Key    string   `tfsdk:"key"`
	Values []string `tfsdk:"values"`
}

LabelBlockModel represents a single label block definition. Example:

```hcl
label {
  key    = "env"
  values = ["prod", "dev"]
}
```

type Labels

type Labels []LabelBlockModel

Labels is a list of LabelBlockModel. It is the Terraform equivalent of v1alpha.Labels.

func (Labels) ToManifest

func (l Labels) ToManifest() v1alpha.Labels

ToManifest converts Labels to v1alpha.Labels.

type Provider

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

Provider defines the provider implementation.

func (*Provider) Configure

Configure is called by the framework to configure the Provider.

func (*Provider) DataSources

func (p *Provider) DataSources(context.Context) []func() datasource.DataSource

func (*Provider) Metadata

func (*Provider) Resources

func (p *Provider) Resources(context.Context) []func() resource.Resource

func (*Provider) Schema

type ProviderModel

type ProviderModel struct {
	ClientID       envConfigurableString `tfsdk:"client_id"        envconfig:"CLIENT_ID"`
	ClientSecret   envConfigurableString `tfsdk:"client_secret"    envconfig:"CLIENT_SECRET"`
	OktaOrgURL     envConfigurableString `tfsdk:"okta_org_url"     envconfig:"OKTA_URL"`
	OktaAuthServer envConfigurableString `tfsdk:"okta_auth_server" envconfig:"OKTA_AUTH"`
	Project        envConfigurableString `tfsdk:"project"          envconfig:"PROJECT"`
	IngestURL      envConfigurableString `tfsdk:"ingest_url"       envconfig:"URL"`
	Organization   envConfigurableString `tfsdk:"organization"     envconfig:"ORG"`
}

ProviderModel describes the Provider data model.

type ServiceResource

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

ServiceResource defines the v1alpha.Service resource implementation.

func (*ServiceResource) Configure

func (*ServiceResource) Create

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

func (*ServiceResource) 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(), so it can be omitted from provider logic.

func (*ServiceResource) ImportState

ImportState is called when the provider must import the resource's state.

func (*ServiceResource) Metadata

Metadata implements resource.Resource.Metadata function.

func (*ServiceResource) 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 and new state values set on the ReadResponse.

func (*ServiceResource) Schema

Schema implements resource.Resource.Schema function.

func (*ServiceResource) Update

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

type ServiceResourceModel

type ServiceResourceModel struct {
	Name        string            `tfsdk:"name"`
	DisplayName types.String      `tfsdk:"display_name"`
	Project     string            `tfsdk:"project"`
	Description types.String      `tfsdk:"description"`
	Annotations map[string]string `tfsdk:"annotations"`
	Labels      Labels            `tfsdk:"label"`
	Status      types.Object      `tfsdk:"status"`
}

ServiceResourceModel describes the ServiceResource data model.

func (ServiceResourceModel) ToManifest

type ServiceResourceStatusModel

type ServiceResourceStatusModel struct {
	SLOCount types.Int64 `tfsdk:"slo_count"`
}

Jump to

Keyboard shortcuts

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