opensearch

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 21 Imported by: 0

README

OpenSearch

Parity grade: A · SDK aws-sdk-go-v2/service/opensearch@v1.59.0 · last audited 2026-07-12 (cc66a883)

Coverage

Metric Value
Operations audited 13 (12 ok, 1 partial)
Feature families 8 (8 deferred)
Known gaps 1
Deferred items 8
Resource leaks clean
Known gaps
  • domain-level connections/VPC-endpoints/packages/applications/serverless families not wire-verified against SDK this pass -- file follow-up bd issue for next sweep
Deferred
  • cross_cluster_connections
  • vpc_endpoints
  • packages
  • applications
  • reserved_instances
  • …and 3 more — see PARITY.md

More

Documentation

Index

Constants

View Source
const (
	EngineStub   = "stub"
	EngineDocker = "docker"
)

Engine mode constants.

Variables

View Source
var (
	ErrDomainNotFound           = errors.New("ResourceNotFoundException")
	ErrDomainAlreadyExists      = errors.New("ResourceAlreadyExistsException")
	ErrInvalidParameter         = errors.New("ValidationException")
	ErrValidation               = errors.New("ValidationException")
	ErrConnectionNotFound       = errors.New("ResourceNotFoundException")
	ErrDataSourceNotFound       = errors.New("ResourceNotFoundException")
	ErrDataSourceAlreadyExists  = errors.New("ResourceAlreadyExistsException")
	ErrPackageNotFound          = errors.New("ResourceNotFoundException")
	ErrApplicationNotFound      = errors.New("ResourceNotFoundException")
	ErrApplicationAlreadyExists = errors.New("ResourceAlreadyExistsException")
)

Errors returned by the OpenSearch backend.

View Source
var ErrNilAppContext = errors.New("nil AppContext passed to OpenSearch Provider.Init")

ErrNilAppContext is returned by Init when a nil AppContext is passed.

Functions

This section is empty.

Types

type AdditionalLimit

type AdditionalLimit struct {
	LimitName   string   `json:"LimitName"`
	LimitValues []string `json:"LimitValues"`
}

AdditionalLimit is an additional named limit for an instance type.

type AdvancedSecurityOptions

type AdvancedSecurityOptions struct {
	SAMLOptions                 *SAMLOptionsInput `json:"samlOptions,omitempty"`
	AnonymousAuthEnabled        bool              `json:"anonymousAuthEnabled,omitempty"`
	Enabled                     bool              `json:"enabled"`
	InternalUserDatabaseEnabled bool              `json:"internalUserDatabaseEnabled,omitempty"`
}

AdvancedSecurityOptions holds fine-grained access control settings.

type AppConfig

type AppConfig struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

AppConfig represents an application configuration key-value pair.

type AppDataSource

type AppDataSource struct {
	DataSourceArn string `json:"dataSourceArn"`
}

AppDataSource represents a data source linked to an application.

type AppSetting

type AppSetting struct {
	Key   string `json:"Key"`
	Value string `json:"Value"`
}

AppSetting is a key-value pair for default application settings.

type Application

type Application struct {
	ID          string          `json:"id"`
	Name        string          `json:"name"`
	ARN         string          `json:"arn"`
	AppConfigs  []AppConfig     `json:"appConfigs"`
	DataSources []AppDataSource `json:"dataSources"`
}

Application represents an OpenSearch UI application.

type AuthorizedPrincipal

type AuthorizedPrincipal struct {
	Principal     string `json:"principal"`
	PrincipalType string `json:"principalType"`
}

AuthorizedPrincipal represents an authorized principal for VPC endpoint access.

type AutoTune

type AutoTune struct {
	AutoTuneType    string          `json:"AutoTuneType"`
	AutoTuneDetails AutoTuneDetails `json:"AutoTuneDetails"`
}

AutoTune is the response shape for one auto-tune item.

type AutoTuneConfig

type AutoTuneConfig struct {
	DesiredState         string                        `json:"DesiredState"`
	DomainName           string                        `json:"-"`
	MaintenanceSchedules []AutoTuneMaintenanceSchedule `json:"MaintenanceSchedules,omitempty"`
}

AutoTuneConfig stores auto-tune configuration for a domain.

type AutoTuneDetails

type AutoTuneDetails struct {
	ScheduledAutoTuneDetails ScheduledAutoTuneDetails `json:"ScheduledAutoTuneDetails"`
}

AutoTuneDetails holds the state details of an auto-tune entry.

type AutoTuneDuration

type AutoTuneDuration struct {
	Unit  string `json:"Unit"`
	Value int    `json:"Value"`
}

AutoTuneDuration represents a duration for a maintenance window.

type AutoTuneMaintenanceSchedule

type AutoTuneMaintenanceSchedule struct {
	CronExpression string           `json:"CronExpressionForRecurrence,omitempty"`
	Duration       AutoTuneDuration `json:"Duration"`
	StartAt        float64          `json:"StartAt,omitempty"`
}

AutoTuneMaintenanceSchedule represents a maintenance window.

type BlueGreenDeploymentOptions

type BlueGreenDeploymentOptions struct {
	Enabled bool `json:"enabled"`
}

BlueGreenDeploymentOptions holds blue-green deployment settings.

type ClusterConfig

type ClusterConfig struct {
	ZoneAwarenessConfig        *ZoneAwarenessConfig        `json:"zoneAwarenessConfig,omitempty"`
	BlueGreenDeploymentOptions *BlueGreenDeploymentOptions `json:"blueGreenDeploymentOptions,omitempty"`
	InstanceType               string                      `json:"instanceType"`
	DedicatedMasterType        string                      `json:"dedicatedMasterType,omitempty"`
	WarmType                   string                      `json:"warmType,omitempty"`
	InstanceCount              int                         `json:"instanceCount"`
	DedicatedMasterCount       int                         `json:"dedicatedMasterCount,omitempty"`
	WarmCount                  int                         `json:"warmCount,omitempty"`
	DedicatedMasterEnabled     bool                        `json:"dedicatedMasterEnabled,omitempty"`
	ZoneAwarenessEnabled       bool                        `json:"zoneAwarenessEnabled,omitempty"`
	WarmEnabled                bool                        `json:"warmEnabled,omitempty"`
	ColdStorageEnabled         bool                        `json:"coldStorageEnabled,omitempty"`
	MultiAZWithStandbyEnabled  bool                        `json:"multiAZWithStandbyEnabled,omitempty"`
}

ClusterConfig represents the cluster configuration for an OpenSearch domain.

type CognitoOptions

type CognitoOptions struct {
	IdentityPoolID string `json:"identityPoolId,omitempty"`
	RoleARN        string `json:"roleArn,omitempty"`
	UserPoolID     string `json:"userPoolId,omitempty"`
	Enabled        bool   `json:"enabled"`
}

CognitoOptions holds Cognito configuration for Kibana authentication.

type CreateDomainInput

type CreateDomainInput struct {
	EBSOptions                  *EBSOptions
	SnapshotOptions             *SnapshotOptions
	EncryptionAtRestOptions     *EncryptionAtRestOptions
	NodeToNodeEncryptionOptions *NodeToNodeEncryptionOptions
	DomainEndpointOptions       *DomainEndpointOptions
	AdvancedSecurityOptions     *AdvancedSecurityOptions
	VPCOptions                  *VPCOptions
	CognitoOptions              *CognitoOptions
	OffPeakWindowOptions        *OffPeakWindowOptions
	IdentityCenterOptions       *IdentityCenterOptions
	EnableSoftwareUpdateOptions *EnableSoftwareUpdateOptions
	LogPublishingOptions        map[string]*LogPublishingOption
	Tags                        map[string]string
	Name                        string
	EngineVersion               string
	AccessPolicies              string
	ClusterConfig               ClusterConfig
}

CreateDomainInput holds all options for creating a new OpenSearch domain.

type DNSRegistrar

type DNSRegistrar interface {
	Register(hostname string)
	Deregister(hostname string)
}

DNSRegistrar can register and deregister hostnames with an embedded DNS server.

type DataSource

type DataSource struct {
	Name           string `json:"name"`
	Description    string `json:"description"`
	DataSourceType string `json:"dataSourceType"`
	// DomainName identifies the owning domain and is used only to key the
	// pkgs/store composite table (domainName#name); it is never serialized on
	// the wire, matching how the domain name was already implied by the
	// outer map key before the pkgs/store conversion.
	DomainName string `json:"-"`
}

DataSource represents a data source attached to an OpenSearch domain.

type DirectQueryDataSource

type DirectQueryDataSource struct {
	Name           string   `json:"name"`
	Description    string   `json:"description"`
	DataSourceType string   `json:"dataSourceType"`
	DataSourceArn  string   `json:"dataSourceArn"`
	OpenSearchArns []string `json:"openSearchArns"`
}

DirectQueryDataSource represents a direct-query data source.

type Domain

type Domain struct {
	ProcessingUntil             time.Time                       `json:"processingUntil,omitzero"`
	Tags                        *tags.Tags                      `json:"tags,omitempty"`
	SnapshotOptions             *SnapshotOptions                `json:"snapshotOptions,omitempty"`
	NodeToNodeEncryptionOptions *NodeToNodeEncryptionOptions    `json:"nodeToNodeEncryptionOptions,omitempty"`
	DomainEndpointOptions       *DomainEndpointOptions          `json:"domainEndpointOptions,omitempty"`
	AdvancedSecurityOptions     *AdvancedSecurityOptions        `json:"advancedSecurityOptions,omitempty"`
	VPCOptions                  *VPCOptions                     `json:"vpcOptions,omitempty"`
	CognitoOptions              *CognitoOptions                 `json:"cognitoOptions,omitempty"`
	OffPeakWindowOptions        *OffPeakWindowOptions           `json:"offPeakWindowOptions,omitempty"`
	IdentityCenterOptions       *IdentityCenterOptions          `json:"identityCenterOptions,omitempty"`
	EnableSoftwareUpdateOptions *EnableSoftwareUpdateOptions    `json:"enableSoftwareUpdateOptions,omitempty"`
	LogPublishingOptions        map[string]*LogPublishingOption `json:"logPublishingOptions,omitempty"`
	EBSOptions                  *EBSOptions                     `json:"ebsOptions,omitempty"`
	EncryptionAtRestOptions     *EncryptionAtRestOptions        `json:"encryptionAtRestOptions,omitempty"`
	ServiceSoftware             *ServiceSoftwareOptions         `json:"serviceSoftware,omitempty"`
	Name                        string                          `json:"name"`
	ARN                         string                          `json:"arn"`
	// DomainID is the AWS-format unique domain identifier ("{accountId}/{name}"),
	// a required field on DomainStatus (see aws-sdk-go-v2/service/opensearch
	// types.DomainStatus.DomainId) that real AWS always returns alongside ARN.
	DomainID         string        `json:"domainID"`
	EngineVersion    string        `json:"engineVersion"`
	Endpoint         string        `json:"endpoint"`
	Status           string        `json:"status"`
	LastChangeID     string        `json:"lastChangeID,omitempty"`
	ProcessingStatus string        `json:"processingStatus,omitempty"`
	AccessPolicies   string        `json:"accessPolicies,omitempty"`
	ClusterConfig    ClusterConfig `json:"clusterConfig"`
	Created          bool          `json:"created,omitempty"`
	Deleted          bool          `json:"deleted,omitempty"`
}

Domain represents an OpenSearch domain.

type DomainEndpointOptions

type DomainEndpointOptions struct {
	CustomEndpointCertificateArn string `json:"customEndpointCertificateArn,omitempty"`
	CustomEndpoint               string `json:"customEndpoint,omitempty"`
	TLSSecurityPolicy            string `json:"tlsSecurityPolicy,omitempty"`
	EnforceHTTPS                 bool   `json:"enforceHTTPS,omitempty"`
	CustomEndpointEnabled        bool   `json:"customEndpointEnabled,omitempty"`
}

DomainEndpointOptions holds HTTPS and custom endpoint settings.

type DomainEntry

type DomainEntry struct {
	Name          string
	EngineVersion string
}

DomainEntry holds the name and engine version of a domain, used for list responses.

type DomainIndex

type DomainIndex struct {
	Mappings map[string]any `json:"Mappings,omitempty"`
	Settings map[string]any `json:"Settings,omitempty"`
	Aliases  map[string]any `json:"Aliases,omitempty"`
	// Documents holds the real per-index document store keyed by document ID.
	Documents   map[string]map[string]any `json:"Documents,omitempty"`
	IndexName   string                    `json:"IndexName"`
	IndexStatus string                    `json:"IndexStatus"`
	// DomainName identifies the owning domain and is used only to key the
	// pkgs/store composite table (domainName#indexName); it is never
	// serialized on the wire, matching how the domain name was already
	// implied by the outer map key before the pkgs/store conversion.
	DomainName string `json:"-"`
	// DocumentCount is the number of documents currently stored in the index.
	DocumentCount int `json:"DocumentCount"`
}

DomainIndex represents an OpenSearch index, including its stored documents.

type DomainMaintenance

type DomainMaintenance struct {
	MaintenanceID string  `json:"MaintenanceId"`
	DomainName    string  `json:"DomainName"`
	Action        string  `json:"Action"`
	NodeID        string  `json:"NodeId,omitempty"`
	Status        string  `json:"Status"`
	StatusMessage string  `json:"StatusMessage,omitempty"`
	CreatedAt     float64 `json:"CreatedAt"`
	UpdatedAt     float64 `json:"UpdatedAt"`
}

DomainMaintenance represents a maintenance action on a domain.

type DomainPackageDetails

type DomainPackageDetails struct {
	PackageID  string `json:"packageId"`
	DomainName string `json:"domainName"`
	State      string `json:"state"`
}

DomainPackageDetails holds details about a package associated with a domain.

type DryRunStatus

type DryRunStatus struct {
	DryRunID           string           `json:"DryRunId"`
	DryRunStatus       string           `json:"DryRunStatus"`
	CreationDate       string           `json:"CreationDate"`
	UpdateDate         string           `json:"UpdateDate"`
	DomainName         string           `json:"-"`
	ValidationFailures []map[string]any `json:"ValidationFailures"`
}

DryRunStatus holds dry-run progress state for a domain.

type EBSOptions

type EBSOptions struct {
	VolumeType string `json:"volumeType,omitempty"`
	KMSKeyID   string `json:"kmsKeyId,omitempty"`
	VolumeSize int    `json:"volumeSize,omitempty"`
	IOPS       int    `json:"iops,omitempty"`
	Throughput int    `json:"throughput,omitempty"`
	EBSEnabled bool   `json:"ebsEnabled"`
}

EBSOptions represents EBS volume settings for an OpenSearch domain.

type EnableSoftwareUpdateOptions

type EnableSoftwareUpdateOptions struct {
	AutoSoftwareUpdateEnabled bool `json:"autoSoftwareUpdateEnabled"`
}

EnableSoftwareUpdateOptions holds settings for automatic software updates.

type EncryptionAtRestOptions

type EncryptionAtRestOptions struct {
	KMSKeyID string `json:"kmsKeyId,omitempty"`
	Enabled  bool   `json:"enabled"`
}

EncryptionAtRestOptions holds encryption at rest settings.

type EngineConfig

type EngineConfig interface {
	GetOpenSearchEngine() string
}

EngineConfig is the interface for accessing the OpenSearch engine mode configuration.

type Handler

type Handler struct {
	Backend   StorageBackend
	AccountID string
	Region    string
}

Handler is the HTTP handler for OpenSearch operations.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new OpenSearch Handler.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this OpenSearch instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation returns the operation name from a request.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource returns the primary resource identifier from the request path.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns supported operations.

func (*Handler) Handle

func (h *Handler) Handle(c *echo.Context) error

Handle satisfies the Echo handler interface.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo HandlerFunc for this service.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears the handler's backend state.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a matcher that selects OpenSearch requests by path prefix.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler for the OpenSearch service.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

type IdentityCenterOptions

type IdentityCenterOptions struct {
	IdentityCenterInstanceARN    string `json:"identityCenterInstanceARN,omitempty"`
	IdentityCenterApplicationARN string `json:"identityCenterApplicationARN,omitempty"`
	IdentityStoreID              string `json:"identityStoreId,omitempty"`
	RolesKey                     string `json:"rolesKey,omitempty"`
	SubjectKey                   string `json:"subjectKey,omitempty"`
	EnabledAPIAccess             bool   `json:"enabledAPIAccess"`
}

IdentityCenterOptions holds IAM Identity Center integration settings. Field names match the current aws-sdk-go-v2 IdentityCenterOptions/-Input shapes (IdentityCenterInstanceARN/RolesKey/SubjectKey), which superseded the older IamIdentityCenterOptions shape (IamIdentityCenterArn/IamRoleFor...) that AWS no longer wires into CreateDomain/UpdateDomainConfig.

type InMemoryBackend

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

InMemoryBackend is the in-memory store for OpenSearch domains.

Most resource collections are *store.Table[T] registered on b.registry -- see store_setup.go's registerAllTables doc for the full clean/dirty split and the reasoning behind the handful of fields left as plain maps.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new InMemoryBackend.

func (*InMemoryBackend) AcceptInboundConnection

func (b *InMemoryBackend) AcceptInboundConnection(connectionID string) (*InboundConnection, error)

AcceptInboundConnection accepts an inbound cross-cluster connection by ID.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the AWS account ID this backend is configured for.

func (*InMemoryBackend) AddDataSource

func (b *InMemoryBackend) AddDataSource(
	domainName, name, description, dataSourceType string,
) (string, error)

AddDataSource adds a data source to a domain.

func (*InMemoryBackend) AddDirectQueryDataSource

func (b *InMemoryBackend) AddDirectQueryDataSource(
	name, description, dataSourceType string,
	openSearchArns []string,
) (string, error)

AddDirectQueryDataSource adds a direct-query data source.

func (*InMemoryBackend) AddDomainInternal

func (b *InMemoryBackend) AddDomainInternal(name, engineVersion string)

AddDomainInternal seeds a domain directly for use in tests.

func (*InMemoryBackend) AddPackageInternal

func (b *InMemoryBackend) AddPackageInternal(packageID, packageName, packageType string)

AddPackageInternal seeds a package directly for use in tests.

func (*InMemoryBackend) AddTags

func (b *InMemoryBackend) AddTags(domainARN string, kv map[string]string) error

AddTags adds or updates tags on the domain identified by ARN.

func (*InMemoryBackend) AssociatePackage

func (b *InMemoryBackend) AssociatePackage(
	packageID, domainName string,
) (*DomainPackageDetails, error)

AssociatePackage associates a package with a domain.

func (*InMemoryBackend) AssociatePackages

func (b *InMemoryBackend) AssociatePackages(
	domainName string,
	packageIDs []string,
) ([]DomainPackageDetails, error)

AssociatePackages associates multiple packages with a domain.

func (*InMemoryBackend) AuthorizeVpcEndpointAccess

func (b *InMemoryBackend) AuthorizeVpcEndpointAccess(
	domainName, account, service string,
) (*AuthorizedPrincipal, error)

AuthorizeVpcEndpointAccess grants VPC endpoint access for an account or service.

func (*InMemoryBackend) BatchGetServerlessCollections

func (b *InMemoryBackend) BatchGetServerlessCollections(ids, names []string) []*ServerlessCollection

BatchGetServerlessCollections returns a list of collections by IDs or names. Empty ids/names returns all collections.

func (*InMemoryBackend) CancelDomainConfigChange

func (b *InMemoryBackend) CancelDomainConfigChange(
	domainName string,
	dryRun bool,
) ([]string, bool, error)

CancelDomainConfigChange cancels a pending configuration change on a domain.

func (*InMemoryBackend) CancelServiceSoftwareUpdate

func (b *InMemoryBackend) CancelServiceSoftwareUpdate(
	domainName string,
) (*ServiceSoftwareOptions, error)

CancelServiceSoftwareUpdate cancels a pending service software update.

AWS only permits cancellation while an update is actually scheduled (UpdateStatus == PENDING_UPDATE). When nothing is scheduled it rejects the request, so this mutates the stored software-update state and returns a ValidationException in that case rather than a canned success envelope.

func (*InMemoryBackend) CountDocuments

func (b *InMemoryBackend) CountDocuments(domainName, indexName string) (int, error)

CountDocuments returns the number of documents stored in an index.

func (*InMemoryBackend) CreateApplication

func (b *InMemoryBackend) CreateApplication(
	name string,
	appConfigs []AppConfig,
	dataSources []AppDataSource,
) (*Application, error)

CreateApplication creates an OpenSearch UI application.

func (*InMemoryBackend) CreateDomain

func (b *InMemoryBackend) CreateDomain(input CreateDomainInput) (*Domain, error)

CreateDomain creates a new OpenSearch domain.

func (*InMemoryBackend) CreateIndex

func (b *InMemoryBackend) CreateIndex(
	domainName, indexName string,
	mappings, settings, aliases map[string]any,
) (*DomainIndex, error)

CreateIndex creates an index for a domain.

func (*InMemoryBackend) CreateOutboundConnection

func (b *InMemoryBackend) CreateOutboundConnection(
	connectionAlias string,
	localDomainInfo, remoteDomainInfo map[string]any,
) (*OutboundConnection, error)

CreateOutboundConnection creates a new outbound cross-cluster connection.

func (*InMemoryBackend) CreatePackage

func (b *InMemoryBackend) CreatePackage(
	name, pkgType, description string,
	source *PackageSource,
	encryptionOptions *PackageEncryptionOptions,
) (*Package, error)

CreatePackage creates a new OpenSearch package.

func (*InMemoryBackend) CreateServerlessAccessPolicy

func (b *InMemoryBackend) CreateServerlessAccessPolicy(
	policyType, name, description, policy string,
) (*ServerlessAccessPolicy, error)

CreateServerlessAccessPolicy creates a new access policy.

func (*InMemoryBackend) CreateServerlessCollection

func (b *InMemoryBackend) CreateServerlessCollection(
	name, collectionType, description, kmsKeyArn string,
	tagMap map[string]string,
) (*ServerlessCollection, error)

CreateServerlessCollection creates a new OpenSearch Serverless collection.

func (*InMemoryBackend) CreateServerlessEncryptionPolicy

func (b *InMemoryBackend) CreateServerlessEncryptionPolicy(
	policyType, name, description, policy string,
) (*ServerlessEncryptionPolicy, error)

CreateServerlessEncryptionPolicy creates a new encryption policy.

func (*InMemoryBackend) CreateServerlessNetworkPolicy

func (b *InMemoryBackend) CreateServerlessNetworkPolicy(
	policyType, name, description, policy string,
) (*ServerlessNetworkPolicy, error)

CreateServerlessNetworkPolicy creates a new network policy.

func (*InMemoryBackend) CreateServerlessSecurityConfig

func (b *InMemoryBackend) CreateServerlessSecurityConfig(
	configType, description string,
	samlOptions *ServerlessSAMLOptions,
) (*ServerlessSecurityConfig, error)

CreateServerlessSecurityConfig creates a new security config.

func (*InMemoryBackend) CreateVpcEndpoint

func (b *InMemoryBackend) CreateVpcEndpoint(
	domainArn string,
	vpcOptions map[string]any,
) (*VpcEndpoint, error)

CreateVpcEndpoint creates a new VPC endpoint.

func (*InMemoryBackend) DeleteApplication

func (b *InMemoryBackend) DeleteApplication(id string) error

DeleteApplication removes an application by ID.

func (*InMemoryBackend) DeleteDataSource

func (b *InMemoryBackend) DeleteDataSource(domainName, name string) error

DeleteDataSource removes a data source from a domain.

func (*InMemoryBackend) DeleteDirectQueryDataSource

func (b *InMemoryBackend) DeleteDirectQueryDataSource(name string) error

DeleteDirectQueryDataSource removes a direct-query data source by name.

func (*InMemoryBackend) DeleteDocument

func (b *InMemoryBackend) DeleteDocument(domainName, indexName, docID string) error

DeleteDocument removes a document by ID and updates the document count.

func (*InMemoryBackend) DeleteDomain

func (b *InMemoryBackend) DeleteDomain(name string) (*Domain, error)

DeleteDomain removes a domain by name and cleans up all associated resources.

When processingDelay is 0 the domain (and all its scoped resources) is removed immediately and the returned status reports Deleted:true / Deleting. When a delay is configured the domain enters a real, observable Deleting window: it remains describable with Deleted:true until the window elapses, after which it is cascaded away lazily on the next write.

func (*InMemoryBackend) DeleteInboundConnection

func (b *InMemoryBackend) DeleteInboundConnection(connectionID string) (*InboundConnection, error)

DeleteInboundConnection removes an inbound connection by ID. With a processing delay configured the connection first enters an observable DELETING window.

func (*InMemoryBackend) DeleteIndex

func (b *InMemoryBackend) DeleteIndex(domainName, indexName string) (*DomainIndex, error)

DeleteIndex removes an index from a domain.

func (*InMemoryBackend) DeleteOutboundConnection

func (b *InMemoryBackend) DeleteOutboundConnection(
	connectionID string,
) (*OutboundConnection, error)

DeleteOutboundConnection removes an outbound connection by ID. With a processing delay configured the connection first enters an observable DELETING window before it is finally removed.

func (*InMemoryBackend) DeletePackage

func (b *InMemoryBackend) DeletePackage(packageID string) (*Package, error)

DeletePackage removes a package by ID.

func (*InMemoryBackend) DeleteServerlessAccessPolicy

func (b *InMemoryBackend) DeleteServerlessAccessPolicy(policyType, name string) error

DeleteServerlessAccessPolicy removes an access policy by type and name.

func (*InMemoryBackend) DeleteServerlessCollection

func (b *InMemoryBackend) DeleteServerlessCollection(id string) (*ServerlessCollection, error)

DeleteServerlessCollection removes a collection by ID. With a processing delay configured the collection first enters an observable DELETING window before it is finally removed.

func (*InMemoryBackend) DeleteServerlessEncryptionPolicy

func (b *InMemoryBackend) DeleteServerlessEncryptionPolicy(policyType, name string) error

DeleteServerlessEncryptionPolicy removes an encryption policy.

func (*InMemoryBackend) DeleteServerlessNetworkPolicy

func (b *InMemoryBackend) DeleteServerlessNetworkPolicy(policyType, name string) error

DeleteServerlessNetworkPolicy removes a network policy.

func (*InMemoryBackend) DeleteServerlessSecurityConfig

func (b *InMemoryBackend) DeleteServerlessSecurityConfig(id string) error

DeleteServerlessSecurityConfig removes a security config by ID.

func (*InMemoryBackend) DeleteVpcEndpoint

func (b *InMemoryBackend) DeleteVpcEndpoint(id string) (*VpcEndpoint, error)

DeleteVpcEndpoint removes a VPC endpoint by ID. With a processing delay configured the endpoint first enters an observable DELETING window before it is finally removed.

func (*InMemoryBackend) DescribeDomain

func (b *InMemoryBackend) DescribeDomain(name string) (*Domain, error)

DescribeDomain returns details about a domain. A domain whose deleting window has elapsed is reported as not found.

func (*InMemoryBackend) DescribeDomains

func (b *InMemoryBackend) DescribeDomains(names []string) ([]*Domain, error)

DescribeDomains returns a list of domains. If names is empty, all domains are returned. Missing names are silently skipped.

func (*InMemoryBackend) DescribeInboundConnections

func (b *InMemoryBackend) DescribeInboundConnections() []*InboundConnection

DescribeInboundConnections returns all inbound connections, excluding any whose deleting window has elapsed.

func (*InMemoryBackend) DescribeInstanceTypeLimits

func (b *InMemoryBackend) DescribeInstanceTypeLimits(
	instanceType, _ string,
) (*InstanceTypeLimits, error)

DescribeInstanceTypeLimits returns instance type limits for a given instance type and engine version. This is a static lookup table for common types.

func (*InMemoryBackend) DescribeOutboundConnections

func (b *InMemoryBackend) DescribeOutboundConnections() []*OutboundConnection

DescribeOutboundConnections returns all outbound connections, excluding any whose deleting window has elapsed.

func (*InMemoryBackend) DescribePackages

func (b *InMemoryBackend) DescribePackages(ids []string) ([]*Package, error)

DescribePackages returns packages matching the given IDs, or all packages if ids is empty.

func (*InMemoryBackend) DescribeReservedInstanceOfferings

func (b *InMemoryBackend) DescribeReservedInstanceOfferings() []*ReservedInstanceOffering

DescribeReservedInstanceOfferings returns available reserved instance offerings.

func (*InMemoryBackend) DescribeReservedInstances

func (b *InMemoryBackend) DescribeReservedInstances() []*ReservedInstance

DescribeReservedInstances returns all purchased reserved instances.

func (*InMemoryBackend) DescribeVpcEndpoints

func (b *InMemoryBackend) DescribeVpcEndpoints(ids []string) ([]*VpcEndpoint, []map[string]any)

DescribeVpcEndpoints returns matching VPC endpoints and errors for not-found IDs.

func (*InMemoryBackend) DissociatePackage

func (b *InMemoryBackend) DissociatePackage(
	packageID, domainName string,
) (*DomainPackageDetails, error)

DissociatePackage removes a package association from a domain.

func (*InMemoryBackend) DissociatePackages

func (b *InMemoryBackend) DissociatePackages(
	domainName string,
	packageIDs []string,
) ([]DomainPackageDetails, error)

DissociatePackages removes multiple package associations from a domain.

func (*InMemoryBackend) DomainDocumentCount

func (b *InMemoryBackend) DomainDocumentCount(domainName string) int

DomainDocumentCount returns the total number of documents stored across all indexes of a domain.

func (*InMemoryBackend) GetApplication

func (b *InMemoryBackend) GetApplication(id string) (*Application, error)

GetApplication returns an application by ID.

func (*InMemoryBackend) GetAutoTune

func (b *InMemoryBackend) GetAutoTune(domainName string) ([]*AutoTune, error)

GetAutoTune returns auto-tune details for a domain.

func (*InMemoryBackend) GetChangeProgress

func (b *InMemoryBackend) GetChangeProgress(domainName string) (map[string]any, error)

GetChangeProgress returns the last change progress for a domain.

func (*InMemoryBackend) GetCompatibleVersions

func (b *InMemoryBackend) GetCompatibleVersions(domainName string) []map[string]any

GetCompatibleVersions returns static compatible version pairs. If domainName is non-empty, target versions are filtered to those reachable from the domain's current EngineVersion.

func (*InMemoryBackend) GetDataSource

func (b *InMemoryBackend) GetDataSource(domainName, name string) (*DataSource, error)

GetDataSource returns a data source by domain and name.

func (*InMemoryBackend) GetDefaultApplicationSettings

func (b *InMemoryBackend) GetDefaultApplicationSettings(
	applicationType string,
) ([]AppSetting, error)

GetDefaultApplicationSettings returns stored settings for the given applicationType.

func (*InMemoryBackend) GetDirectQueryDataSource

func (b *InMemoryBackend) GetDirectQueryDataSource(name string) (*DirectQueryDataSource, error)

GetDirectQueryDataSource returns a direct-query data source by name.

func (*InMemoryBackend) GetDocument

func (b *InMemoryBackend) GetDocument(
	domainName, indexName, docID string,
) (map[string]any, error)

GetDocument returns a stored document by ID.

func (*InMemoryBackend) GetDomainHealth

func (b *InMemoryBackend) GetDomainHealth(domainName string) (map[string]any, error)

GetDomainHealth returns computed health metrics for a domain.

func (*InMemoryBackend) GetDomainMaintenanceStatus

func (b *InMemoryBackend) GetDomainMaintenanceStatus(
	domainName, maintenanceID string,
) (*DomainMaintenance, error)

GetDomainMaintenanceStatus returns a specific maintenance record.

func (*InMemoryBackend) GetDomainNodes

func (b *InMemoryBackend) GetDomainNodes(domainName string) ([]map[string]any, error)

GetDomainNodes returns a list of node descriptors based on cluster config.

func (*InMemoryBackend) GetDryRunProgress

func (b *InMemoryBackend) GetDryRunProgress(domainName string) (*DryRunStatus, error)

GetDryRunProgress returns dry-run progress for a domain. Creates a default entry if none exists.

func (*InMemoryBackend) GetIndex

func (b *InMemoryBackend) GetIndex(domainName, indexName string) (*DomainIndex, error)

GetIndex returns an index by domain and name.

func (*InMemoryBackend) GetPackageVersionHistory

func (b *InMemoryBackend) GetPackageVersionHistory(
	packageID string,
) ([]*PackageVersionHistory, error)

GetPackageVersionHistory returns the version history for a package.

func (*InMemoryBackend) GetServerlessAccessPolicy

func (b *InMemoryBackend) GetServerlessAccessPolicy(policyType, name string) (*ServerlessAccessPolicy, error)

GetServerlessAccessPolicy retrieves an access policy by type and name.

func (*InMemoryBackend) GetServerlessEncryptionPolicy

func (b *InMemoryBackend) GetServerlessEncryptionPolicy(policyType, name string) (*ServerlessEncryptionPolicy, error)

GetServerlessEncryptionPolicy retrieves an encryption policy by type and name.

func (*InMemoryBackend) GetServerlessSecurityConfig

func (b *InMemoryBackend) GetServerlessSecurityConfig(id string) (*ServerlessSecurityConfig, error)

GetServerlessSecurityConfig retrieves a security config by ID.

func (*InMemoryBackend) GetUpgradeHistory

func (b *InMemoryBackend) GetUpgradeHistory(domainName string) ([]*UpgradeHistory, error)

GetUpgradeHistory returns the upgrade history for a domain, newest first.

func (*InMemoryBackend) GetUpgradeStatus

func (b *InMemoryBackend) GetUpgradeStatus(domainName string) (string, string, string, error)

GetUpgradeStatus returns the most recent upgrade status for a domain.

func (*InMemoryBackend) IndexDocument

func (b *InMemoryBackend) IndexDocument(
	domainName, indexName, docID string,
	doc map[string]any,
) (string, bool, error)

IndexDocument stores (or replaces) a document in an index and keeps the index document count accurate. When docID is empty a fresh ID is generated. It returns the effective document ID and whether a new document was created.

func (*InMemoryBackend) ListApplications

func (b *InMemoryBackend) ListApplications() []*Application

ListApplications returns all applications.

func (*InMemoryBackend) ListDataSources

func (b *InMemoryBackend) ListDataSources(domainName string) ([]*DataSource, error)

ListDataSources returns all data sources for a domain.

func (*InMemoryBackend) ListDirectQueryDataSources

func (b *InMemoryBackend) ListDirectQueryDataSources() []*DirectQueryDataSource

ListDirectQueryDataSources returns all direct-query data sources.

func (*InMemoryBackend) ListDomainEntriesFiltered

func (b *InMemoryBackend) ListDomainEntriesFiltered(engineType string) []DomainEntry

ListDomainEntriesFiltered returns name+engine version for all domains matching engineType, under a single read lock. Pass an empty string to return all domains.

func (*InMemoryBackend) ListDomainMaintenances

func (b *InMemoryBackend) ListDomainMaintenances(domainName string) ([]*DomainMaintenance, error)

ListDomainMaintenances returns all maintenance records for a domain.

func (*InMemoryBackend) ListDomainNames

func (b *InMemoryBackend) ListDomainNames() []string

ListDomainNames returns the names of all live domains in sorted order.

func (*InMemoryBackend) ListDomainNamesByEngine

func (b *InMemoryBackend) ListDomainNamesByEngine(engineType string) []string

ListDomainNamesByEngine returns domain names filtered by engine type.

func (*InMemoryBackend) ListDomainsForPackage

func (b *InMemoryBackend) ListDomainsForPackage(packageID string) []string

ListDomainsForPackage returns domain names associated with a package.

func (*InMemoryBackend) ListInstanceTypeDetails

func (b *InMemoryBackend) ListInstanceTypeDetails(_, _ string) []map[string]any

ListInstanceTypeDetails returns a static list of common OpenSearch instance type details.

func (*InMemoryBackend) ListPackagesForDomain

func (b *InMemoryBackend) ListPackagesForDomain(domainName string) []*Package

ListPackagesForDomain returns packages associated with a domain.

func (*InMemoryBackend) ListScheduledActions

func (b *InMemoryBackend) ListScheduledActions(domainName string) []*ScheduledAction

ListScheduledActions returns scheduled actions for a domain.

func (*InMemoryBackend) ListServerlessAccessPolicies

func (b *InMemoryBackend) ListServerlessAccessPolicies(policyType string) []*ServerlessAccessPolicy

ListServerlessAccessPolicies lists access policies filtered by type.

func (*InMemoryBackend) ListServerlessEncryptionPolicies

func (b *InMemoryBackend) ListServerlessEncryptionPolicies(policyType string) []*ServerlessEncryptionPolicy

ListServerlessEncryptionPolicies lists encryption policies filtered by type.

func (*InMemoryBackend) ListServerlessNetworkPolicies

func (b *InMemoryBackend) ListServerlessNetworkPolicies(policyType string) []*ServerlessNetworkPolicy

ListServerlessNetworkPolicies lists network policies filtered by type.

func (*InMemoryBackend) ListServerlessSecurityConfigs

func (b *InMemoryBackend) ListServerlessSecurityConfigs(configType string) []*ServerlessSecurityConfig

ListServerlessSecurityConfigs lists security configs filtered by type.

func (*InMemoryBackend) ListTags

func (b *InMemoryBackend) ListTags(domainARN string) (map[string]string, error)

ListTags returns tags for the domain identified by ARN.

func (*InMemoryBackend) ListVpcEndpointAccess

func (b *InMemoryBackend) ListVpcEndpointAccess(domainName string) ([]AuthorizedPrincipal, error)

ListVpcEndpointAccess returns authorized principals for a domain.

func (*InMemoryBackend) ListVpcEndpoints

func (b *InMemoryBackend) ListVpcEndpoints() []*VpcEndpoint

ListVpcEndpoints returns all VPC endpoints, excluding any whose deleting window has elapsed.

func (*InMemoryBackend) ListVpcEndpointsForDomain

func (b *InMemoryBackend) ListVpcEndpointsForDomain(domainArn string) []*VpcEndpoint

ListVpcEndpointsForDomain returns VPC endpoints associated with a domain ARN, excluding any whose deleting window has elapsed.

func (*InMemoryBackend) PreviewDomainConfig

func (b *InMemoryBackend) PreviewDomainConfig(
	name string,
	input UpdateDomainConfigInput,
) (*Domain, error)

PreviewDomainConfig computes the domain configuration that UpdateDomainConfig would produce for input, without mutating stored state or advancing the processing/change-ID bookkeeping. This backs UpdateDomainConfig's DryRun=true mode (aws-sdk-go-v2 UpdateDomainConfigInput.DryRun): AWS validates and previews the change but never applies it.

func (*InMemoryBackend) PurchaseReservedInstanceOffering

func (b *InMemoryBackend) PurchaseReservedInstanceOffering(
	offeringID, name string,
	count int,
) (*ReservedInstance, error)

PurchaseReservedInstanceOffering purchases a reserved instance offering.

func (*InMemoryBackend) PutDefaultApplicationSettings

func (b *InMemoryBackend) PutDefaultApplicationSettings(
	applicationType string,
	settings []AppSetting,
) error

PutDefaultApplicationSettings stores settings for the given applicationType.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the AWS region this backend is configured for.

func (*InMemoryBackend) RejectInboundConnection

func (b *InMemoryBackend) RejectInboundConnection(connectionID string) (*InboundConnection, error)

RejectInboundConnection sets an inbound connection status to REJECTED.

func (*InMemoryBackend) RemoveTags

func (b *InMemoryBackend) RemoveTags(domainARN string, keys []string) error

RemoveTags removes tag keys from the domain identified by ARN.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all backend state, releasing any resources held.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.

func (*InMemoryBackend) RevokeVpcEndpointAccess

func (b *InMemoryBackend) RevokeVpcEndpointAccess(domainName, account string) error

RevokeVpcEndpointAccess removes a principal from the VPC authorizations for a domain.

func (*InMemoryBackend) SearchIndex

func (b *InMemoryBackend) SearchIndex(
	domainName, indexName string,
	query map[string]any,
	size int,
) (*SearchResult, error)

SearchIndex runs a bounded search over the stored documents of an index.

Supported queries: an empty query or {"match_all": {}} returns every document; {"term": {field: value}} returns documents whose field equals value exactly; {"match": {field: text}} returns documents whose field contains text (case-insensitive substring). Hits are ordered by document ID for determinism. size defaults to 10 and is capped at maxSearchSize.

func (*InMemoryBackend) SetAutoTune

func (b *InMemoryBackend) SetAutoTune(
	domainName, desiredState string,
	schedules []AutoTuneMaintenanceSchedule,
) error

SetAutoTune stores auto-tune configuration for a domain.

func (*InMemoryBackend) SetClock

func (b *InMemoryBackend) SetClock(fn func() time.Time)

SetClock installs a deterministic clock, primarily for tests. Passing nil restores the default time.Now clock.

func (*InMemoryBackend) SetDNSRegistrar

func (b *InMemoryBackend) SetDNSRegistrar(dns DNSRegistrar)

SetDNSRegistrar wires a DNS server so OpenSearch domain hostnames are auto-registered.

func (*InMemoryBackend) SetProcessingDelay

func (b *InMemoryBackend) SetProcessingDelay(d time.Duration)

SetProcessingDelay configures how long create/update/upgrade/delete lifecycle windows remain observable before settling to their terminal state. A delay of 0 (the default) keeps the historical fast behaviour: transitions still run through the real code path but settle immediately.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) StartDomainMaintenance

func (b *InMemoryBackend) StartDomainMaintenance(
	domainName, action, nodeID string,
) (*DomainMaintenance, error)

StartDomainMaintenance starts a maintenance action on a domain.

func (*InMemoryBackend) StartServiceSoftwareUpdate

func (b *InMemoryBackend) StartServiceSoftwareUpdate(
	domainName, scheduleAt string,
) (*ServiceSoftwareOptions, error)

StartServiceSoftwareUpdate marks a domain as having a pending software update. StartServiceSoftwareUpdate schedules a service software update for the domain. scheduleAt must be one of "NOW", "TIMESTAMP", "OFF_PEAK_WINDOW", or "".

func (*InMemoryBackend) UpdateApplication

func (b *InMemoryBackend) UpdateApplication(
	id string,
	appConfigs []AppConfig,
	dataSources []AppDataSource,
) (*Application, error)

UpdateApplication updates an application's configs and data sources.

func (*InMemoryBackend) UpdateDataSource

func (b *InMemoryBackend) UpdateDataSource(domainName, name, description string) error

UpdateDataSource updates the description of a data source.

func (*InMemoryBackend) UpdateDirectQueryDataSource

func (b *InMemoryBackend) UpdateDirectQueryDataSource(
	name, description string,
	openSearchArns []string,
) (*DirectQueryDataSource, error)

UpdateDirectQueryDataSource updates a direct-query data source.

func (*InMemoryBackend) UpdateDomainConfig

func (b *InMemoryBackend) UpdateDomainConfig(
	name string,
	input UpdateDomainConfigInput,
) (*Domain, error)

UpdateDomainConfig updates mutable fields on a domain and records a change ID.

func (*InMemoryBackend) UpdateIndex

func (b *InMemoryBackend) UpdateIndex(
	domainName, indexName string,
	mappings, settings map[string]any,
) (*DomainIndex, error)

UpdateIndex updates the mappings and settings of an index.

func (*InMemoryBackend) UpdatePackage

func (b *InMemoryBackend) UpdatePackage(packageID, description string) (*Package, error)

UpdatePackage updates a package's description and adds a version history entry.

func (*InMemoryBackend) UpdatePackageScope

func (b *InMemoryBackend) UpdatePackageScope(packageID, _ string, _ []string) (*Package, error)

UpdatePackageScope is a no-op that returns the package (scope is not tracked in-memory).

func (*InMemoryBackend) UpdateScheduledAction

func (b *InMemoryBackend) UpdateScheduledAction(
	domainName string,
	action *ScheduledAction,
) (*ScheduledAction, error)

UpdateScheduledAction updates or adds a scheduled action for a domain.

func (*InMemoryBackend) UpdateServerlessAccessPolicy

func (b *InMemoryBackend) UpdateServerlessAccessPolicy(
	policyType, name, description, policy, policyVersion string,
) (*ServerlessAccessPolicy, error)

UpdateServerlessAccessPolicy updates an existing access policy.

func (*InMemoryBackend) UpdateServerlessEncryptionPolicy

func (b *InMemoryBackend) UpdateServerlessEncryptionPolicy(
	policyType, name, description, policy, policyVersion string,
) (*ServerlessEncryptionPolicy, error)

UpdateServerlessEncryptionPolicy updates an existing encryption policy.

func (*InMemoryBackend) UpdateServerlessSecurityConfig

func (b *InMemoryBackend) UpdateServerlessSecurityConfig(
	id, description, configVersion string,
	samlOptions *ServerlessSAMLOptions,
) (*ServerlessSecurityConfig, error)

UpdateServerlessSecurityConfig updates an existing security config.

func (*InMemoryBackend) UpdateVpcEndpoint

func (b *InMemoryBackend) UpdateVpcEndpoint(
	id string,
	vpcOptions map[string]any,
) (*VpcEndpoint, error)

UpdateVpcEndpoint updates the VPC options for a VPC endpoint.

func (*InMemoryBackend) UpgradeDomain

func (b *InMemoryBackend) UpgradeDomain(domainName, upgradeName string) error

UpgradeDomain records an upgrade in the domain's history. Called when an upgrade is triggered.

type InboundConnection

type InboundConnection struct {
	StatusUntil  time.Time `json:"statusUntil,omitzero"`
	ConnectionID string    `json:"connectionId"`
	Status       string    `json:"status"`
}

InboundConnection represents an OpenSearch inbound cross-cluster connection.

type InstanceTypeLimits

type InstanceTypeLimits struct {
	InstanceType     string            `json:"InstanceType"`
	InstanceLimits   map[string]any    `json:"InstanceLimits"`
	StorageTypes     []StorageType     `json:"StorageTypes,omitempty"`
	AdditionalLimits []AdditionalLimit `json:"AdditionalLimits,omitempty"`
}

InstanceTypeLimits holds limits for a given OpenSearch instance type.

type LogPublishingOption

type LogPublishingOption struct {
	CloudWatchLogsLogGroupARN string `json:"cloudWatchLogsLogGroupArn,omitempty"`
	Enabled                   bool   `json:"enabled"`
}

LogPublishingOption holds a single log type publishing configuration.

type NodeToNodeEncryptionOptions

type NodeToNodeEncryptionOptions struct {
	Enabled bool `json:"enabled"`
}

NodeToNodeEncryptionOptions holds node-to-node encryption settings.

type OffPeakWindow

type OffPeakWindow struct {
	WindowStartTime *WindowStartTime `json:"windowStartTime,omitempty"`
}

OffPeakWindow defines a custom start time for off-peak maintenance.

type OffPeakWindowOptions

type OffPeakWindowOptions struct {
	OffPeakWindow *OffPeakWindow `json:"offPeakWindow,omitempty"`
	Enabled       bool           `json:"enabled"`
}

OffPeakWindowOptions holds off-peak window settings for a domain.

type OutboundConnection

type OutboundConnection struct {
	StatusUntil      time.Time      `json:"statusUntil,omitzero"`
	LocalDomainInfo  map[string]any `json:"LocalDomainInfo"`
	RemoteDomainInfo map[string]any `json:"RemoteDomainInfo"`
	ConnectionID     string         `json:"ConnectionId"`
	ConnectionAlias  string         `json:"ConnectionAlias"`
	Status           string         `json:"status"`
}

OutboundConnection represents a cross-cluster outbound connection.

type Package

type Package struct {
	PackageSource            *PackageSource            `json:"PackageSource,omitempty"`
	PackageEncryptionOptions *PackageEncryptionOptions `json:"PackageEncryptionOptions,omitempty"`
	PackageID                string                    `json:"PackageID"`
	PackageName              string                    `json:"PackageName"`
	PackageType              string                    `json:"PackageType"`
	PackageDescription       string                    `json:"PackageDescription"`
	PackageStatus            string                    `json:"PackageStatus"`
	AvailablePackageVersion  string                    `json:"AvailablePackageVersion,omitempty"`
	VersionHistory           []*PackageVersionHistory  `json:"-"`
	CreatedAt                float64                   `json:"CreatedAt"`
}

Package represents an OpenSearch package.

type PackageEncryptionOptions

type PackageEncryptionOptions struct {
	KmsKeyIdentifier  string `json:"KmsKeyIdentifier,omitempty"`
	EncryptionEnabled bool   `json:"EncryptionEnabled"`
}

PackageEncryptionOptions holds encryption settings for a package.

type PackageSource

type PackageSource struct {
	S3BucketName string `json:"S3BucketName,omitempty"`
	S3Key        string `json:"S3Key,omitempty"`
}

PackageSource holds the S3 source location for a custom package.

type PackageVersionHistory

type PackageVersionHistory struct {
	PackageVersion string  `json:"PackageVersion"`
	CommitMessage  string  `json:"CommitMessage"`
	CreatedAt      float64 `json:"CreatedAt"`
}

PackageVersionHistory records a version of a package.

type Provider

type Provider struct{}

Provider implements service.Provider for the OpenSearch service.

func (*Provider) Init

Init initializes the OpenSearch service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the service provider name.

type ReservedInstance

type ReservedInstance struct {
	ReservedInstanceID         string  `json:"ReservedInstanceId"`
	ReservedInstanceOfferingID string  `json:"ReservedInstanceOfferingId"`
	InstanceType               string  `json:"InstanceType"`
	ReservationName            string  `json:"ReservationName"`
	CurrencyCode               string  `json:"CurrencyCode"`
	PaymentOption              string  `json:"PaymentOption"`
	State                      string  `json:"State"`
	Duration                   int     `json:"Duration"`
	FixedPrice                 float64 `json:"FixedPrice"`
	UsagePrice                 float64 `json:"UsagePrice"`
	InstanceCount              int     `json:"InstanceCount"`
	StartTime                  float64 `json:"StartTime"`
}

ReservedInstance is a purchased reserved instance.

type ReservedInstanceOffering

type ReservedInstanceOffering struct {
	ReservedInstanceOfferingID string  `json:"ReservedInstanceOfferingId"`
	InstanceType               string  `json:"InstanceType"`
	CurrencyCode               string  `json:"CurrencyCode"`
	PaymentOption              string  `json:"PaymentOption"`
	Duration                   int     `json:"Duration"`
	FixedPrice                 float64 `json:"FixedPrice"`
	UsagePrice                 float64 `json:"UsagePrice"`
}

ReservedInstanceOffering is an available reserved instance offering.

type SAMLOptionsInput

type SAMLOptionsInput struct {
	IDPEntityID           string `json:"idpEntityId,omitempty"`
	IDPMetadataContent    string `json:"idpMetadataContent,omitempty"`
	RolesKey              string `json:"rolesKey,omitempty"`
	SubjectKey            string `json:"subjectKey,omitempty"`
	SessionTimeoutMinutes int    `json:"sessionTimeoutMinutes,omitempty"`
	Enabled               bool   `json:"enabled,omitempty"`
}

SAMLOptionsInput holds SAML configuration for AdvancedSecurityOptions.

type ScheduledAction

type ScheduledAction struct {
	ID            string  `json:"Id"`
	Type          string  `json:"Type"`
	Severity      string  `json:"Severity"`
	Description   string  `json:"Description"`
	ScheduledBy   string  `json:"ScheduledBy"`
	Status        string  `json:"Status"`
	ScheduledTime float64 `json:"ScheduledTime"`
	Mandatory     bool    `json:"Mandatory"`
	Cancellable   bool    `json:"Cancellable"`
}

ScheduledAction represents a scheduled action for a domain.

type ScheduledAutoTuneDetails

type ScheduledAutoTuneDetails struct {
	ActionType string  `json:"ActionType,omitempty"`
	Action     string  `json:"Action,omitempty"`
	Severity   string  `json:"Severity,omitempty"`
	Date       float64 `json:"Date,omitempty"`
}

ScheduledAutoTuneDetails holds action details for a scheduled auto-tune.

type SearchHit

type SearchHit struct {
	Source map[string]any `json:"_source"`
	ID     string         `json:"_id"`
	Index  string         `json:"_index"`
}

SearchHit is a single document returned by a search.

type SearchResult

type SearchResult struct {
	Hits  []SearchHit
	Total int
}

SearchResult is the outcome of a bounded search over an index.

type ServerlessAccessPolicy

type ServerlessAccessPolicy struct {
	Description      string  `json:"description,omitempty"`
	Name             string  `json:"name"`
	Policy           string  `json:"policy"`
	PolicyVersion    string  `json:"policyVersion"`
	Type             string  `json:"type"`
	CreatedDate      float64 `json:"createdDate"`
	LastModifiedDate float64 `json:"lastModifiedDate"`
}

ServerlessAccessPolicy represents an OpenSearch Serverless access policy.

type ServerlessCollection

type ServerlessCollection struct {
	StatusUntil        time.Time         `json:"statusUntil,omitzero"`
	Tags               map[string]string `json:"tags,omitempty"`
	KmsKeyArn          string            `json:"kmsKeyArn,omitempty"`
	DashboardEndpoint  string            `json:"dashboardEndpoint,omitempty"`
	Description        string            `json:"description,omitempty"`
	ID                 string            `json:"id"`
	CollectionEndpoint string            `json:"collectionEndpoint,omitempty"`
	Name               string            `json:"name"`
	Status             string            `json:"status"`
	Type               string            `json:"type"`
	Arn                string            `json:"arn"`
	CreatedDate        float64           `json:"createdDate"`
	LastModifiedDate   float64           `json:"lastModifiedDate"`
}

ServerlessCollection represents an OpenSearch Serverless collection.

type ServerlessEncryptionPolicy

type ServerlessEncryptionPolicy struct {
	Description      string  `json:"description,omitempty"`
	Name             string  `json:"name"`
	Policy           string  `json:"policy"`
	PolicyVersion    string  `json:"policyVersion"`
	Type             string  `json:"type"`
	CreatedDate      float64 `json:"createdDate"`
	LastModifiedDate float64 `json:"lastModifiedDate"`
}

ServerlessEncryptionPolicy represents an OpenSearch Serverless encryption policy.

type ServerlessNetworkPolicy

type ServerlessNetworkPolicy struct {
	Description      string  `json:"description,omitempty"`
	Name             string  `json:"name"`
	Policy           string  `json:"policy"`
	PolicyVersion    string  `json:"policyVersion"`
	Type             string  `json:"type"`
	CreatedDate      float64 `json:"createdDate"`
	LastModifiedDate float64 `json:"lastModifiedDate"`
}

ServerlessNetworkPolicy represents an OpenSearch Serverless network policy.

type ServerlessSAMLOptions

type ServerlessSAMLOptions struct {
	GroupAttribute string `json:"groupAttribute,omitempty"`
	Metadata       string `json:"metadata,omitempty"`
	UserAttribute  string `json:"userAttribute,omitempty"`
	SessionTimeout int    `json:"sessionTimeout,omitempty"`
}

ServerlessSAMLOptions holds SAML options for a serverless security config.

type ServerlessSecurityConfig

type ServerlessSecurityConfig struct {
	SamlOptions      *ServerlessSAMLOptions `json:"samlOptions,omitempty"`
	ConfigVersion    string                 `json:"configVersion"`
	Description      string                 `json:"description,omitempty"`
	ID               string                 `json:"id"`
	Type             string                 `json:"type"`
	CreatedDate      float64                `json:"createdDate"`
	LastModifiedDate float64                `json:"lastModifiedDate"`
}

ServerlessSecurityConfig represents an OpenSearch Serverless security config.

type ServiceSoftwareOptions

type ServiceSoftwareOptions struct {
	CurrentVersion      string `json:"currentVersion"`
	NewVersion          string `json:"newVersion"`
	UpdateStatus        string `json:"updateStatus"`
	Description         string `json:"description"`
	AutomatedUpdateDate string `json:"automatedUpdateDate"`
	UpdateAvailable     bool   `json:"updateAvailable"`
	Cancellable         bool   `json:"cancellable"`
	OptionalDeployment  bool   `json:"optionalDeployment"`
}

ServiceSoftwareOptions represents service software options for a domain.

type SnapshotOptions

type SnapshotOptions struct {
	AutomatedSnapshotStartHour int `json:"automatedSnapshotStartHour"`
}

SnapshotOptions holds automated snapshot settings.

type StorageBackend

type StorageBackend interface {
	// Domain operations
	CreateDomain(input CreateDomainInput) (*Domain, error)
	DeleteDomain(name string) (*Domain, error)
	DescribeDomain(name string) (*Domain, error)
	DescribeDomains(names []string) ([]*Domain, error)
	ListDomainNames() []string
	UpdateDomainConfig(name string, input UpdateDomainConfigInput) (*Domain, error)
	PreviewDomainConfig(name string, input UpdateDomainConfigInput) (*Domain, error)
	GetDomainHealth(domainName string) (map[string]any, error)
	GetDomainNodes(domainName string) ([]map[string]any, error)
	GetChangeProgress(domainName string) (map[string]any, error)
	GetDryRunProgress(domainName string) (*DryRunStatus, error)

	// Tag operations
	ListTags(domainARN string) (map[string]string, error)
	AddTags(domainARN string, kv map[string]string) error
	RemoveTags(domainARN string, keys []string) error

	// Inbound cross-cluster connection operations
	AcceptInboundConnection(connectionID string) (*InboundConnection, error)
	RejectInboundConnection(connectionID string) (*InboundConnection, error)
	DeleteInboundConnection(connectionID string) (*InboundConnection, error)
	DescribeInboundConnections() []*InboundConnection

	// Outbound cross-cluster connection operations
	CreateOutboundConnection(
		connectionAlias string,
		localDomainInfo, remoteDomainInfo map[string]any,
	) (*OutboundConnection, error)
	DescribeOutboundConnections() []*OutboundConnection
	DeleteOutboundConnection(connectionID string) (*OutboundConnection, error)

	// Data source operations
	AddDataSource(domainName, name, description, dataSourceType string) (string, error)
	GetDataSource(domainName, name string) (*DataSource, error)
	ListDataSources(domainName string) ([]*DataSource, error)
	UpdateDataSource(domainName, name, description string) error
	DeleteDataSource(domainName, name string) error

	// Direct-query data source operations
	AddDirectQueryDataSource(name, description, dataSourceType string, openSearchArns []string) (string, error)
	ListDirectQueryDataSources() []*DirectQueryDataSource
	GetDirectQueryDataSource(name string) (*DirectQueryDataSource, error)
	UpdateDirectQueryDataSource(name, description string, openSearchArns []string) (*DirectQueryDataSource, error)
	DeleteDirectQueryDataSource(name string) error

	// Package operations
	AssociatePackage(packageID, domainName string) (*DomainPackageDetails, error)
	AssociatePackages(domainName string, packageIDs []string) ([]DomainPackageDetails, error)
	DissociatePackage(packageID, domainName string) (*DomainPackageDetails, error)
	DissociatePackages(domainName string, packageIDs []string) ([]DomainPackageDetails, error)
	CreatePackage(
		name, pkgType, description string,
		source *PackageSource,
		encryptionOpts *PackageEncryptionOptions,
	) (*Package, error)
	DeletePackage(packageID string) (*Package, error)
	DescribePackages(ids []string) ([]*Package, error)
	GetPackageVersionHistory(packageID string) ([]*PackageVersionHistory, error)
	UpdatePackage(packageID, description string) (*Package, error)
	UpdatePackageScope(packageID, operation string, domainNames []string) (*Package, error)
	ListPackagesForDomain(domainName string) []*Package
	ListDomainsForPackage(packageID string) []string

	// VPC endpoint operations
	AuthorizeVpcEndpointAccess(domainName, account, service string) (*AuthorizedPrincipal, error)
	CreateVpcEndpoint(domainArn string, vpcOptions map[string]any) (*VpcEndpoint, error)
	DescribeVpcEndpoints(ids []string) ([]*VpcEndpoint, []map[string]any)
	UpdateVpcEndpoint(id string, vpcOptions map[string]any) (*VpcEndpoint, error)
	DeleteVpcEndpoint(id string) (*VpcEndpoint, error)
	ListVpcEndpoints() []*VpcEndpoint
	ListVpcEndpointsForDomain(domainArn string) []*VpcEndpoint
	RevokeVpcEndpointAccess(domainName, account string) error
	ListVpcEndpointAccess(domainName string) ([]AuthorizedPrincipal, error)

	// Config/software operations
	CancelDomainConfigChange(domainName string, dryRun bool) ([]string, bool, error)
	CancelServiceSoftwareUpdate(domainName string) (*ServiceSoftwareOptions, error)
	StartServiceSoftwareUpdate(domainName, scheduleAt string) (*ServiceSoftwareOptions, error)

	// Application operations
	CreateApplication(name string, appConfigs []AppConfig, dataSources []AppDataSource) (*Application, error)
	GetApplication(id string) (*Application, error)
	ListApplications() []*Application
	UpdateApplication(id string, appConfigs []AppConfig, dataSources []AppDataSource) (*Application, error)
	DeleteApplication(id string) error
	GetDefaultApplicationSettings(applicationType string) ([]AppSetting, error)
	PutDefaultApplicationSettings(applicationType string, settings []AppSetting) error

	// Scheduled actions
	ListScheduledActions(domainName string) []*ScheduledAction
	UpdateScheduledAction(domainName string, action *ScheduledAction) (*ScheduledAction, error)

	// Reserved instances
	DescribeReservedInstanceOfferings() []*ReservedInstanceOffering
	DescribeReservedInstances() []*ReservedInstance
	PurchaseReservedInstanceOffering(offeringID, name string, count int) (*ReservedInstance, error)

	// Domain maintenance
	StartDomainMaintenance(domainName, action, nodeID string) (*DomainMaintenance, error)
	GetDomainMaintenanceStatus(domainName, maintenanceID string) (*DomainMaintenance, error)
	ListDomainMaintenances(domainName string) ([]*DomainMaintenance, error)

	// Index operations
	CreateIndex(domainName, indexName string, mappings, settings, aliases map[string]any) (*DomainIndex, error)
	DeleteIndex(domainName, indexName string) (*DomainIndex, error)
	GetIndex(domainName, indexName string) (*DomainIndex, error)
	UpdateIndex(domainName, indexName string, mappings, settings map[string]any) (*DomainIndex, error)

	// Document operations (real per-index document storage + bounded search)
	IndexDocument(domainName, indexName, docID string, doc map[string]any) (string, bool, error)
	GetDocument(domainName, indexName, docID string) (map[string]any, error)
	DeleteDocument(domainName, indexName, docID string) error
	CountDocuments(domainName, indexName string) (int, error)
	DomainDocumentCount(domainName string) int
	SearchIndex(domainName, indexName string, query map[string]any, size int) (*SearchResult, error)

	// Upgrade operations
	UpgradeDomain(domainName, upgradeName string) error
	GetUpgradeHistory(domainName string) ([]*UpgradeHistory, error)
	GetUpgradeStatus(domainName string) (upgradeName, upgradeStatus, upgradeStep string, err error)

	// Auto-tune operations
	SetAutoTune(domainName, desiredState string, schedules []AutoTuneMaintenanceSchedule) error
	GetAutoTune(domainName string) ([]*AutoTune, error)

	// Instance type limits
	DescribeInstanceTypeLimits(instanceType, engineVersion string) (*InstanceTypeLimits, error)

	// Instance type details and compatible versions
	ListInstanceTypeDetails(engineVersion, instanceType string) []map[string]any
	GetCompatibleVersions(domainName string) []map[string]any

	// Engine-type filtered list
	ListDomainNamesByEngine(engineType string) []string

	// ListDomainEntriesFiltered returns name+engine version under a single lock.
	ListDomainEntriesFiltered(engineType string) []DomainEntry

	// Serverless collection operations
	CreateServerlessCollection(
		name, collectionType, description, kmsKeyArn string,
		tags map[string]string,
	) (*ServerlessCollection, error)
	BatchGetServerlessCollections(ids, names []string) []*ServerlessCollection
	DeleteServerlessCollection(id string) (*ServerlessCollection, error)

	// Serverless access policy operations
	CreateServerlessAccessPolicy(policyType, name, description, policy string) (*ServerlessAccessPolicy, error)
	GetServerlessAccessPolicy(policyType, name string) (*ServerlessAccessPolicy, error)
	ListServerlessAccessPolicies(policyType string) []*ServerlessAccessPolicy
	UpdateServerlessAccessPolicy(
		policyType, name, description, policy, policyVersion string,
	) (*ServerlessAccessPolicy, error)
	DeleteServerlessAccessPolicy(policyType, name string) error

	// Serverless security config operations
	CreateServerlessSecurityConfig(
		configType, description string,
		samlOptions *ServerlessSAMLOptions,
	) (*ServerlessSecurityConfig, error)
	GetServerlessSecurityConfig(id string) (*ServerlessSecurityConfig, error)
	ListServerlessSecurityConfigs(configType string) []*ServerlessSecurityConfig
	UpdateServerlessSecurityConfig(
		id, description, configVersion string,
		samlOptions *ServerlessSAMLOptions,
	) (*ServerlessSecurityConfig, error)
	DeleteServerlessSecurityConfig(id string) error

	// Serverless encryption policy operations
	CreateServerlessEncryptionPolicy(policyType, name, description, policy string) (*ServerlessEncryptionPolicy, error)
	GetServerlessEncryptionPolicy(policyType, name string) (*ServerlessEncryptionPolicy, error)
	ListServerlessEncryptionPolicies(policyType string) []*ServerlessEncryptionPolicy
	UpdateServerlessEncryptionPolicy(
		policyType, name, description, policy, policyVersion string,
	) (*ServerlessEncryptionPolicy, error)
	DeleteServerlessEncryptionPolicy(policyType, name string) error

	// Serverless network policy operations
	CreateServerlessNetworkPolicy(policyType, name, description, policy string) (*ServerlessNetworkPolicy, error)
	ListServerlessNetworkPolicies(policyType string) []*ServerlessNetworkPolicy
	DeleteServerlessNetworkPolicy(policyType, name string) error

	// Lifecycle
	Reset()
	Region() string
	AccountID() string
	Snapshot(ctx context.Context) []byte
	Restore(ctx context.Context, data []byte) error
}

StorageBackend defines the interface for OpenSearch backend implementations. All mutating methods must be safe for concurrent use.

type StorageType

type StorageType struct {
	StorageTypeName    string             `json:"StorageTypeName"`
	StorageSubTypeName string             `json:"StorageSubTypeName"`
	StorageTypeLimits  []StorageTypeLimit `json:"StorageTypeLimits"`
}

StorageType describes a storage configuration available for an instance type.

type StorageTypeLimit

type StorageTypeLimit struct {
	LimitName   string   `json:"LimitName"`
	LimitValues []string `json:"LimitValues"`
}

StorageTypeLimit holds a named limit value.

type UpdateDomainConfigInput

type UpdateDomainConfigInput struct {
	EBSOptions                  *EBSOptions
	SnapshotOptions             *SnapshotOptions
	EncryptionAtRestOptions     *EncryptionAtRestOptions
	NodeToNodeEncryptionOptions *NodeToNodeEncryptionOptions
	DomainEndpointOptions       *DomainEndpointOptions
	AdvancedSecurityOptions     *AdvancedSecurityOptions
	VPCOptions                  *VPCOptions
	CognitoOptions              *CognitoOptions
	OffPeakWindowOptions        *OffPeakWindowOptions
	IdentityCenterOptions       *IdentityCenterOptions
	EnableSoftwareUpdateOptions *EnableSoftwareUpdateOptions
	LogPublishingOptions        map[string]*LogPublishingOption
	ClusterConfig               *ClusterConfig
	AccessPolicies              string
	EngineVersion               string
}

UpdateDomainConfigInput holds mutable fields for UpdateDomainConfig.

type UpgradeHistory

type UpgradeHistory struct {
	UpgradeName    string            `json:"UpgradeName"`
	UpgradeStatus  string            `json:"UpgradeStatus"`
	StepsList      []UpgradeStepItem `json:"StepsList"`
	StartTimestamp float64           `json:"StartTimestamp"`
}

UpgradeHistory records a single domain upgrade event.

type UpgradeStepItem

type UpgradeStepItem struct {
	UpgradeStep       string   `json:"UpgradeStep"`
	UpgradeStepStatus string   `json:"UpgradeStepStatus"`
	Issues            []string `json:"Issues,omitempty"`
	ProgressPercent   float64  `json:"ProgressPercent"`
}

UpgradeStepItem describes one step in an upgrade.

type VPCOptions

type VPCOptions struct {
	VPCID            string   `json:"vpcId,omitempty"`
	SecurityGroupIDs []string `json:"securityGroupIds,omitempty"`
	SubnetIDs        []string `json:"subnetIds,omitempty"`
}

VPCOptions holds VPC configuration for an OpenSearch domain.

type VpcEndpoint

type VpcEndpoint struct {
	StatusUntil      time.Time      `json:"statusUntil,omitzero"`
	VpcOptions       map[string]any `json:"VpcOptions"`
	VpcEndpointID    string         `json:"VpcEndpointId"`
	VpcEndpointOwner string         `json:"VpcEndpointOwner"`
	DomainArn        string         `json:"DomainArn"`
	Status           string         `json:"Status"`
	Endpoint         string         `json:"Endpoint"`
}

VpcEndpoint represents a VPC endpoint for an OpenSearch domain.

type WindowStartTime

type WindowStartTime struct {
	Hours   int `json:"hours"`
	Minutes int `json:"minutes"`
}

WindowStartTime holds hours and minutes for a maintenance window start.

type ZoneAwarenessConfig

type ZoneAwarenessConfig struct {
	AvailabilityZoneCount int `json:"availabilityZoneCount"`
}

ZoneAwarenessConfig holds zone awareness settings.

Jump to

Keyboard shortcuts

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