elasticsearch

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 21 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Elasticsearch

Parity grade: A · SDK aws-sdk-go-v2/service/elasticsearchservice@v1.45.4 · last audited 2026-08-15 (8dc21e834)

Coverage

Metric Value
Operations audited 51 (51 ok)
Known gaps 5
Deferred items 0
Resource leaks clean
Known gaps
  • "GetUpgradeStatus.UpgradeName (gopherstack-6flj, 2026-08-15): real, optional *string member \ never emitted -- no upgrade-name/upgrade-history state is tracked anywhere in this backend \ (GetUpgradeHistory always returns empty), so there is no honest source value; fabricating a \ plausible name would be invented state, not parity."
  • "PackageDetails.AvailablePackageVersion and DomainPackageDetails.PackageVersion/ReferencePath/ \ LastUpdated (gopherstack-6flj, 2026-08-15): real members with no backing state at all in this \ backend's Package model (models.go) -- a structural modeling gap, not a value the backend \ already holds and fails to emit. ErrorDetails on both types already handled the same way \ (see packageJSON's doc comment)."
  • "Domains never transition through a Processing/creating state -- CreateElasticsearchDomain \ returns Processing=false / DomainProcessingStatus=Active immediately, and Endpoint is \ populated synchronously too, so every field a real client would poll on (Processing, \ DomainProcessingStatus, Endpoint, and DescribeElasticsearchDomainConfig's per-field \ OptionStatus.State) is self-consistently 'already done'. Re-verified 2026-08-10 \ (gopherstack-toz8): checked whether any client-visible action (Create, \ UpdateElasticsearchDomainConfig, Delete) should visibly flip Processing to true -- this \ backend applies all three synchronously with no async work to represent, so there is \ nothing for a transient Processing=true to model faithfully; a fake timed delay would be \ invented state, not parity. Confirmed deliberate simplification, not a stub -- SDK callers \ that poll DescribeElasticsearchDomain waiting for Processing==false succeed immediately \ instead of spinning. Separately (not in scope this pass): ElasticsearchDomainStatus.Created/ \ Deleted (types.go:958-966) are not modeled at all, unlike Processing/DomainProcessingStatus \ which are (see toDomainStatusJSON)."
  • "VPCOptions.VPCId and .AvailabilityZones are never populated on Describe/domain-status \ responses -- deriving them would require a cross-service EC2 subnet/VPC lookup this \ backend does not perform (SubnetIds/SecurityGroupIds are correctly modeled and echoed). \ Matches services/opensearch's identical, already-accepted simplification. Needs cli.go \ wiring to close: this service has no reference to any EC2 backend today (grep confirms no \ ec2 import in services/elasticsearch), so VPCId/AvailabilityZones would need either (a) an \ EC2 lookup interface (mirroring how services/elasticsearch already takes a DNSRegistrar \ interface, store_setup.go) that cli.go wires to the real services/ec2 backend when both \ services are registered, or (b) a shared pkgs/ helper cli.go injects both backends into. \ Either way the wiring decision belongs in cli.go, which this pass does not touch."
  • "AutoTuneOptions.RollbackOnDisable (types.AutoTuneOptions, Update-only -- it is not a \ member of the Create-only types.AutoTuneOptionsInput) is not modeled. Not filed as a bd \ issue this pass: this backend has no rollback state machine to act on it, and it is a \ narrower field than the two this pass targeted (SAMLOptions/MaintenanceSchedules)."

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")
	// ErrValidation is returned for invalid or missing input parameters.
	ErrValidation = errors.New("ValidationException")
	// ErrInvalidParameter is an alias for ErrValidation kept for compatibility.
	ErrInvalidParameter    = ErrValidation
	ErrConnectionNotFound  = errors.New("ResourceNotFoundException")
	ErrPackageNotFound     = errors.New("ResourceNotFoundException")
	ErrVpcEndpointNotFound = errors.New("ResourceNotFoundException")
	// ErrPackageAlreadyAssociated is returned when AssociatePackage targets a
	// (package, domain) pair that is already associated. AWS returns ConflictException.
	ErrPackageAlreadyAssociated = errors.New("ConflictException")
)

Errors returned by the Elasticsearch backend.

View Source
var ErrNilAppContext = errors.New("AppContext is required")

ErrNilAppContext is returned by Init when appCtx is nil.

Functions

This section is empty.

Types

type AdvancedSecurityOptions added in v1.2.0

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

AdvancedSecurityOptions holds fine-grained access control settings (types.AdvancedSecurityOptions on response). Master user credentials (MasterUserOptions on the *Input request shape) are intentionally not persisted here: real AWS never echoes MasterUserOptions back on any Describe/Create/Update response.

type AutoTuneMaintenanceSchedule added in v1.3.1

type AutoTuneMaintenanceSchedule struct {
	StartAt                     time.Time `json:"startAt,omitzero"`
	Duration                    *Duration `json:"duration,omitempty"`
	CronExpressionForRecurrence string    `json:"cronExpressionForRecurrence,omitempty"`
}

AutoTuneMaintenanceSchedule is one recurring Auto-Tune maintenance window (types.AutoTuneMaintenanceSchedule).

type AutoTuneOptions added in v1.2.0

type AutoTuneOptions struct {
	DesiredState         string                        `json:"desiredState,omitempty"`
	MaintenanceSchedules []AutoTuneMaintenanceSchedule `json:"maintenanceSchedules,omitempty"`
}

AutoTuneOptions holds the Auto-Tune desired state and maintenance schedules for a domain (types.AutoTuneOptionsInput).

type ClusterConfig

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

ClusterConfig represents the cluster configuration for an Elasticsearch domain.

type CognitoOptions added in v1.2.0

type CognitoOptions struct {
	UserPoolID     string `json:"userPoolID,omitempty"`
	IdentityPoolID string `json:"identityPoolID,omitempty"`
	RoleARN        string `json:"roleARN,omitempty"`
	Enabled        bool   `json:"enabled"`
}

CognitoOptions holds the Cognito user/identity pool configuration for Kibana authentication (types.CognitoOptions -- the same shape is used for both the request and response).

type CreateDomainInput

type CreateDomainInput struct {
	VPCOptions                  *VPCOptions
	Tags                        map[string]string
	LogPublishingOptions        map[string]LogPublishingOption
	AutoTuneOptions             *AutoTuneOptions
	AdvancedOptions             map[string]string
	AdvancedSecurityOptions     *AdvancedSecurityOptions
	CognitoOptions              *CognitoOptions
	DeploymentStrategyOptions   *DeploymentStrategyOptions
	AccessPolicies              string
	TLSSecurityPolicy           string
	ElasticsearchVersion        string
	Name                        string
	EBSOptions                  EBSOptions
	ClusterConfig               ClusterConfig
	SnapshotOptions             SnapshotOptions
	EncryptionAtRestEnabled     bool
	NodeToNodeEncryptionEnabled bool
	EnforceHTTPS                bool
}

CreateDomainInput holds all parameters for CreateDomain.

type CrossClusterDomainInfo

type CrossClusterDomainInfo struct {
	OwnerID    string `json:"OwnerId"`
	DomainName string `json:"DomainName"`
	Region     string `json:"Region"`
}

CrossClusterDomainInfo holds domain endpoint info used in cross-cluster connections.

type DNSRegistrar

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

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

type DeploymentStrategyOptions added in v1.3.1

type DeploymentStrategyOptions struct {
	DeploymentStrategy string `json:"deploymentStrategy"`
}

DeploymentStrategyOptions holds the deployment strategy used when applying domain configuration changes (types.DeploymentStrategyOptions). Valid values for DeploymentStrategy are Default and CapacityOptimized -- confirmed against types.DeploymentStrategy in the pinned SDK's types/enums.go:130-136.

type Domain

type Domain struct {
	ConfigUpdatedAt           time.Time                      `json:"configUpdatedAt,omitzero"`
	CreatedAt                 time.Time                      `json:"createdAt,omitzero"`
	VPCOptions                *VPCOptions                    `json:"vpcOptions,omitempty"`
	AdvancedOptions           map[string]string              `json:"advancedOptions,omitempty"`
	LogPublishingOptions      map[string]LogPublishingOption `json:"logPublishingOptions,omitempty"`
	AutoTuneOptions           *AutoTuneOptions               `json:"autoTuneOptions,omitempty"`
	Tags                      *tags.Tags                     `json:"tags,omitempty"`
	AdvancedSecurityOptions   *AdvancedSecurityOptions       `json:"advancedSecurityOptions,omitempty"`
	CognitoOptions            *CognitoOptions                `json:"cognitoOptions,omitempty"`
	DeploymentStrategyOptions *DeploymentStrategyOptions     `json:"deploymentStrategyOptions,omitempty"`
	ElasticsearchVersion      string                         `json:"elasticsearchVersion"`
	AccessPolicies            string                         `json:"accessPolicies,omitempty"`
	Status                    string                         `json:"status"`
	TLSSecurityPolicy         string                         `json:"tlsSecurityPolicy,omitempty"`
	DomainID                  string                         `json:"domainID"`
	Name                      string                         `json:"name"`

	Endpoint                    string          `json:"endpoint"`
	ARN                         string          `json:"arn"`
	EBSOptions                  EBSOptions      `json:"ebsOptions"`
	ClusterConfig               ClusterConfig   `json:"clusterConfig"`
	SnapshotOptions             SnapshotOptions `json:"snapshotOptions"`
	ConfigVersion               int             `json:"configVersion"`
	EncryptionAtRestEnabled     bool            `json:"encryptionAtRestEnabled"`
	NodeToNodeEncryptionEnabled bool            `json:"nodeToNodeEncryptionEnabled"`
	EnforceHTTPS                bool            `json:"enforceHTTPS"`
	// contains filtered or unexported fields
}

Domain represents an Elasticsearch domain.

type Duration added in v1.3.1

type Duration struct {
	Unit  string `json:"unit,omitempty"`
	Value int64  `json:"value,omitempty"`
}

Duration holds a maintenance-schedule duration (types.Duration). Unit's only valid enum value is "HOURS" -- confirmed against types.TimeUnit in the pinned SDK's types/enums.go:772-786.

type EBSOptions

type EBSOptions struct {
	VolumeType string `json:"volumeType"`
	VolumeSize int    `json:"volumeSize"`
	Iops       int    `json:"iops"`
	Throughput int    `json:"throughput"`
	EBSEnabled bool   `json:"ebsEnabled"`
}

EBSOptions represents the EBS storage options for an Elasticsearch domain.

type EngineConfig

type EngineConfig interface {
	GetElasticsearchEngine() string
}

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

type Handler

type Handler struct {
	Backend *InMemoryBackend

	AccountID string
	Region    string
	// contains filtered or unexported fields
}

Handler is the HTTP handler for Elasticsearch operations.

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a new Elasticsearch 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 Elasticsearch 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 domain name 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 implements service.Resettable by delegating to the backend.

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 Elasticsearch requests by path prefix.

func (*Handler) ServeHTTP

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

ServeHTTP implements http.Handler for the Elasticsearch service.

func (*Handler) Snapshot

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

Snapshot implements persistence.Persistable by delegating to the backend.

type InMemoryBackend

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

InMemoryBackend is the in-memory store for Elasticsearch domains.

Elasticsearch resources are region-scoped in AWS. Phase 3.3 of the datalayer refactor replaces the resource collections that used to be nested by region (outer key = region, e.g. map[string]map[string]*Domain) with a flat *store.Table, keyed by the composite "region|id" string (see regionKey), with a companion *store.Index grouping entries by region for the per-region scans the nested maps used to answer directly -- the same region-qualified-table pattern services/emr and services/codeartifact use. None of Domain/Package/InboundConnection/OutboundConnection/VpcEndpoint/ ReservedInstance carried a region field of their own before this conversion, so each gained an unexported region field purely for this composite key; persistence.go carries it through via a shared regionalDTO wrapper (store.Table.Snapshot's plain json.Marshal cannot see unexported fields).

arnIndex, packagesByName, packageAssociations, and vpcAccess are deliberately NOT converted: store.Table requires a *V value with its own identity, but each entry in these four maps is a bare string or string slice with no identifier of its own. They remain plain region-nested maps, unchanged by this refactor.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new InMemoryBackend.

func (*InMemoryBackend) AcceptInboundCrossClusterSearchConnection

func (b *InMemoryBackend) AcceptInboundCrossClusterSearchConnection(
	ctx context.Context, connectionID string,
) (*InboundConnection, error)

AcceptInboundCrossClusterSearchConnection accepts a pending inbound cross-cluster search connection.

func (*InMemoryBackend) AddDomainInternal

func (b *InMemoryBackend) AddDomainInternal(ctx context.Context, d Domain)

AddDomainInternal seeds a domain directly into the backend for testing. Tags are initialised fresh for the seeded domain.

func (*InMemoryBackend) AddInboundConnectionInternal

func (b *InMemoryBackend) AddInboundConnectionInternal(ctx context.Context, conn InboundConnection)

AddInboundConnectionInternal seeds an inbound connection for testing.

func (*InMemoryBackend) AddTags

func (b *InMemoryBackend) AddTags(ctx context.Context, 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(ctx context.Context, packageID, domainName string) error

AssociatePackage associates an Elasticsearch package with a domain.

func (*InMemoryBackend) AuthorizeVpcEndpointAccess

func (b *InMemoryBackend) AuthorizeVpcEndpointAccess(ctx context.Context, domainName, account string) error

AuthorizeVpcEndpointAccess grants an account or service access to the domain's VPC endpoint.

func (*InMemoryBackend) CancelDomainConfigChange

func (b *InMemoryBackend) CancelDomainConfigChange(ctx context.Context, domainName string) (*Domain, error)

CancelDomainConfigChange cancels any in-progress configuration change for a domain. Because the in-memory backend applies changes synchronously this is a no-op.

func (*InMemoryBackend) CancelElasticsearchServiceSoftwareUpdate

func (b *InMemoryBackend) CancelElasticsearchServiceSoftwareUpdate(
	ctx context.Context, domainName string,
) (*Domain, error)

CancelElasticsearchServiceSoftwareUpdate cancels a scheduled software update. Because the in-memory backend never schedules updates this is a no-op.

func (*InMemoryBackend) CreateDomain

func (b *InMemoryBackend) CreateDomain(ctx context.Context, inp CreateDomainInput) (*Domain, error)

CreateDomain creates a new Elasticsearch domain.

func (*InMemoryBackend) CreateOutboundCrossClusterSearchConnection

func (b *InMemoryBackend) CreateOutboundCrossClusterSearchConnection(
	ctx context.Context,
	localDomain, remoteDomain CrossClusterDomainInfo,
	alias string,
) (*OutboundConnection, error)

CreateOutboundCrossClusterSearchConnection creates a new outbound cross-cluster search connection request.

func (*InMemoryBackend) CreatePackage

func (b *InMemoryBackend) CreatePackage(
	ctx context.Context, name, packageType, description string, source PackageSource,
) (*Package, error)

CreatePackage creates a new Elasticsearch package (e.g., a dictionary file). PackageSource (S3BucketName + S3Key) is a required member of CreatePackageInput in the real API (types.CreatePackageInput.PackageSource has no default), so a missing/incomplete source is rejected exactly like a missing name or an invalid type.

func (*InMemoryBackend) CreateVpcEndpoint

func (b *InMemoryBackend) CreateVpcEndpoint(
	ctx context.Context, domainARN string, vpcOptions VPCOptions,
) (*VpcEndpoint, error)

CreateVpcEndpoint creates a managed VPC endpoint for an Elasticsearch domain. The endpoint's region is resolved from the domain ARN, falling back to ctx.

func (*InMemoryBackend) DeleteDomain

func (b *InMemoryBackend) DeleteDomain(ctx context.Context, name string) (*Domain, error)

DeleteDomain removes a domain by name.

func (*InMemoryBackend) DeleteElasticsearchServiceRole

func (b *InMemoryBackend) DeleteElasticsearchServiceRole() error

DeleteElasticsearchServiceRole deletes the Elasticsearch service-linked IAM role. The in-memory backend has no IAM state so this is always a no-op success.

func (*InMemoryBackend) DeleteInboundCrossClusterSearchConnection

func (b *InMemoryBackend) DeleteInboundCrossClusterSearchConnection(
	ctx context.Context, connectionID string,
) (*InboundConnection, error)

DeleteInboundCrossClusterSearchConnection removes an inbound cross-cluster connection.

func (*InMemoryBackend) DeleteOutboundCrossClusterSearchConnection

func (b *InMemoryBackend) DeleteOutboundCrossClusterSearchConnection(
	ctx context.Context, connectionID string,
) (*OutboundConnection, error)

DeleteOutboundCrossClusterSearchConnection removes an outbound cross-cluster connection.

func (*InMemoryBackend) DeletePackage

func (b *InMemoryBackend) DeletePackage(ctx context.Context, packageID string) (*Package, error)

DeletePackage removes a package by ID.

func (*InMemoryBackend) DeleteVpcEndpoint

func (b *InMemoryBackend) DeleteVpcEndpoint(ctx context.Context, vpcEndpointID string) (*VpcEndpoint, error)

DeleteVpcEndpoint removes a VPC endpoint by ID.

func (*InMemoryBackend) DescribeDomain

func (b *InMemoryBackend) DescribeDomain(ctx context.Context, name string) (*Domain, error)

DescribeDomain returns details about a domain.

func (*InMemoryBackend) DescribeDomainAutoTunes

func (b *InMemoryBackend) DescribeDomainAutoTunes(ctx context.Context, domainName string) error

DescribeDomainAutoTunes validates a domain exists and returns (the in-memory backend has no auto-tune state).

func (*InMemoryBackend) DescribeDomainChangeProgress

func (b *InMemoryBackend) DescribeDomainChangeProgress(ctx context.Context, domainName string) error

DescribeDomainChangeProgress validates a domain exists and returns (changes are synchronous in-memory).

func (*InMemoryBackend) DescribeInboundCrossClusterSearchConnections

func (b *InMemoryBackend) DescribeInboundCrossClusterSearchConnections(ctx context.Context) []*InboundConnection

DescribeInboundCrossClusterSearchConnections returns all inbound cross-cluster connections.

func (*InMemoryBackend) DescribeOutboundCrossClusterSearchConnections

func (b *InMemoryBackend) DescribeOutboundCrossClusterSearchConnections(ctx context.Context) []*OutboundConnection

DescribeOutboundCrossClusterSearchConnections returns all outbound cross-cluster connections.

func (*InMemoryBackend) DescribePackages

func (b *InMemoryBackend) DescribePackages(ctx context.Context, packageIDs []string) []*Package

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

func (*InMemoryBackend) DescribeReservedElasticsearchInstanceOfferings

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

DescribeReservedElasticsearchInstanceOfferings returns available reserved instance offerings.

func (*InMemoryBackend) DescribeReservedElasticsearchInstances

func (b *InMemoryBackend) DescribeReservedElasticsearchInstances(ctx context.Context) []ReservedInstance

DescribeReservedElasticsearchInstances returns purchased reserved instances for the request's region.

func (*InMemoryBackend) DescribeVpcEndpoints

func (b *InMemoryBackend) DescribeVpcEndpoints(ctx context.Context, vpcEndpointIDs []string) []*VpcEndpoint

DescribeVpcEndpoints returns VPC endpoints matching the given IDs, or all endpoints if empty.

func (*InMemoryBackend) DissociatePackage

func (b *InMemoryBackend) DissociatePackage(ctx context.Context, packageID, domainName string) error

DissociatePackage removes a package association from a domain.

func (*InMemoryBackend) GetPackageVersionHistory

func (b *InMemoryBackend) GetPackageVersionHistory(ctx context.Context, packageID string) ([]*Package, error)

GetPackageVersionHistory returns the version history for a package.

func (*InMemoryBackend) GetUpgradeHistory

func (b *InMemoryBackend) GetUpgradeHistory(ctx context.Context, domainName string) error

GetUpgradeHistory validates a domain exists and returns empty history (no upgrade state tracked).

func (*InMemoryBackend) GetUpgradeStatus

func (b *InMemoryBackend) GetUpgradeStatus(ctx context.Context, domainName string) error

GetUpgradeStatus validates a domain exists and returns (no upgrade in progress in-memory).

func (*InMemoryBackend) ListDomainNames

func (b *InMemoryBackend) ListDomainNames(ctx context.Context) []string

ListDomainNames returns the sorted names of all domains in the request's region.

func (*InMemoryBackend) ListDomainsForPackage

func (b *InMemoryBackend) ListDomainsForPackage(ctx context.Context, packageID string) ([]string, error)

ListDomainsForPackage returns all domain names associated with a package.

func (*InMemoryBackend) ListPackagesForDomain

func (b *InMemoryBackend) ListPackagesForDomain(ctx context.Context, domainName string) []*Package

ListPackagesForDomain returns all packages associated with a domain.

func (*InMemoryBackend) ListTags

func (b *InMemoryBackend) ListTags(ctx context.Context, domainARN string) (map[string]string, error)

ListTags returns tags for the domain identified by ARN. The region is resolved from the ARN, falling back to the ctx region.

func (*InMemoryBackend) ListVpcEndpointAccess

func (b *InMemoryBackend) ListVpcEndpointAccess(ctx context.Context, domainName string) ([]string, error)

ListVpcEndpointAccess returns authorized account principals for a domain's VPC endpoint access.

func (*InMemoryBackend) ListVpcEndpoints

func (b *InMemoryBackend) ListVpcEndpoints(ctx context.Context) []*VpcEndpoint

ListVpcEndpoints returns all VPC endpoints in the request's region.

func (*InMemoryBackend) ListVpcEndpointsForDomain

func (b *InMemoryBackend) ListVpcEndpointsForDomain(ctx context.Context, domainName string) []*VpcEndpoint

ListVpcEndpointsForDomain returns VPC endpoints associated with a specific domain ARN.

func (*InMemoryBackend) PurchaseReservedElasticsearchInstanceOffering

func (b *InMemoryBackend) PurchaseReservedElasticsearchInstanceOffering(
	ctx context.Context, offeringID, name string, count int,
) (*ReservedInstance, error)

PurchaseReservedElasticsearchInstanceOffering purchases a reserved instance offering.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the backend's default AWS region.

func (*InMemoryBackend) RejectInboundCrossClusterSearchConnection

func (b *InMemoryBackend) RejectInboundCrossClusterSearchConnection(
	ctx context.Context, connectionID string,
) (*InboundConnection, error)

RejectInboundCrossClusterSearchConnection rejects a pending inbound connection.

func (*InMemoryBackend) RemoveTags

func (b *InMemoryBackend) RemoveTags(ctx context.Context, 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 in-memory state. It closes all domain Tags to release Prometheus metrics before discarding the domain maps.

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(ctx context.Context, domainName, account string) error

RevokeVpcEndpointAccess revokes an account's access to a domain's VPC endpoint.

func (*InMemoryBackend) SetDNSRegistrar

func (b *InMemoryBackend) SetDNSRegistrar(dns DNSRegistrar)

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

func (*InMemoryBackend) Snapshot

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

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

func (*InMemoryBackend) StartElasticsearchServiceSoftwareUpdate

func (b *InMemoryBackend) StartElasticsearchServiceSoftwareUpdate(
	ctx context.Context, domainName string,
) (*Domain, error)

StartElasticsearchServiceSoftwareUpdate schedules a software update (no-op in-memory).

func (*InMemoryBackend) UpdateDomainConfig

func (b *InMemoryBackend) UpdateDomainConfig(ctx context.Context, name string, cfg UpdateConfig) (*Domain, error)

UpdateDomainConfig updates the cluster configuration and/or EBS options for a domain.

func (*InMemoryBackend) UpdatePackage

func (b *InMemoryBackend) UpdatePackage(ctx context.Context, packageID, description string) (*Package, error)

UpdatePackage updates a package description.

func (*InMemoryBackend) UpdateVpcEndpoint

func (b *InMemoryBackend) UpdateVpcEndpoint(
	ctx context.Context, vpcEndpointID string, vpcOptions VPCOptions,
) (*VpcEndpoint, error)

UpdateVpcEndpoint updates the VPC options of a VPC endpoint.

func (*InMemoryBackend) UpgradeElasticsearchDomain

func (b *InMemoryBackend) UpgradeElasticsearchDomain(
	ctx context.Context, domainName, targetVersion string,
) (*Domain, error)

UpgradeElasticsearchDomain upgrades a domain to the target version.

type InboundConnection

type InboundConnection struct {
	ConnectionID     string                 `json:"connectionID"`
	ConnectionStatus string                 `json:"connectionStatus"`
	SourceDomainInfo CrossClusterDomainInfo `json:"sourceDomainInfo"`
	DestDomainInfo   CrossClusterDomainInfo `json:"destDomainInfo"`
	// contains filtered or unexported fields
}

InboundConnection represents an inbound cross-cluster search connection.

type LogPublishingOption added in v1.2.0

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

LogPublishingOption holds a single log-type publishing configuration (types.LogPublishingOption), keyed by AWS LogType string (INDEX_SLOW_LOGS/SEARCH_SLOW_LOGS/ES_APPLICATION_LOGS/AUDIT_LOGS) in Domain.LogPublishingOptions.

type OutboundConnection

type OutboundConnection struct {
	ConnectionID     string                 `json:"connectionID"`
	ConnectionAlias  string                 `json:"connectionAlias"`
	ConnectionStatus string                 `json:"connectionStatus"`
	LocalDomainInfo  CrossClusterDomainInfo `json:"localDomainInfo"`
	RemoteDomainInfo CrossClusterDomainInfo `json:"remoteDomainInfo"`
	// contains filtered or unexported fields
}

OutboundConnection represents an outbound cross-cluster search connection.

type Package

type Package struct {
	CreatedAt     time.Time            `json:"createdAt,omitzero"`
	LastUpdatedAt time.Time            `json:"lastUpdatedAt,omitzero"`
	ErrorDetails  *PackageErrorDetails `json:"errorDetails,omitempty"`
	ID            string               `json:"packageID"`
	Name          string               `json:"packageName"`
	PackageType   string               `json:"packageType"`
	Description   string               `json:"packageDescription"`
	Status        string               `json:"packageStatus"`
	PackageSource PackageSource        `json:"packageSource"`
	// contains filtered or unexported fields
}

Package represents an Elasticsearch package (e.g., a custom dictionary or synonym file).

type PackageErrorDetails added in v1.3.1

type PackageErrorDetails struct {
	ErrorMessage string `json:"errorMessage,omitempty"`
	ErrorType    string `json:"errorType,omitempty"`
}

PackageErrorDetails carries the error message/type for a package stuck in COPY_FAILED (types.ErrorDetails). This backend has no COPYING/COPY_FAILED state machine -- packages always transition straight to AVAILABLE -- so this is always nil in practice; the type is still modeled so the field is wire-correct if that ever changes.

type PackageSource added in v1.2.0

type PackageSource struct {
	S3BucketName string `json:"s3BucketName"`
	S3Key        string `json:"s3Key"`
}

PackageSource holds the S3 bucket/key location a package was imported from (types.PackageSource). It is a required member of CreatePackageInput in the real API but is never echoed back by any Describe/Create/Update package response (types.PackageDetails has no PackageSource field), so it is stored on Package purely so the backend has captured real input state -- it is intentionally not surfaced by toPackageJSON.

type Provider

type Provider struct{}

Provider implements service.Provider for the Elasticsearch service.

func (*Provider) Init

Init initializes the Elasticsearch service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the service provider name.

type ReservedInstance

type ReservedInstance struct {
	ReservationID   string `json:"reservedElasticsearchInstanceId"`
	ReservationName string `json:"reservationName"`
	OfferingID      string `json:"reservedElasticsearchInstanceOfferingId"`
	InstanceType    string `json:"elasticsearchInstanceType"`
	State           string `json:"state"`

	FixedPrice float64 `json:"fixedPrice"`
	UsagePrice float64 `json:"usagePrice"`
	Duration   int     `json:"duration"`
	Count      int     `json:"elasticsearchInstanceCount"`
	// contains filtered or unexported fields
}

ReservedInstance represents a purchased reserved Elasticsearch instance.

type ReservedInstanceOffering

type ReservedInstanceOffering struct {
	OfferingID    string  `json:"reservedElasticsearchInstanceOfferingId"`
	InstanceType  string  `json:"elasticsearchInstanceType"`
	PaymentOption string  `json:"paymentOption"`
	Currency      string  `json:"currencyCode"`
	FixedPrice    float64 `json:"fixedPrice"`
	UsagePrice    float64 `json:"usagePrice"`
	Duration      int     `json:"duration"`
}

ReservedInstanceOffering represents a reserved Elasticsearch instance offering.

type SAMLIdp added in v1.3.1

type SAMLIdp struct {
	EntityID        string `json:"entityID"`
	MetadataContent string `json:"metadataContent"`
}

SAMLIdp holds the SAML Identity Provider's entity ID and metadata (types.SAMLIdp). Both members are required by the SDK client whenever Idp is present -- confirmed against validateSAMLIdp in aws-sdk-go-v2/service/elasticsearchservice@v1.45.4's validators.go:1091-1107.

type SAMLOptions added in v1.3.1

type SAMLOptions struct {
	Idp                   *SAMLIdp `json:"idp,omitempty"`
	MasterBackendRole     string   `json:"masterBackendRole,omitempty"`
	MasterUserName        string   `json:"masterUserName,omitempty"`
	RolesKey              string   `json:"rolesKey,omitempty"`
	SubjectKey            string   `json:"subjectKey,omitempty"`
	SessionTimeoutMinutes int32    `json:"sessionTimeoutMinutes,omitempty"`
	Enabled               bool     `json:"enabled"`
}

SAMLOptions holds the SAML SSO configuration for Kibana authentication (types.SAMLOptionsInput on request, types.SAMLOptionsOutput on response). MasterUserName/MasterBackendRole are credential-adjacent fields that real AWS never echoes back on any Describe/Create/Update response (types.SAMLOptionsOutput has no MasterUserName/MasterBackendRole members), matching MasterUserOptions's existing treatment in this backend: stored for completeness, excluded by the response builder.

type SnapshotOptions

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

SnapshotOptions holds automated snapshot configuration for a domain.

type UpdateConfig

type UpdateConfig struct {
	ClusterConfig               *ClusterConfig
	EBSOptions                  *EBSOptions
	SnapshotOptions             *SnapshotOptions
	AdvancedOptions             map[string]string
	VPCOptions                  *VPCOptions
	CognitoOptions              *CognitoOptions
	AdvancedSecurityOptions     *AdvancedSecurityOptions
	AutoTuneOptions             *AutoTuneOptions
	DeploymentStrategyOptions   *DeploymentStrategyOptions
	LogPublishingOptions        map[string]LogPublishingOption
	AccessPolicies              *string
	TLSSecurityPolicy           *string
	EncryptionAtRestEnabled     *bool
	NodeToNodeEncryptionEnabled *bool
	EnforceHTTPS                *bool
}

UpdateConfig holds the fields that can be updated via UpdateDomainConfig.

type VPCOptions added in v1.2.0

type VPCOptions struct {
	SubnetIDs        []string `json:"subnetIDs,omitempty"`
	SecurityGroupIDs []string `json:"securityGroupIDs,omitempty"`
}

VPCOptions holds the subnet/security-group configuration for placing a domain inside a VPC (types.VPCOptions on request, types.VPCDerivedInfo on response). AvailabilityZones/VPCId are not modeled -- deriving them would require cross-service EC2 subnet lookups this backend does not perform (matches services/opensearch's identical simplification), so they are always left empty on the wire.

type VpcEndpoint

type VpcEndpoint struct {
	VpcOptions     VPCOptions `json:"vpcOptions"`
	ID             string     `json:"vpcEndpointID"`
	OwnerAccountID string     `json:"ownerAccountID"`
	DomainARN      string     `json:"domainARN"`
	Endpoint       string     `json:"endpoint"`
	Status         string     `json:"status"`

	AuthorizedAccts []string `json:"authorizedAccounts"`
	// contains filtered or unexported fields
}

VpcEndpoint represents a managed VPC endpoint for an Elasticsearch domain.

type ZoneAwarenessConfig

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

ZoneAwarenessConfig holds the zone awareness configuration for a cluster.

Jump to

Keyboard shortcuts

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