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 ¶
- func New(version string) func() provider.Provider
- func NewAttestationDataSource() datasource.DataSource
- func NewClusterResource() resource.Resource
- func NewImageDataSource() datasource.DataSource
- type AttestationDataSource
- func (d *AttestationDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, ...)
- func (d *AttestationDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, ...)
- func (d *AttestationDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *AttestationDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse)
- func (d *AttestationDataSource) ValidateConfig(ctx context.Context, req datasource.ValidateConfigRequest, ...)
- type AttestationDataSourceModel
- type ClusterResource
- func (r *ClusterResource) Configure(_ context.Context, req resource.ConfigureRequest, ...)
- func (r *ClusterResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *ClusterResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *ClusterResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *ClusterResource) Metadata(_ context.Context, req resource.MetadataRequest, ...)
- func (r *ClusterResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, ...)
- func (r *ClusterResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *ClusterResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *ClusterResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- func (r *ClusterResource) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, ...)
- type ClusterResourceModel
- type ConstellationProvider
- func (p *ConstellationProvider) Configure(ctx context.Context, req provider.ConfigureRequest, ...)
- func (p *ConstellationProvider) DataSources(_ context.Context) []func() datasource.DataSource
- func (p *ConstellationProvider) Metadata(_ context.Context, _ provider.MetadataRequest, resp *provider.MetadataResponse)
- func (p *ConstellationProvider) Resources(_ context.Context) []func() resource.Resource
- func (p *ConstellationProvider) Schema(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse)
- type ConstellationProviderModel
- type ImageDataSource
- func (d *ImageDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, ...)
- func (d *ImageDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, ...)
- func (d *ImageDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *ImageDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse)
- func (d *ImageDataSource) ValidateConfig(ctx context.Context, req datasource.ValidateConfigRequest, ...)
- type ImageDataSourceModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAttestationDataSource ¶
func NewAttestationDataSource() datasource.DataSource
NewAttestationDataSource creates a new attestation data source.
func NewClusterResource ¶
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 ¶
func (d *AttestationDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse)
Configure configures the data source.
func (*AttestationDataSource) Metadata ¶
func (d *AttestationDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata returns the metadata for the data source.
func (*AttestationDataSource) Read ¶
func (d *AttestationDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
Read reads from the data source.
func (*AttestationDataSource) Schema ¶
func (d *AttestationDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse)
Schema returns the schema for the data source.
func (*AttestationDataSource) ValidateConfig ¶
func (d *AttestationDataSource) ValidateConfig(ctx context.Context, req datasource.ValidateConfigRequest, resp *datasource.ValidateConfigResponse)
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 ¶
func (r *ClusterResource) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure configures the resource.
func (*ClusterResource) Create ¶
func (r *ClusterResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
Create is called when the resource is created.
func (*ClusterResource) Delete ¶
func (r *ClusterResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
Delete is called when the resource is destroyed.
func (*ClusterResource) ImportState ¶
func (r *ClusterResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState imports to the resource.
func (*ClusterResource) Metadata ¶
func (r *ClusterResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata returns the metadata of the resource.
func (*ClusterResource) ModifyPlan ¶
func (r *ClusterResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse)
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 ¶
func (r *ClusterResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
Read is called when the resource is read or refreshed.
func (*ClusterResource) Schema ¶
func (r *ClusterResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
Schema returns the schema of the resource.
func (*ClusterResource) Update ¶
func (r *ClusterResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Update is called when the resource is updated.
func (*ClusterResource) ValidateConfig ¶
func (r *ClusterResource) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, resp *resource.ValidateConfigResponse)
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 ¶
func (p *ConstellationProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse)
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 ¶
func (p *ConstellationProvider) Metadata(_ context.Context, _ provider.MetadataRequest, resp *provider.MetadataResponse)
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 ¶
func (p *ConstellationProvider) Schema(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse)
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 ¶
func (d *ImageDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse)
Configure configures the data source.
func (*ImageDataSource) Metadata ¶
func (d *ImageDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata returns the metadata for the image data source.
func (*ImageDataSource) Read ¶
func (d *ImageDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
Read reads from the data source.
func (*ImageDataSource) Schema ¶
func (d *ImageDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse)
Schema returns the schema for the image data source.
func (*ImageDataSource) ValidateConfig ¶
func (d *ImageDataSource) ValidateConfig(ctx context.Context, req datasource.ValidateConfigRequest, resp *datasource.ValidateConfigResponse)
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.