mq

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: 24 Imported by: 0

README

Amazon MQ

Parity grade: A · SDK aws-sdk-go-v2/service/mq@v1.34.17 · last audited 2026-07-12 (d54e01ab99e95fd424c6787001bee5390eecb16b)

Coverage

Metric Value
Operations audited 24 (22 ok, 2 partial)
Feature families 2 (2 ok)
Known gaps 4
Deferred items 1
Resource leaks clean
Known gaps
  • UpdateBroker mutates EngineVersion/HostInstanceType/SecurityGroups/AuthenticationStrategy/LdapServerMetadata/Logs/Configurations.Current/DataReplicationMode IMMEDIATELY instead of staging them as Pending* and promoting only on a subsequent successful reboot. Real Amazon MQ requires a reboot for these fields to take effect (DescribeBrokerOutput/UpdateBrokerOutput both carry dedicated pendingEngineVersion/pendingHostInstanceType/pendingSecurityGroups/pendingAuthenticationStrategy/pendingLdapServerMetadata/Configurations.Pending/LogsSummary.Pending/pendingDataReplicationMode wire fields for exactly this purpose). The Broker struct already carries all these Pending* fields and brokerResponse/updateBrokerResponse already serialize them, but nothing in backend.go ever assigns them -- they are permanently zero-valued dead fields. Net effect: gopherstack is over-eager (changes apply instantly) rather than under-eager (no SDK poll-loop hang, the specific failure mode called out for other services), but it is not AWS-accurate. Fixing this properly requires reworking applyBrokerCoreFields/applyUpdateBrokerOptions to stage into Pending* fields and extending promoteRebootingToRunning (rename to something like promoteBrokerReboot) to apply staged changes atomically with the REBOOT_IN_PROGRESS->RUNNING transition, plus reworking ~15 existing tests across handler_parity_batch1_test.go/handler_test.go/parity_extension_test.go that currently assert immediate-apply as correct. Deferred this pass due to blast radius vs. payload (no client-breaking behavior); recommend a dedicated follow-up pass. Would also need to decide handling for User-level pending changes (UserPendingChanges/ChangeType CREATE|UPDATE|DELETE) which apply the same reboot-gated pattern to CreateUser/UpdateUser/DeleteUser for ActiveMQ brokers -- currently gopherstack applies those immediately too.
  • Configuration name has no charset/length validation (real AWS: 1-150 chars, alphanumeric + dashes/periods/underscores/tildes); only a non-empty check exists. Low severity -- gopherstack is more permissive than AWS, does not reject valid SDK input.
  • DescribeUser response omits the optional 'pending' (UserPendingChanges) and 'replicationUser' fields -- both are always absent since the underlying pending-changes/CRDR-replication-user features are not modeled. Harmless (optional fields), but linked to the UpdateBroker pending-fields gap above.
  • DescribeSharedResources (added to the mq service-2.json botocore model) has no corresponding operation in the pinned aws-sdk-go-v2/service/mq@v1.34.17 client at all -- out of scope for aws-sdk-go-v2 wire-compat auditing since the Go SDK can't call it.
Deferred
  • Full CRDR (cross-region data replication) simulation: Promote/DataReplicationMetadata population when dataReplicationMode=CRDR is not modeled beyond accepting/echoing the mode string.

More

Documentation

Overview

Package mq provides an in-memory stub of Amazon MQ.

Index

Constants

View Source
const (
	// BrokerStateRunning indicates an active broker.
	BrokerStateRunning = "RUNNING"
	// BrokerStateCreating indicates a broker being provisioned.
	BrokerStateCreating = "CREATION_IN_PROGRESS"
	// BrokerStateDeleting indicates a broker being removed.
	BrokerStateDeleting = "DELETION_IN_PROGRESS"
	// BrokerStateRebooting indicates a broker reboot in progress.
	BrokerStateRebooting = "REBOOT_IN_PROGRESS"

	// EngineTypeActiveMQ is the ActiveMQ engine type.
	EngineTypeActiveMQ = "ACTIVEMQ"
	// EngineTypeRabbitMQ is the RabbitMQ engine type.
	EngineTypeRabbitMQ = "RABBITMQ"

	// DeploymentModeSingleInstance is the single-instance deployment mode.
	DeploymentModeSingleInstance = "SINGLE_INSTANCE"
	// DeploymentModeActiveStandby is the active/standby multi-AZ deployment mode.
	DeploymentModeActiveStandby = "ACTIVE_STANDBY_MULTI_AZ"
	// DeploymentModeCluster is the cluster multi-AZ deployment mode (RabbitMQ).
	DeploymentModeCluster = "CLUSTER_MULTI_AZ"

	// StorageTypeEFS is the EFS storage type (ActiveMQ). AWS MQ's
	// BrokerStorageType enum uses the uppercase form on the wire (see
	// aws-sdk-go-v2/service/mq/types.BrokerStorageTypeEfs); a lowercase value
	// here would round-trip through JSON fine but silently fail any
	// client-side comparison against the SDK's typed enum constants.
	StorageTypeEFS = "EFS"
	// StorageTypeEBS is the EBS storage type (RabbitMQ). See StorageTypeEFS
	// for why this must match the SDK's uppercase enum value.
	StorageTypeEBS = "EBS"

	// PromoteModeFailover is the failover promote mode.
	PromoteModeFailover = "FAILOVER"
	// PromoteModeSwitchover is the switchover promote mode.
	PromoteModeSwitchover = "SWITCHOVER"
)

Variables

View Source
var (
	// ErrNotFound is returned when a requested resource does not exist.
	ErrNotFound = awserr.New("NotFoundException", awserr.ErrNotFound)
	// ErrAlreadyExists is returned when a resource already exists.
	ErrAlreadyExists = awserr.New("ConflictException", awserr.ErrAlreadyExists)
	// ErrValidation is returned when a request contains an invalid parameter.
	ErrValidation = awserr.New("BadRequestException", awserr.ErrInvalidParameter)
)
View Source
var ErrNilAppContext = errors.New("mq: nil AppContext")

ErrNilAppContext is returned when the AppContext passed to Init is nil.

Functions

This section is empty.

Types

type ActionRequired

type ActionRequired struct {
	ActionRequiredCode string `json:"actionRequiredCode,omitempty"`
	ActionRequiredInfo string `json:"actionRequiredInfo,omitempty"`
}

ActionRequired describes a service-side action required on the broker.

type AvailabilityZone

type AvailabilityZone struct {
	Name string `json:"name"`
}

AvailabilityZone describes a single availability zone.

type Broker

type Broker struct {
	EncryptionOptions          *EncryptionOptions       `json:"encryptionOptions,omitempty"`
	Users                      map[string]*User         `json:"-"`
	Configurations             *Configurations          `json:"configurations,omitempty"`
	PendingDataReplicationMeta *DataReplicationMetadata `json:"pendingDataReplicationMetadata,omitempty"`
	PendingLdapServerMetadata  *LdapServerMetadata      `json:"pendingLdapServerMetadata,omitempty"`
	DataReplicationMetadata    *DataReplicationMetadata `json:"dataReplicationMetadata,omitempty"`
	Tags                       map[string]string        `json:"-"`
	LogsSummary                *LogsSummary             `json:"logsSummary,omitempty"`
	Logs                       *Logs                    `json:"logs,omitempty"`
	LdapServerMetadata         *LdapServerMetadata      `json:"ldapServerMetadata,omitempty"`
	MaintenanceWindowStartTime *WeeklyStartTime         `json:"maintenanceWindowStartTime,omitempty"`
	DataReplicationMode        string                   `json:"dataReplicationMode,omitempty"`
	PendingEngineVersion       string                   `json:"pendingEngineVersion,omitempty"`
	AuthenticationStrategy     string                   `json:"authenticationStrategy,omitempty"`
	CreatorRequestID           string                   `json:"creatorRequestId,omitempty"`
	EngineVersion              string                   `json:"engineVersion"`
	PendingDataReplicationMode string                   `json:"pendingDataReplicationMode,omitempty"`
	BrokerArn                  string                   `json:"brokerArn"`
	PendingHostInstanceType    string                   `json:"pendingHostInstanceType,omitempty"`
	Created                    string                   `json:"created"`
	BrokerName                 string                   `json:"brokerName"`
	HostInstanceType           string                   `json:"hostInstanceType"`
	BrokerID                   string                   `json:"brokerId"`
	EngineType                 string                   `json:"engineType"`
	DeploymentMode             string                   `json:"deploymentMode"`
	BrokerState                string                   `json:"brokerState"`
	PendingAuthStrategy        string                   `json:"pendingAuthenticationStrategy,omitempty"`
	StorageType                string                   `json:"storageType,omitempty"`
	ActionsRequired            []ActionRequired         `json:"actionsRequired,omitempty"`
	PendingSecurityGroups      []string                 `json:"pendingSecurityGroups,omitempty"`
	BrokerInstances            []BrokerInstance         `json:"brokerInstances,omitempty"`
	SecurityGroups             []string                 `json:"securityGroups,omitempty"`
	SubnetIDs                  []string                 `json:"subnetIds,omitempty"`
	PubliclyAccessible         bool                     `json:"publiclyAccessible"`
	AutoMinorVersionUpgrade    bool                     `json:"autoMinorVersionUpgrade"`
}

Broker represents an Amazon MQ broker.

type BrokerEngineType

type BrokerEngineType struct {
	EngineType     string          `json:"engineType"`
	EngineVersions []EngineVersion `json:"engineVersions"`
}

BrokerEngineType describes an engine type and its available versions.

type BrokerInstance

type BrokerInstance struct {
	ConsoleURL string   `json:"consoleURL"`
	Endpoints  []string `json:"endpoints"`
}

BrokerInstance holds endpoint information for a broker instance.

type BrokerInstanceOption

type BrokerInstanceOption struct {
	EngineType               string             `json:"engineType"`
	HostInstanceType         string             `json:"hostInstanceType"`
	StorageType              string             `json:"storageType"`
	AvailabilityZones        []AvailabilityZone `json:"availabilityZones"`
	SupportedEngineVersions  []string           `json:"supportedEngineVersions"`
	SupportedDeploymentModes []string           `json:"supportedDeploymentModes"`
}

BrokerInstanceOption describes a broker host instance type and its options.

type Configuration

type Configuration struct {
	Tags           map[string]string       `json:"-"`
	Data           map[int32]string        `json:"-"`
	LatestRevision *ConfigurationRevision  `json:"latestRevision"`
	Arn            string                  `json:"arn"`
	ID             string                  `json:"id"`
	Name           string                  `json:"name"`
	Description    string                  `json:"description"`
	EngineType     string                  `json:"engineType"`
	EngineVersion  string                  `json:"engineVersion"`
	Created        string                  `json:"created"`
	Revisions      []ConfigurationRevision `json:"-"`
}

Configuration represents an Amazon MQ configuration.

type ConfigurationID

type ConfigurationID struct {
	ID       string `json:"id"`
	Revision int32  `json:"revision"`
}

ConfigurationID holds a reference to a broker configuration.

type ConfigurationRevision

type ConfigurationRevision struct {
	Created     string `json:"created"`
	Description string `json:"description,omitempty"`
	Revision    int32  `json:"revision"`
}

ConfigurationRevision holds revision metadata for a configuration.

type Configurations

type Configurations struct {
	Current *ConfigurationID  `json:"current,omitempty"`
	Pending *ConfigurationID  `json:"pending,omitempty"`
	History []ConfigurationID `json:"history,omitempty"`
}

Configurations holds pending and current configuration references.

type CreateBrokerOptions

type CreateBrokerOptions struct {
	Configuration              *ConfigurationID
	EncryptionOptions          *EncryptionOptions
	MaintenanceWindowStartTime *WeeklyStartTime
	LdapServerMetadata         *LdapServerMetadata
	Logs                       *Logs
	StorageType                string
	AuthenticationStrategy     string
	CreatorRequestID           string
}

CreateBrokerOptions carries optional configuration for CreateBrokerWithOptions. Zero values are ignored and treated as "not specified".

type DataReplicationMetadata

type DataReplicationMetadata struct {
	DataReplicationCounterpart string `json:"dataReplicationCounterpart,omitempty"`
	DataReplicationRole        string `json:"dataReplicationRole,omitempty"`
}

DataReplicationMetadata describes an active CRDR (cross-region disaster recovery) link.

type EncryptionOptions

type EncryptionOptions struct {
	KMSKeyID       string `json:"kmsKeyId,omitempty"`
	UseAWSOwnedKey bool   `json:"useAwsOwnedKey"`
}

EncryptionOptions configures KMS encryption for an Amazon MQ broker.

type EngineVersion

type EngineVersion struct {
	Name string `json:"name"`
}

EngineVersion holds a single engine version entry.

type Handler

type Handler struct {
	Backend StorageBackend
}

Handler is the Echo HTTP handler for Amazon MQ REST operations.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new Amazon MQ 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 handler 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 the request.

func (*Handler) ExtractResource

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

ExtractResource extracts a resource ID from the request path.

func (*Handler) GetSupportedOperations

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

GetSupportedOperations returns the list of supported operations.

func (*Handler) Handler

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

Handler returns the Echo handler function.

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 function that matches Amazon MQ REST API requests. MQ uses /v1/brokers, and MQ-signed /v1/configurations and /v1/tags paths.

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 stores Amazon MQ state in memory.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new in-memory Amazon MQ backend.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the account ID configured for this backend.

func (*InMemoryBackend) CreateBroker

func (b *InMemoryBackend) CreateBroker(
	name, deploymentMode, engineType, engineVersion, hostInstanceType string,
	publiclyAccessible, autoMinorVersionUpgrade bool,
	securityGroups, subnetIDs []string,
	users []*User,
	tags map[string]string,
) (*Broker, error)

CreateBroker creates a new Amazon MQ broker (compatibility wrapper).

func (*InMemoryBackend) CreateBrokerWithOptions

func (b *InMemoryBackend) CreateBrokerWithOptions(
	name, deploymentMode, engineType, engineVersion, hostInstanceType string,
	publiclyAccessible, autoMinorVersionUpgrade bool,
	securityGroups, subnetIDs []string,
	users []*User,
	tags map[string]string,
	opts *CreateBrokerOptions,
) (*Broker, error)

func (*InMemoryBackend) CreateConfiguration

func (b *InMemoryBackend) CreateConfiguration(
	name, description, engineType, engineVersion string,
	tags map[string]string,
) (*Configuration, error)

CreateConfiguration creates a new Amazon MQ configuration.

func (*InMemoryBackend) CreateTags

func (b *InMemoryBackend) CreateTags(resourceARN string, tags map[string]string) error

CreateTags adds or updates tags for a resource ARN. Note: b.tags[arn] and the corresponding broker/config Tags field share the same map pointer, so a single write here updates both automatically.

func (*InMemoryBackend) CreateUser

func (b *InMemoryBackend) CreateUser(brokerID, username, password string, groups []string, console bool) error

CreateUser creates a user on a broker.

func (*InMemoryBackend) DeleteBroker

func (b *InMemoryBackend) DeleteBroker(brokerID string) (*Broker, error)

DeleteBroker transitions a broker to DELETION_IN_PROGRESS and returns its identifiers. The broker is fully removed from the map on the next DescribeBroker / ListBrokers call via promoteDeletingToDeleted.

func (*InMemoryBackend) DeleteConfiguration

func (b *InMemoryBackend) DeleteConfiguration(configID string) error

DeleteConfiguration removes a configuration by ID.

func (*InMemoryBackend) DeleteTags

func (b *InMemoryBackend) DeleteTags(resourceARN string, tagKeys []string)

DeleteTags removes the specified tag keys from a resource ARN. Note: b.tags[arn] and the corresponding broker/config Tags field share the same map pointer, so a single delete here updates both automatically.

func (*InMemoryBackend) DeleteUser

func (b *InMemoryBackend) DeleteUser(brokerID, username string) error

DeleteUser removes a user from a broker.

func (*InMemoryBackend) DescribeBroker

func (b *InMemoryBackend) DescribeBroker(brokerID string) (*Broker, error)

DescribeBroker returns a broker by ID or name.

func (*InMemoryBackend) DescribeBrokerEngineTypes

func (b *InMemoryBackend) DescribeBrokerEngineTypes(engineType string) []BrokerEngineType

DescribeBrokerEngineTypes returns supported broker engine types and versions. If engineType is non-empty, the result is filtered to that engine type.

func (*InMemoryBackend) DescribeBrokerInstanceOptions

func (b *InMemoryBackend) DescribeBrokerInstanceOptions(
	engineType, hostInstanceType, storageType string,
) []BrokerInstanceOption

DescribeBrokerInstanceOptions returns broker instance options. Filters are optional; empty string means no filter applied.

func (*InMemoryBackend) DescribeConfiguration

func (b *InMemoryBackend) DescribeConfiguration(configID string) (*Configuration, error)

DescribeConfiguration returns a configuration by ID.

func (*InMemoryBackend) DescribeConfigurationRevision

func (b *InMemoryBackend) DescribeConfigurationRevision(
	configID string,
	revision int32,
) (*ConfigurationRevision, string, error)

DescribeConfigurationRevision returns a specific revision of a configuration.

func (*InMemoryBackend) DescribeUser

func (b *InMemoryBackend) DescribeUser(brokerID, username string) (*User, error)

DescribeUser returns a user from a broker.

func (*InMemoryBackend) ListBrokers

func (b *InMemoryBackend) ListBrokers() []*Broker

ListBrokers returns all brokers sorted by name.

func (*InMemoryBackend) ListConfigurationRevisions

func (b *InMemoryBackend) ListConfigurationRevisions(configID string) ([]ConfigurationRevision, error)

ListConfigurationRevisions returns all revisions for a configuration.

func (*InMemoryBackend) ListConfigurations

func (b *InMemoryBackend) ListConfigurations() []*Configuration

ListConfigurations returns all configurations sorted by name.

func (*InMemoryBackend) ListTags

func (b *InMemoryBackend) ListTags(resourceARN string) map[string]string

ListTags returns tags for a resource ARN.

func (*InMemoryBackend) ListUsers

func (b *InMemoryBackend) ListUsers(brokerID string) ([]UserSummary, error)

ListUsers returns all users for a broker.

func (*InMemoryBackend) Promote

func (b *InMemoryBackend) Promote(brokerID, mode string) (*Broker, error)

Promote promotes a standby broker to the primary role. In the in-memory stub this is a no-op that validates the broker exists.

func (*InMemoryBackend) RebootBroker

func (b *InMemoryBackend) RebootBroker(brokerID string) error

RebootBroker simulates a broker reboot. The broker transitions to REBOOT_IN_PROGRESS once, then is restored to RUNNING on the next DescribeBroker / ListBrokers call so callers can observe the transition.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the region configured for this backend.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all backend state, preserving only the account ID and region.

func (*InMemoryBackend) Restore

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

Restore loads backend state from a JSON snapshot.

func (*InMemoryBackend) Snapshot

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

Snapshot serialises the backend state to JSON.

func (*InMemoryBackend) UpdateBroker

func (b *InMemoryBackend) UpdateBroker(
	brokerID, engineVersion, hostInstanceType string,
	autoMinorVersionUpgrade *bool,
	securityGroups []string,
) (*Broker, error)

UpdateBroker updates mutable broker fields (compatibility wrapper).

func (*InMemoryBackend) UpdateBrokerWithOptions

func (b *InMemoryBackend) UpdateBrokerWithOptions(
	brokerID, engineVersion, hostInstanceType string,
	autoMinorVersionUpgrade *bool,
	securityGroups []string,
	opts *UpdateBrokerOptions,
) (*Broker, error)

UpdateBrokerWithOptions updates mutable broker fields including optional extended fields.

func (*InMemoryBackend) UpdateConfiguration

func (b *InMemoryBackend) UpdateConfiguration(configID, description, data string) (*Configuration, error)

UpdateConfiguration updates a configuration (creates a new revision).

func (*InMemoryBackend) UpdateUser

func (b *InMemoryBackend) UpdateUser(brokerID, username, password string, groups []string, console *bool) error

UpdateUser updates a broker user.

type LdapServerMetadata

type LdapServerMetadata struct {
	RoleBase               string   `json:"roleBase,omitempty"`
	RoleName               string   `json:"roleName,omitempty"`
	RoleSearchMatching     string   `json:"roleSearchMatching,omitempty"`
	UserBase               string   `json:"userBase,omitempty"`
	UserRoleName           string   `json:"userRoleName,omitempty"`
	UserSearchMatching     string   `json:"userSearchMatching,omitempty"`
	ServiceAccountUsername string   `json:"serviceAccountUsername,omitempty"`
	ServiceAccountPassword string   `json:"-"`
	Hosts                  []string `json:"hosts,omitempty"`
	RoleSearchSubtree      bool     `json:"roleSearchSubtree"`
	UserSearchSubtree      bool     `json:"userSearchSubtree"`
}

LdapServerMetadata configures LDAP authentication for a broker.

type Logs

type Logs struct {
	Audit   bool `json:"audit"`
	General bool `json:"general"`
}

Logs configures CloudWatch Logs export for an Amazon MQ broker.

type LogsSummary

type LogsSummary struct {
	Pending         *Logs  `json:"pending,omitempty"`
	GeneralLogGroup string `json:"generalLogGroup,omitempty"`
	AuditLogGroup   string `json:"auditLogGroup,omitempty"`
	General         bool   `json:"general"`
	Audit           bool   `json:"audit"`
}

LogsSummary holds the configured logs plus their resolved log group ARNs.

type Provider

type Provider struct{}

Provider implements service.Provider for Amazon MQ.

func (*Provider) Init

Init initializes the Amazon MQ backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type StorageBackend

type StorageBackend interface {
	// Broker operations
	CreateBroker(
		name, deploymentMode, engineType, engineVersion, hostInstanceType string,
		publiclyAccessible, autoMinorVersionUpgrade bool,
		securityGroups, subnetIDs []string,
		users []*User,
		tags map[string]string,
	) (*Broker, error)
	CreateBrokerWithOptions(
		name, deploymentMode, engineType, engineVersion, hostInstanceType string,
		publiclyAccessible, autoMinorVersionUpgrade bool,
		securityGroups, subnetIDs []string,
		users []*User,
		tags map[string]string,
		opts *CreateBrokerOptions,
	) (*Broker, error)
	DescribeBroker(brokerID string) (*Broker, error)
	ListBrokers() []*Broker
	UpdateBroker(
		brokerID, engineVersion, hostInstanceType string,
		autoMinorVersionUpgrade *bool,
		securityGroups []string,
	) (*Broker, error)
	UpdateBrokerWithOptions(
		brokerID, engineVersion, hostInstanceType string,
		autoMinorVersionUpgrade *bool,
		securityGroups []string,
		opts *UpdateBrokerOptions,
	) (*Broker, error)
	DeleteBroker(brokerID string) (*Broker, error)
	RebootBroker(brokerID string) error
	Promote(brokerID, mode string) (*Broker, error)

	// User operations
	CreateUser(brokerID, username, password string, groups []string, console bool) error
	DescribeUser(brokerID, username string) (*User, error)
	UpdateUser(brokerID, username, password string, groups []string, console *bool) error
	DeleteUser(brokerID, username string) error
	ListUsers(brokerID string) ([]UserSummary, error)

	// Configuration operations
	CreateConfiguration(
		name, description, engineType, engineVersion string,
		tags map[string]string,
	) (*Configuration, error)
	DescribeConfiguration(configID string) (*Configuration, error)
	ListConfigurations() []*Configuration
	UpdateConfiguration(configID, description, data string) (*Configuration, error)
	DeleteConfiguration(configID string) error

	// Configuration revision operations
	DescribeConfigurationRevision(configID string, revision int32) (*ConfigurationRevision, string, error)
	ListConfigurationRevisions(configID string) ([]ConfigurationRevision, error)

	// Broker metadata operations
	DescribeBrokerEngineTypes(engineType string) []BrokerEngineType
	DescribeBrokerInstanceOptions(engineType, hostInstanceType, storageType string) []BrokerInstanceOption

	// Tag operations
	ListTags(resourceARN string) map[string]string
	CreateTags(resourceARN string, tags map[string]string) error
	DeleteTags(resourceARN string, tagKeys []string)

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

StorageBackend defines the interface for the Amazon MQ in-memory backend. All mutating methods must be safe for concurrent use.

type UpdateBrokerOptions

type UpdateBrokerOptions struct {
	Logs                       *Logs
	LdapServerMetadata         *LdapServerMetadata
	MaintenanceWindowStartTime *WeeklyStartTime
	Configuration              *ConfigurationID
	AuthenticationStrategy     string
	DataReplicationMode        string
}

UpdateBrokerOptions carries optional fields for UpdateBrokerWithOptions. Zero values are ignored and treated as "not specified".

type User

type User struct {
	Username string   `json:"username"`
	Password string   `json:"-"`
	Groups   []string `json:"groups,omitempty"`
	Console  bool     `json:"consoleAccess"`
}

User represents an Amazon MQ broker user.

type UserSummary

type UserSummary struct {
	Username string `json:"username"`
	Console  bool   `json:"consoleAccess"`
}

UserSummary is a summary of a broker user (returned in lists).

type WeeklyStartTime

type WeeklyStartTime struct {
	DayOfWeek string `json:"dayOfWeek,omitempty"`
	TimeOfDay string `json:"timeOfDay,omitempty"`
	TimeZone  string `json:"timeZone,omitempty"`
}

WeeklyStartTime defines the broker maintenance window start time.

Jump to

Keyboard shortcuts

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