model

package
v0.133.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthSettingsAttrTypes = map[string]attr.Type{
	"saml": types.ObjectType{AttrTypes: samlAttrTypes},
}
View Source
var ConfigAttrTypes = map[string]attr.Type{
	"version":        types.StringType,
	"admin_password": types.StringType,
	"opensearch":     types.ObjectType{AttrTypes: OpenSearchSubConfigAttrTypes},
	"dashboards":     types.ObjectType{AttrTypes: DashboardsSubConfigAttrTypes},
	"access":         types.ObjectType{AttrTypes: accessAttrTypes},
}
View Source
var DashboardNodeType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"name":             types.StringType,
		"resources":        types.ObjectType{AttrTypes: NodeResourceAttrTypes},
		"hosts_count":      types.Int64Type,
		"zone_ids":         types.SetType{ElemType: types.StringType},
		"subnet_ids":       types.ListType{ElemType: types.StringType},
		"assign_public_ip": types.BoolType,
	},
}
View Source
var DashboardsSubConfigAttrTypes = map[string]attr.Type{
	"node_groups": types.ListType{ElemType: DashboardNodeType},
}
View Source
var HostType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"fqdn":             types.StringType,
		"type":             types.StringType,
		"roles":            types.SetType{ElemType: types.StringType},
		"assign_public_ip": types.BoolType,
		"zone":             types.StringType,
		"subnet_id":        types.StringType,
		"node_group":       types.StringType,
	},
}
View Source
var MaintenanceWindowAttrTypes = map[string]attr.Type{
	"type": types.StringType,
	"day":  types.StringType,
	"hour": types.Int64Type,
}
View Source
var NodeResourceAttrTypes = map[string]attr.Type{
	"resource_preset_id": types.StringType,
	"disk_size":          types.Int64Type,
	"disk_type_id":       types.StringType,
}
View Source
var OpenSearchNodeType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"name":             types.StringType,
		"resources":        types.ObjectType{AttrTypes: NodeResourceAttrTypes},
		"hosts_count":      types.Int64Type,
		"zone_ids":         types.SetType{ElemType: types.StringType},
		"subnet_ids":       types.ListType{ElemType: types.StringType},
		"assign_public_ip": types.BoolType,
		"roles":            types.SetType{ElemType: types.StringType},
	},
}
View Source
var OpenSearchSubConfigAttrTypes = map[string]attr.Type{
	"node_groups": types.ListType{ElemType: OpenSearchNodeType},
	"plugins":     types.SetType{ElemType: types.StringType},
}

Functions

func AuthSettingsToState added in v0.127.0

func AuthSettingsToState(ctx context.Context, authSettings *opensearch.AuthSettings, state types.Object) (types.Object, diag.Diagnostics)

func ClusterToState

func ClusterToState(ctx context.Context, cluster *opensearch.Cluster, state *OpenSearch) diag.Diagnostics

func GetGroupByName

func GetGroupByName[T withName](groups []T) map[string]T

func HostsToState

func HostsToState(ctx context.Context, hosts []*opensearch.Host) (types.List, diag.Diagnostics)

func ParseGenerics

func ParseGenerics[T any, V any](ctx context.Context, plan, state T, parse func(context.Context, T) (V, diag.Diagnostics)) (V, V, diag.Diagnostics)

func SAMLToState added in v0.127.0

func SAMLToState(ctx context.Context, saml *opensearch.SAMLSettings, state *AuthSettings) (types.Object, diag.Diagnostics)

Types

type Access

type Access struct {
	DataTransfer types.Bool `tfsdk:"data_transfer"`
	Serverless   types.Bool `tfsdk:"serverless"`
}

func ParseAccess

func ParseAccess(ctx context.Context, state *Config) (*Access, diag.Diagnostics)

type AuthSettings added in v0.127.0

type AuthSettings struct {
	SAML types.Object `tfsdk:"saml"`
}

func AuthSettingsFromState added in v0.127.0

func AuthSettingsFromState(ctx context.Context, state types.Object) (*AuthSettings, diag.Diagnostics)

type Config

type Config struct {
	Version       types.String `tfsdk:"version"`
	AdminPassword types.String `tfsdk:"admin_password"`
	OpenSearch    types.Object `tfsdk:"opensearch"`
	Dashboards    types.Object `tfsdk:"dashboards"`
	Access        types.Object `tfsdk:"access"`
}

func ParseConfig

func ParseConfig(ctx context.Context, state *OpenSearch) (*Config, diag.Diagnostics)

type DashboardNode

type DashboardNode struct {
	Name           types.String `tfsdk:"name"`
	Resources      types.Object `tfsdk:"resources"`
	HostsCount     types.Int64  `tfsdk:"hosts_count"`
	ZoneIDs        types.Set    `tfsdk:"zone_ids"`
	SubnetIDs      types.List   `tfsdk:"subnet_ids"`
	AssignPublicIP types.Bool   `tfsdk:"assign_public_ip"`
}

func (DashboardNode) GetResources

func (n DashboardNode) GetResources() types.Object

type DashboardsSubConfig

type DashboardsSubConfig struct {
	NodeGroups types.List `tfsdk:"node_groups"`
}

func ParseDashboardSubConfig

func ParseDashboardSubConfig(ctx context.Context, state *Config) (*DashboardsSubConfig, diag.Diagnostics)

type Host

type Host struct {
	FQDN           types.String `tfsdk:"fqdn"`
	Type           types.String `tfsdk:"type"`
	Roles          types.Set    `tfsdk:"roles"`
	AssignPublicIP types.Bool   `tfsdk:"assign_public_ip"`
	Zone           types.String `tfsdk:"zone"`
	SubnetID       types.String `tfsdk:"subnet_id"`
	NodeGroup      types.String `tfsdk:"node_group"`
}

type MaintenanceWindow

type MaintenanceWindow struct {
	Type types.String `tfsdk:"type"`
	Day  types.String `tfsdk:"day"`
	Hour types.Int64  `tfsdk:"hour"`
}

func ParseMaintenanceWindow

func ParseMaintenanceWindow(ctx context.Context, model *OpenSearch) (*MaintenanceWindow, diag.Diagnostics)

type NodeResource

type NodeResource struct {
	ResourcePresetID types.String `tfsdk:"resource_preset_id"`
	DiskSize         types.Int64  `tfsdk:"disk_size"`
	DiskTypeID       types.String `tfsdk:"disk_type_id"`
}

func ParseNodeResource

func ParseNodeResource(ctx context.Context, ng WithResources) (*NodeResource, diag.Diagnostics)

type OpenSearch

type OpenSearch struct {
	Timeouts           timeouts.Value `tfsdk:"timeouts"`
	ID                 types.String   `tfsdk:"id"`
	ClusterID          types.String   `tfsdk:"cluster_id"`
	FolderID           types.String   `tfsdk:"folder_id"`
	CreatedAt          types.String   `tfsdk:"created_at"`
	Name               types.String   `tfsdk:"name"`
	Description        types.String   `tfsdk:"description"`
	Labels             types.Map      `tfsdk:"labels"`
	Environment        types.String   `tfsdk:"environment"`
	Config             types.Object   `tfsdk:"config"`
	Hosts              types.List     `tfsdk:"hosts"`
	NetworkID          types.String   `tfsdk:"network_id"`
	Health             types.String   `tfsdk:"health"`
	Status             types.String   `tfsdk:"status"`
	SecurityGroupIDs   types.Set      `tfsdk:"security_group_ids"`
	ServiceAccountID   types.String   `tfsdk:"service_account_id"`
	DeletionProtection types.Bool     `tfsdk:"deletion_protection"`
	MaintenanceWindow  types.Object   `tfsdk:"maintenance_window"`
	AuthSettings       types.Object   `tfsdk:"auth_settings"`
}

type OpenSearchNode

type OpenSearchNode struct {
	Name           types.String `tfsdk:"name"`
	Resources      types.Object `tfsdk:"resources"`
	HostsCount     types.Int64  `tfsdk:"hosts_count"`
	ZoneIDs        types.Set    `tfsdk:"zone_ids"`
	SubnetIDs      types.List   `tfsdk:"subnet_ids"`
	AssignPublicIP types.Bool   `tfsdk:"assign_public_ip"`
	Roles          types.Set    `tfsdk:"roles"`
}

func (OpenSearchNode) GetResources

func (n OpenSearchNode) GetResources() types.Object

type OpenSearchSubConfig

type OpenSearchSubConfig struct {
	NodeGroups types.List `tfsdk:"node_groups"`
	Plugins    types.Set  `tfsdk:"plugins"`
}

func ParseOpenSearchSubConfig

func ParseOpenSearchSubConfig(ctx context.Context, state *Config) (OpenSearchSubConfig, diag.Diagnostics)

type SAML added in v0.127.0

type SAML struct {
	Enabled                types.Bool   `tfsdk:"enabled"`
	IdpEntityID            types.String `tfsdk:"idp_entity_id"`
	IdpMetadataFileContent types.String `tfsdk:"idp_metadata_file_content"`
	SpEntityID             types.String `tfsdk:"sp_entity_id"`
	DashboardsUrl          types.String `tfsdk:"dashboards_url"`
	RolesKey               types.String `tfsdk:"roles_key"`
	SubjectKey             types.String `tfsdk:"subject_key"`
}

func SAMLFromState added in v0.127.0

func SAMLFromState(ctx context.Context, state types.Object) (*SAML, diag.Diagnostics)

type WithResources

type WithResources interface {
	GetResources() types.Object
}

Jump to

Keyboard shortcuts

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