Documentation ¶
Overview ¶
Package frameworkprovider provides a provider.Provider implementation for managing Nobl9 resources. It is built using the terraform-plugin-framework.
Index ¶
- func New(version string) provider.Provider
- func NewServiceResource() resource.Resource
- type LabelBlockModel
- type Labels
- type Provider
- func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest, ...)
- func (p *Provider) DataSources(context.Context) []func() datasource.DataSource
- func (p *Provider) Metadata(_ context.Context, _ provider.MetadataRequest, resp *provider.MetadataResponse)
- func (p *Provider) Resources(context.Context) []func() resource.Resource
- func (p *Provider) Schema(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse)
- type ProviderModel
- type ServiceResource
- func (s *ServiceResource) Configure(_ context.Context, req resource.ConfigureRequest, ...)
- func (s *ServiceResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (s *ServiceResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (s *ServiceResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (s *ServiceResource) Metadata(_ context.Context, req resource.MetadataRequest, ...)
- func (s *ServiceResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (s *ServiceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
- func (s *ServiceResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type ServiceResourceModel
- type ServiceResourceStatusModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServiceResource ¶
Types ¶
type LabelBlockModel ¶
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 ¶
ToManifest converts Labels to v1alpha.Labels.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider defines the provider implementation.
func (*Provider) Configure ¶
func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse)
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 (p *Provider) Metadata(_ context.Context, _ provider.MetadataRequest, resp *provider.MetadataResponse)
func (*Provider) Schema ¶
func (p *Provider) Schema(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse)
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 (s *ServiceResource) Configure( _ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse, )
func (*ServiceResource) Create ¶
func (s *ServiceResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
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 ¶
func (s *ServiceResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
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 ¶
func (s *ServiceResource) ImportState( ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse, )
ImportState is called when the provider must import the resource's state.
func (*ServiceResource) Metadata ¶
func (s *ServiceResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata implements resource.Resource.Metadata function.
func (*ServiceResource) Read ¶
func (s *ServiceResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
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 ¶
func (s *ServiceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
Schema implements resource.Resource.Schema function.
func (*ServiceResource) Update ¶
func (s *ServiceResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
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 ¶
func (s ServiceResourceModel) ToManifest(ctx context.Context) v1alphaService.Service