provider

package
v2.16.4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: AGPL-3.0 Imports: 58 Imported by: 0

Documentation

Overview

The provider package implements the Constellation Terraform provider's "provider" resource, which is the main entrypoint for Terraform to interact with the provider.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(version string) func() provider.Provider

New creates a new provider, based on a version.

func NewAttestationDataSource

func NewAttestationDataSource() datasource.DataSource

NewAttestationDataSource creates a new attestation data source.

func NewClusterResource

func NewClusterResource() resource.Resource

NewClusterResource creates a new cluster resource.

func NewImageDataSource

func NewImageDataSource() datasource.DataSource

NewImageDataSource creates a new data source for fetching Constellation OS images from the Versions-API.

Types

type AttestationDataSource

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

AttestationDataSource defines the data source implementation.

func (*AttestationDataSource) Configure

Configure configures the data source.

func (*AttestationDataSource) Metadata

Metadata returns the metadata for the data source.

func (*AttestationDataSource) Read

Read reads from the data source.

func (*AttestationDataSource) Schema

Schema returns the schema for the data source.

func (*AttestationDataSource) ValidateConfig

ValidateConfig validates the configuration for the image data source.

type AttestationDataSourceModel

type AttestationDataSourceModel struct {
	CSP                types.String `tfsdk:"csp"`
	AttestationVariant types.String `tfsdk:"attestation_variant"`
	Image              types.Object `tfsdk:"image"`
	MaaURL             types.String `tfsdk:"maa_url"`
	Insecure           types.Bool   `tfsdk:"insecure"`
	Attestation        types.Object `tfsdk:"attestation"`
}

AttestationDataSourceModel describes the data source data model.

type ClusterResource

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

ClusterResource defines the resource implementation.

func (*ClusterResource) Configure

Configure configures the resource.

func (*ClusterResource) Create

Create is called when the resource is created.

func (*ClusterResource) Delete

Delete is called when the resource is destroyed.

func (*ClusterResource) ImportState

ImportState imports to the resource.

func (*ClusterResource) Metadata

Metadata returns the metadata of the resource.

func (*ClusterResource) ModifyPlan

ModifyPlan is called when the resource is planned for creation, updates, or deletion. This allows to set pre-apply warnings and errors.

func (*ClusterResource) Read

Read is called when the resource is read or refreshed.

func (*ClusterResource) Schema

Schema returns the schema of the resource.

func (*ClusterResource) Update

Update is called when the resource is updated.

func (*ClusterResource) ValidateConfig

ValidateConfig validates the configuration for the resource.

type ClusterResourceModel

type ClusterResourceModel struct {
	Name                 types.String `tfsdk:"name"`
	CSP                  types.String `tfsdk:"csp"`
	UID                  types.String `tfsdk:"uid"`
	Image                types.Object `tfsdk:"image"`
	KubernetesVersion    types.String `tfsdk:"kubernetes_version"`
	MicroserviceVersion  types.String `tfsdk:"constellation_microservice_version"`
	OutOfClusterEndpoint types.String `tfsdk:"out_of_cluster_endpoint"`
	InClusterEndpoint    types.String `tfsdk:"in_cluster_endpoint"`
	ExtraMicroservices   types.Object `tfsdk:"extra_microservices"`
	APIServerCertSANs    types.List   `tfsdk:"api_server_cert_sans"`
	NetworkConfig        types.Object `tfsdk:"network_config"`
	MasterSecret         types.String `tfsdk:"master_secret"`
	MasterSecretSalt     types.String `tfsdk:"master_secret_salt"`
	MeasurementSalt      types.String `tfsdk:"measurement_salt"`
	InitSecret           types.String `tfsdk:"init_secret"`
	LicenseID            types.String `tfsdk:"license_id"`
	Attestation          types.Object `tfsdk:"attestation"`
	GCP                  types.Object `tfsdk:"gcp"`
	Azure                types.Object `tfsdk:"azure"`
	OpenStack            types.Object `tfsdk:"openstack"`

	OwnerID    types.String `tfsdk:"owner_id"`
	ClusterID  types.String `tfsdk:"cluster_id"`
	KubeConfig types.String `tfsdk:"kubeconfig"`
}

ClusterResourceModel describes the resource data model.

type ConstellationProvider

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

ConstellationProvider is the provider implementation.

func (*ConstellationProvider) Configure

Configure is called when the provider block is initialized, and conventionally used to setup any API clients or other resources required for the provider.

func (*ConstellationProvider) DataSources

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

DataSources lists the data sources implemented by the provider.

func (*ConstellationProvider) Metadata

Metadata returns the Providers name and version upon request.

func (*ConstellationProvider) Resources

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

Resources lists the resources implemented by the provider.

func (*ConstellationProvider) Schema

Schema defines the HCL schema of the provider, i.e. what attributes it has and what they are used for.

type ConstellationProviderModel

type ConstellationProviderModel struct{}

ConstellationProviderModel is the provider data model.

type ImageDataSource

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

ImageDataSource defines the data source implementation for the image data source. It is used to retrieve the Constellation OS image reference for a given CSP and Attestation Variant.

func (*ImageDataSource) Configure

Configure configures the data source.

func (*ImageDataSource) Metadata

Metadata returns the metadata for the image data source.

func (*ImageDataSource) Read

Read reads from the data source.

func (*ImageDataSource) Schema

Schema returns the schema for the image data source.

func (*ImageDataSource) ValidateConfig

ValidateConfig validates the configuration for the image data source.

type ImageDataSourceModel

type ImageDataSourceModel struct {
	AttestationVariant types.String `tfsdk:"attestation_variant"`
	Version            types.String `tfsdk:"version"`
	CSP                types.String `tfsdk:"csp"`
	MarketplaceImage   types.Bool   `tfsdk:"marketplace_image"`
	Region             types.String `tfsdk:"region"`
	Image              types.Object `tfsdk:"image"`
}

ImageDataSourceModel defines the image data source's data model.

Jump to

Keyboard shortcuts

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