Documentation
¶
Overview ¶
Package timestreaminfluxdb emulates Amazon Timestream for InfluxDB: DB instances, clusters, parameter groups and backups, with an opt-in docker engine that runs a real InfluxDB 2 server per instance.
Index ¶
- Constants
- Variables
- func ParameterEnv(raw json.RawMessage) []string
- type BackupConfig
- type BackupInput
- type ClusterConfig
- type ClusterInput
- type ClusterUpdate
- type ContainerRuntime
- type DBBackup
- type DBCluster
- type DBInstance
- type DBParameterGroup
- type DataDirConfig
- type DockerEngine
- func (d *DockerEngine) Backup(ctx context.Context, h EngineHandle, token, backupID string) error
- func (d *DockerEngine) DrainLogs(h EngineHandle) []byte
- func (d *DockerEngine) Recreate(ctx context.Context, h EngineHandle, spec EngineSpec) (EngineHandle, error)
- func (d *DockerEngine) Restart(ctx context.Context, h EngineHandle) (EngineHandle, error)
- func (d *DockerEngine) Start(ctx context.Context, spec EngineSpec) (EngineHandle, error)
- func (d *DockerEngine) Stop(ctx context.Context, h EngineHandle) error
- type Engine
- type EngineHandle
- type EngineSpec
- type GroupInput
- type HTTPDoer
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Shutdown(_ context.Context)
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) Close()
- func (b *InMemoryBackend) CreateDBBackup(ctx context.Context, in BackupInput) (wBackup, error)
- func (b *InMemoryBackend) CreateDBCluster(ctx context.Context, in ClusterInput) (string, string, error)
- func (b *InMemoryBackend) CreateDBInstance(ctx context.Context, in InstanceInput) (wInstance, error)
- func (b *InMemoryBackend) CreateDBParameterGroup(ctx context.Context, in GroupInput) (wParameterGroup, error)
- func (b *InMemoryBackend) DeleteDBBackup(ctx context.Context, id string) (wBackup, error)
- func (b *InMemoryBackend) DeleteDBCluster(ctx context.Context, id string) (string, error)
- func (b *InMemoryBackend) DeleteDBInstance(ctx context.Context, id string) (wInstance, error)
- func (b *InMemoryBackend) GetDBBackup(ctx context.Context, id string) (wBackup, error)
- func (b *InMemoryBackend) GetDBCluster(ctx context.Context, id string) (wCluster, error)
- func (b *InMemoryBackend) GetDBInstance(ctx context.Context, id string) (wInstance, error)
- func (b *InMemoryBackend) GetDBParameterGroup(ctx context.Context, id string) (wParameterGroup, error)
- func (b *InMemoryBackend) InventoryResources(ctx context.Context) []TaggedEntry
- func (b *InMemoryBackend) ListDBBackups(ctx context.Context, resourceID, token string, maxResults int32) (page.Page[wBackupSummary], error)
- func (b *InMemoryBackend) ListDBClusters(ctx context.Context, token string, maxResults int32) (page.Page[wClusterSummary], error)
- func (b *InMemoryBackend) ListDBInstances(ctx context.Context, token string, maxResults int32) (page.Page[wInstanceSummary], error)
- func (b *InMemoryBackend) ListDBInstancesForCluster(ctx context.Context, clusterID, token string, maxResults int32) (page.Page[wInstanceSummary], error)
- func (b *InMemoryBackend) ListDBParameterGroups(ctx context.Context, token string, maxResults int32) (page.Page[wParameterGroupSummary], error)
- func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resourceARN string) (map[string]string, error)
- func (b *InMemoryBackend) RebootDBCluster(ctx context.Context, id string, instanceIDs []string) (string, error)
- func (b *InMemoryBackend) RebootDBInstance(ctx context.Context, id string) (wInstance, error)
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) RestoreFromDBBackup(ctx context.Context, in RestoreInput) (RestoreResult, error)
- func (b *InMemoryBackend) RunScheduled(ctx context.Context)
- func (b *InMemoryBackend) SetDataDir(dir string)
- func (b *InMemoryBackend) SetEngine(e Engine)
- func (b *InMemoryBackend) SetLifecycleDelay(d time.Duration)
- func (b *InMemoryBackend) SetLogSink(s billingexport.ObjectStore)
- func (b *InMemoryBackend) SetSecretStore(s SecretStore)
- func (b *InMemoryBackend) SetSubnetResolver(r SubnetResolver)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartScheduler(interval time.Duration)
- func (b *InMemoryBackend) TagResource(ctx context.Context, resourceARN string, add map[string]string) error
- func (b *InMemoryBackend) TaggedResources(ctx context.Context) []TaggedEntry
- func (b *InMemoryBackend) UntagResource(ctx context.Context, resourceARN string, keys []string) error
- func (b *InMemoryBackend) UpdateDBCluster(ctx context.Context, id string, u ClusterUpdate) (string, error)
- func (b *InMemoryBackend) UpdateDBInstance(ctx context.Context, id string, u InstanceUpdate) (wInstance, error)
- type InstanceInput
- type InstanceUpdate
- type LogDelivery
- type Maintenance
- type Pending
- type Placement
- type Provider
- type RestoreInput
- type RestoreResult
- type SecretStore
- type SubnetResolver
- type TaggedEntry
Constants ¶
const ( // EngineEnv selects the engine mode: "stub" (metadata only, default) or "docker". EngineEnv = "TIMESTREAM_INFLUXDB_ENGINE" // HostEnv is the address engine-backed instances are reached on; default 127.0.0.1. HostEnv = "TIMESTREAM_INFLUXDB_HOST" // EngineDockerMode runs a real influxdb:2 container per instance. EngineDockerMode = "docker" )
const (
// Image is the InfluxDB 2 image each engine-backed instance runs.
Image = "influxdb:2"
)
Variables ¶
var ( ErrAccessDenied = errors.New("access denied") ErrConflict = errors.New("conflict") ErrInternalServer = errors.New("internal server error") ErrResourceNotFound = errors.New("resource not found") ErrQuotaExceeded = errors.New("service quota exceeded") ErrThrottling = errors.New("throttling") ErrValidation = errors.New("validation") )
Sentinels, one per exception in the pinned SDK's error set.
var ( // ErrExecFailed marks a command that exited non-zero inside the container. ErrExecFailed = errors.New("command failed in container") )
Functions ¶
func ParameterEnv ¶
func ParameterEnv(raw json.RawMessage) []string
ParameterEnv translates an InfluxDBv2 parameter group document into influxd environment settings. Every InfluxDBv2 parameter has an influxd flag of the same name in kebab case (INFLUXD_<FLAG>); groups for other engines are stored but not applied.
Types ¶
type BackupConfig ¶
type BackupConfig struct {
CustomSchedule string `json:"customSchedule,omitempty"`
LastRun time.Time `json:"lastRun,omitzero"`
Type string `json:"type"`
RetentionDays int32 `json:"retentionDays"`
Enabled bool `json:"enabled"`
}
BackupConfig is an automated backup schedule.
type BackupInput ¶
type BackupInput struct {
RetentionDays *int32
Tags map[string]string
ResourceID string
Name string
}
BackupInput holds CreateDbBackup parameters.
type ClusterConfig ¶
type ClusterConfig struct {
DedicatedCompactor *bool `json:"dedicatedCompactor,omitempty"`
IngestQueryInstances *int32 `json:"ingestQueryInstances,omitempty"`
QueryOnlyInstances *int32 `json:"queryOnlyInstances,omitempty"`
}
ClusterConfig describes a cluster's node roles.
type ClusterInput ¶
type ClusterInput struct {
Tags map[string]string
LogDelivery *LogDelivery
Maintenance *Maintenance
AllocatedStorage *int32
Port *int32
Name string
Username string
Password string
Organization string
Bucket string
DBInstanceType string
DBStorageType string
DeploymentType string
NetworkType string
FailoverMode string
KMSKeyID string
ParameterGroupID string
SubnetIDs []string
SecurityGroupIDs []string
BackupConfigs []BackupConfig
Publicly bool
}
ClusterInput holds CreateDbCluster parameters.
type ClusterUpdate ¶
type ClusterUpdate struct {
LogDelivery *LogDelivery
Maintenance *Maintenance
Port *int32
DBInstanceType string
ParameterGroupID string
FailoverMode string
BackupConfigs []BackupConfig
HasBackupConfigs bool
}
ClusterUpdate holds UpdateDbCluster parameters.
type ContainerRuntime ¶
type ContainerRuntime interface {
HasImage(ctx context.Context, imageRef string) (bool, error)
PullImage(ctx context.Context, imageRef string) error
CreateAndStart(ctx context.Context, spec container.Spec) (string, error)
StopAndRemove(ctx context.Context, containerID string) error
StopContainer(ctx context.Context, containerID string) error
StartContainer(ctx context.Context, containerID string) error
Exec(ctx context.Context, containerID string, cmd []string) (container.ExecResult, error)
}
ContainerRuntime is the slice of container.Runtime the docker engine needs.
type DBBackup ¶
type DBBackup struct {
CreatedAt time.Time `json:"createdAt"`
Tags map[string]string `json:"tags,omitempty"`
ClusterConfig *ClusterConfig `json:"clusterConfig,omitempty"`
ResourceType string `json:"resourceType"`
FailoverMode string `json:"failoverMode,omitempty"`
Name string `json:"name"`
ARN string `json:"arn"`
AccountID string `json:"accountId"`
Region string `json:"region"`
ResourceID string `json:"resourceId"`
Bucket string `json:"bucket"`
SourceID string `json:"sourceId,omitempty"`
Organization string `json:"organization"`
Token string `json:"token,omitempty"`
Password string `json:"-"`
EngineType string `json:"engineType"`
ID string `json:"id"`
Type string `json:"type"`
Username string `json:"username"`
Pending Pending `json:"pending"`
Placement Placement `json:"placement"`
RetentionDays int32 `json:"retentionDays"`
HasData bool `json:"hasData,omitempty"`
}
DBBackup is a backup of an instance or cluster.
type DBCluster ¶
type DBCluster struct {
CreatedAt time.Time `json:"createdAt"`
LastMaintenance time.Time `json:"lastMaintenance,omitzero"`
Tags map[string]string `json:"tags,omitempty"`
Config *ClusterConfig `json:"config,omitempty"`
Name string `json:"name"`
Region string `json:"region"`
Password string `json:"-"`
ID string `json:"id"`
Token string `json:"token,omitempty"`
ARN string `json:"arn"`
AccountID string `json:"accountId"`
SecretARN string `json:"secretArn,omitempty"`
Username string `json:"username"`
Organization string `json:"organization"`
Bucket string `json:"bucket"`
EngineType string `json:"engineType"`
FailoverMode string `json:"failoverMode"`
Pending Pending `json:"pending"`
Placement Placement `json:"placement"`
}
DBCluster is a Timestream for InfluxDB cluster.
type DBInstance ¶
type DBInstance struct {
CreatedAt time.Time `json:"createdAt"`
LastLogShip time.Time `json:"lastLogShip,omitzero"`
LastMaintenance time.Time `json:"lastMaintenance,omitzero"`
Tags map[string]string `json:"tags,omitempty"`
Token string `json:"token,omitempty"`
Organization string `json:"organization"`
ARN string `json:"arn"`
AccountID string `json:"accountId"`
Region string `json:"region"`
ClusterID string `json:"clusterId,omitempty"`
Password string `json:"-"`
RestoreFrom string `json:"-"`
ID string `json:"id"`
SecretARN string `json:"secretArn,omitempty"`
Failed string `json:"failed,omitempty"`
Name string `json:"name"`
Bucket string `json:"bucket"`
AZ string `json:"az"`
StandbyAZ string `json:"standbyAz,omitempty"`
EngineType string `json:"engineType"`
EngineHost string `json:"engineHost,omitempty"`
Mode string `json:"mode,omitempty"`
Username string `json:"username"`
Pending Pending `json:"pending"`
Placement Placement `json:"placement"`
EnginePort int32 `json:"enginePort,omitempty"`
}
DBInstance is a Timestream for InfluxDB instance.
type DBParameterGroup ¶
type DBParameterGroup struct {
Tags map[string]string `json:"tags,omitempty"`
ID string `json:"id"`
Name string `json:"name"`
ARN string `json:"arn"`
Description string `json:"description,omitempty"`
AccountID string `json:"accountId"`
Region string `json:"region"`
Parameters json.RawMessage `json:"parameters,omitempty"`
}
DBParameterGroup is a named set of InfluxDB parameters.
type DataDirConfig ¶
type DataDirConfig interface {
GetTimestreamInfluxDBDataDir() string
}
DataDirConfig locates the directory instance data and backups persist in; empty keeps them in a temporary one.
type DockerEngine ¶
type DockerEngine struct {
Runtime ContainerRuntime
HTTP HTTPDoer
Ports *portalloc.Allocator
Host string
Image string
PollInterval time.Duration
StartTimeout time.Duration
// contains filtered or unexported fields
}
DockerEngine runs one influxdb:2 container per instance.
func (*DockerEngine) Backup ¶
func (d *DockerEngine) Backup(ctx context.Context, h EngineHandle, token, backupID string) error
Backup runs influx backup inside the container; the backup lands in the mounted backups directory.
func (*DockerEngine) DrainLogs ¶
func (d *DockerEngine) DrainLogs(h EngineHandle) []byte
DrainLogs returns and clears the captured output of a container.
func (*DockerEngine) Recreate ¶
func (d *DockerEngine) Recreate(ctx context.Context, h EngineHandle, spec EngineSpec) (EngineHandle, error)
Recreate replaces the container with one built from spec, on the same host port and data directory.
func (*DockerEngine) Restart ¶
func (d *DockerEngine) Restart(ctx context.Context, h EngineHandle) (EngineHandle, error)
Restart stops and starts the same container: data, published port and container ID are kept.
func (*DockerEngine) Start ¶
func (d *DockerEngine) Start(ctx context.Context, spec EngineSpec) (EngineHandle, error)
Start pulls the image if needed, runs the container initialised from spec and waits for /health.
func (*DockerEngine) Stop ¶
func (d *DockerEngine) Stop(ctx context.Context, h EngineHandle) error
Stop removes the container and frees its host port.
type Engine ¶
type Engine interface {
// Start launches a server initialised from spec and returns once it accepts connections.
Start(ctx context.Context, spec EngineSpec) (EngineHandle, error)
// Stop removes the server; the data directories stay.
Stop(ctx context.Context, h EngineHandle) error
// Restart restarts the server in place, keeping its data and port.
Restart(ctx context.Context, h EngineHandle) (EngineHandle, error)
// Recreate replaces the container with one built from spec on the same port and data directory.
Recreate(ctx context.Context, h EngineHandle, spec EngineSpec) (EngineHandle, error)
// Backup runs influx backup inside the server into BackupsDir/backupID.
Backup(ctx context.Context, h EngineHandle, token, backupID string) error
// DrainLogs returns and clears the server output captured since the last call.
DrainLogs(h EngineHandle) []byte
}
Engine runs real InfluxDB servers for instances; nil keeps instances metadata-only.
type EngineHandle ¶
EngineHandle identifies a running InfluxDB container and where it is reachable.
type EngineSpec ¶
type EngineSpec struct {
Name string
Username string
Password string
Organization string
Bucket string
Token string
// RestoreFrom is a backup ID: the server starts uninitialised and is restored from it.
RestoreFrom string
// DataDir and BackupsDir are host directories mounted into the container.
DataDir string
BackupsDir string
// Env holds InfluxDB server settings (INFLUXD_*) derived from the parameter group.
Env []string
// HostPort reuses an already held host port; zero allocates one.
HostPort int32
}
EngineSpec describes the InfluxDB container to run for one instance.
type GroupInput ¶
type GroupInput struct {
Tags map[string]string
Name string
Description string
Parameters json.RawMessage
}
GroupInput holds CreateDbParameterGroup parameters.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
DefaultRegion string
}
Handler serves the Timestream for InfluxDB awsjson1.0 API.
func (*Handler) ChaosOperations ¶
ChaosOperations lists the fault-injectable operations.
func (*Handler) ChaosRegions ¶
ChaosRegions lists the regions this handler serves.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase service name for fault rules.
func (*Handler) ExtractOperation ¶
ExtractOperation returns the operation name from X-Amz-Target.
func (*Handler) ExtractResource ¶
ExtractResource returns the operation name; the API has no single resource key.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations lists every routed operation.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the echo handler.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher matches the AmazonTimestreamInfluxDB X-Amz-Target prefix.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the Timestream for InfluxDB state; one coarse lock guards every table.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates an empty backend.
func (*InMemoryBackend) Close ¶
func (b *InMemoryBackend) Close()
Close stops every engine container and waits for in-flight starts.
func (*InMemoryBackend) CreateDBBackup ¶
func (b *InMemoryBackend) CreateDBBackup(ctx context.Context, in BackupInput) (wBackup, error)
CreateDBBackup takes an on-demand backup of an instance or cluster.
func (*InMemoryBackend) CreateDBCluster ¶
func (b *InMemoryBackend) CreateDBCluster(ctx context.Context, in ClusterInput) (string, string, error)
CreateDBCluster creates a cluster and its member instances in CREATING state.
func (*InMemoryBackend) CreateDBInstance ¶
func (b *InMemoryBackend) CreateDBInstance(ctx context.Context, in InstanceInput) (wInstance, error)
CreateDBInstance creates an instance in CREATING state.
func (*InMemoryBackend) CreateDBParameterGroup ¶
func (b *InMemoryBackend) CreateDBParameterGroup(ctx context.Context, in GroupInput) (wParameterGroup, error)
CreateDBParameterGroup creates a parameter group.
func (*InMemoryBackend) DeleteDBBackup ¶
func (b *InMemoryBackend) DeleteDBBackup(ctx context.Context, id string) (wBackup, error)
DeleteDBBackup starts backup deletion.
func (*InMemoryBackend) DeleteDBCluster ¶
DeleteDBCluster starts cluster deletion with its member instances.
func (*InMemoryBackend) DeleteDBInstance ¶
func (b *InMemoryBackend) DeleteDBInstance(ctx context.Context, id string) (wInstance, error)
DeleteDBInstance starts instance deletion.
func (*InMemoryBackend) GetDBBackup ¶
func (b *InMemoryBackend) GetDBBackup(ctx context.Context, id string) (wBackup, error)
GetDBBackup returns a backup.
func (*InMemoryBackend) GetDBCluster ¶
func (b *InMemoryBackend) GetDBCluster(ctx context.Context, id string) (wCluster, error)
GetDBCluster returns a cluster.
func (*InMemoryBackend) GetDBInstance ¶
func (b *InMemoryBackend) GetDBInstance(ctx context.Context, id string) (wInstance, error)
GetDBInstance returns an instance.
func (*InMemoryBackend) GetDBParameterGroup ¶
func (b *InMemoryBackend) GetDBParameterGroup(ctx context.Context, id string) (wParameterGroup, error)
GetDBParameterGroup returns a parameter group.
func (*InMemoryBackend) InventoryResources ¶
func (b *InMemoryBackend) InventoryResources(ctx context.Context) []TaggedEntry
InventoryResources lists every DB instance, cluster, parameter group and backup of the caller.
func (*InMemoryBackend) ListDBBackups ¶
func (b *InMemoryBackend) ListDBBackups( ctx context.Context, resourceID, token string, maxResults int32, ) (page.Page[wBackupSummary], error)
ListDBBackups lists backups, optionally for one resource, newest first.
func (*InMemoryBackend) ListDBClusters ¶
func (b *InMemoryBackend) ListDBClusters( ctx context.Context, token string, maxResults int32, ) (page.Page[wClusterSummary], error)
ListDBClusters lists clusters ordered by name.
func (*InMemoryBackend) ListDBInstances ¶
func (b *InMemoryBackend) ListDBInstances( ctx context.Context, token string, maxResults int32, ) (page.Page[wInstanceSummary], error)
ListDBInstances lists instances ordered by name.
func (*InMemoryBackend) ListDBInstancesForCluster ¶
func (b *InMemoryBackend) ListDBInstancesForCluster( ctx context.Context, clusterID, token string, maxResults int32, ) (page.Page[wInstanceSummary], error)
ListDBInstancesForCluster lists a cluster's member instances.
func (*InMemoryBackend) ListDBParameterGroups ¶
func (b *InMemoryBackend) ListDBParameterGroups( ctx context.Context, token string, maxResults int32, ) (page.Page[wParameterGroupSummary], error)
ListDBParameterGroups lists parameter groups ordered by name.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resourceARN string) (map[string]string, error)
ListTagsForResource returns a resource's tags.
func (*InMemoryBackend) RebootDBCluster ¶
func (b *InMemoryBackend) RebootDBCluster(ctx context.Context, id string, instanceIDs []string) (string, error)
RebootDBCluster reboots a cluster, or only the listed member instances.
func (*InMemoryBackend) RebootDBInstance ¶
func (b *InMemoryBackend) RebootDBInstance(ctx context.Context, id string) (wInstance, error)
RebootDBInstance moves an instance through REBOOTING back to AVAILABLE, restarting its server.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the default region.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset clears every table, stops engine containers and deletes their data.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads a snapshot; an incompatible version is discarded.
func (*InMemoryBackend) RestoreFromDBBackup ¶
func (b *InMemoryBackend) RestoreFromDBBackup(ctx context.Context, in RestoreInput) (RestoreResult, error)
RestoreFromDBBackup creates a resource from a backup, or resets the original one.
func (*InMemoryBackend) RunScheduled ¶
func (b *InMemoryBackend) RunScheduled(ctx context.Context)
RunScheduled performs the work that has come due on the backend clock: automated backups and their retention, maintenance windows and log delivery.
func (*InMemoryBackend) SetDataDir ¶
func (b *InMemoryBackend) SetDataDir(dir string)
SetDataDir keeps instance data and backups under dir; empty uses a temporary directory removed on Close.
func (*InMemoryBackend) SetEngine ¶
func (b *InMemoryBackend) SetEngine(e Engine)
SetEngine switches the backend to engine mode: instances run a real InfluxDB server.
func (*InMemoryBackend) SetLifecycleDelay ¶
func (b *InMemoryBackend) SetLifecycleDelay(d time.Duration)
SetLifecycleDelay overrides the transitional status window.
func (*InMemoryBackend) SetLogSink ¶
func (b *InMemoryBackend) SetLogSink(s billingexport.ObjectStore)
SetLogSink enables LogDeliveryConfiguration: container logs are written to the configured S3 bucket.
func (*InMemoryBackend) SetSecretStore ¶
func (b *InMemoryBackend) SetSecretStore(s SecretStore)
SetSecretStore enables the InfluxAuthParametersSecretArn secrets.
func (*InMemoryBackend) SetSubnetResolver ¶
func (b *InMemoryBackend) SetSubnetResolver(r SubnetResolver)
SetSubnetResolver wires the EC2 lookup used to validate subnets.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state.
func (*InMemoryBackend) StartScheduler ¶
func (b *InMemoryBackend) StartScheduler(interval time.Duration)
StartScheduler runs RunScheduled every interval (30s when zero) until Close.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(ctx context.Context, resourceARN string, add map[string]string) error
TagResource adds or replaces tags.
func (*InMemoryBackend) TaggedResources ¶
func (b *InMemoryBackend) TaggedResources(ctx context.Context) []TaggedEntry
TaggedResources lists the caller's tagged DB instances, clusters, parameter groups and backups.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(ctx context.Context, resourceARN string, keys []string) error
UntagResource removes tags by key.
func (*InMemoryBackend) UpdateDBCluster ¶
func (b *InMemoryBackend) UpdateDBCluster(ctx context.Context, id string, u ClusterUpdate) (string, error)
UpdateDBCluster changes a cluster and moves it to an updating status.
func (*InMemoryBackend) UpdateDBInstance ¶
func (b *InMemoryBackend) UpdateDBInstance(ctx context.Context, id string, u InstanceUpdate) (wInstance, error)
UpdateDBInstance changes an instance and moves it to an updating status.
type InstanceInput ¶
type InstanceInput struct {
Tags map[string]string
LogDelivery *LogDelivery
Maintenance *Maintenance
Name string
Username string
Password string
Organization string
Bucket string
DBInstanceType string
DBStorageType string
DeploymentType string
NetworkType string
KMSKeyID string
ParameterGroupID string
SubnetIDs []string
SecurityGroupIDs []string
BackupConfigs []BackupConfig
AllocatedStorage int32
Port int32
PubliclyAccessible bool
}
InstanceInput holds CreateDbInstance parameters.
type InstanceUpdate ¶
type InstanceUpdate struct {
LogDelivery *LogDelivery
Maintenance *Maintenance
AllocatedStorage *int32
Port *int32
DBInstanceType string
DBStorageType string
DeploymentType string
ParameterGroupID string
BackupConfigs []BackupConfig
HasBackupConfigs bool
}
InstanceUpdate holds UpdateDbInstance parameters; nil or empty fields are unchanged.
type LogDelivery ¶
LogDelivery is the S3 log delivery configuration.
type Maintenance ¶
Maintenance is the maintenance window.
type Pending ¶
type Pending struct {
Until time.Time `json:"until"`
Kind string `json:"kind"`
Engine bool `json:"engine,omitempty"`
}
Pending is a transitional status that lasts until Until, or until the engine reports when Engine is set.
type Placement ¶
type Placement struct {
LogDelivery *LogDelivery `json:"logDelivery,omitempty"`
Maintenance *Maintenance `json:"maintenance,omitempty"`
DBInstanceType string `json:"dbInstanceType"`
DBStorageType string `json:"dbStorageType"`
DeploymentType string `json:"deploymentType"`
NetworkType string `json:"networkType"`
KMSKeyID string `json:"kmsKeyId,omitempty"`
ParameterGroupID string `json:"parameterGroupId,omitempty"`
SubnetIDs []string `json:"subnetIds"`
SecurityGroupIDs []string `json:"securityGroupIds"`
BackupConfigs []BackupConfig `json:"backupConfigs,omitempty"`
AllocatedStorage int32 `json:"allocatedStorage"`
Port int32 `json:"port"`
PubliclyAccessible bool `json:"publiclyAccessible"`
}
Placement holds the settings shared by instances, clusters and the backups of both.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for Amazon Timestream for InfluxDB.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init builds the backend and handler.
type RestoreInput ¶
type RestoreInput struct {
RestoreToTime *time.Time
Port *int32
Publicly *bool
LogDelivery *LogDelivery
Maintenance *Maintenance
Tags map[string]string
BackupID string
Name string
DeploymentType string
KMSKeyID string
NetworkType string
RestoreMode string
SubnetIDs []string
SecurityGroupIDs []string
BackupConfigs []BackupConfig
HasBackupConfigs bool
}
RestoreInput holds RestoreFromDbBackup parameters.
type RestoreResult ¶
type RestoreResult struct {
DeploymentType string
EngineType string
ResourceType string
ResourceID string
}
RestoreResult describes the resource a restore produced.
type SecretStore ¶
type SecretStore interface {
CreateSecret(region, name, secretString string) (string, error)
DeleteSecret(region, secretARN string) error
}
SecretStore holds the InfluxDB auth parameter secrets (a Secrets Manager adapter in the app).
type SubnetResolver ¶
SubnetResolver looks up the IPv4 CIDR of a VPC subnet.
type TaggedEntry ¶
TaggedEntry is one taggable resource, for the Resource Groups Tagging API bridge.
Source Files
¶
- backup_engine.go
- backups.go
- clusters.go
- cron.go
- datadir.go
- docker_engine.go
- docker_engine_ops.go
- docker_logs.go
- engine.go
- engine_params.go
- engine_run.go
- errors.go
- handler.go
- handler_clusters.go
- handler_instances.go
- handler_ops.go
- handler_other.go
- instances.go
- models.go
- parametergroups.go
- persistence.go
- provider.go
- scheduler.go
- secrets.go
- store.go
- tags.go
- validate.go
- wire.go