Documentation
¶
Index ¶
- Constants
- Variables
- type AirflowConfig
- type AirflowHTTP
- type AirflowObjects
- type AirflowRuntime
- type Dimension
- type EngineConfig
- type Environment
- type ExportedCreateEnvironmentRequest
- type ExportedEnvironment
- type ExportedInvokeRestAPIRequest
- type ExportedMetricDatum
- type ExportedPublishMetricsRequest
- type ExportedUpdateEnvironmentRequest
- 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) ServeHTTP(c *echo.Context) error
- func (h *Handler) Shutdown(_ context.Context)
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) AccountID() string
- func (b *InMemoryBackend) AddEnvironmentInternal(name string) *Environment
- func (b *InMemoryBackend) AddEnvironmentInternalRegion(region, name string) *Environment
- func (b *InMemoryBackend) AirflowEnabled() bool
- func (b *InMemoryBackend) Close()
- func (b *InMemoryBackend) CreateCliToken(ctx context.Context, envName string) (string, string, error)
- func (b *InMemoryBackend) CreateEnvironment(ctx context.Context, name string, req *createEnvironmentRequest) (*Environment, error)
- func (b *InMemoryBackend) CreateWebLoginToken(ctx context.Context, envName string) (string, string, error)
- func (b *InMemoryBackend) DeleteEnvironment(ctx context.Context, name string) (*Environment, error)
- func (b *InMemoryBackend) EnableAirflow(cfg AirflowConfig)
- func (b *InMemoryBackend) ExecCLI(ctx context.Context, token, command string) (string, string, error)
- func (b *InMemoryBackend) GetEnvironment(ctx context.Context, name string) (*Environment, error)
- func (b *InMemoryBackend) GetMetrics(ctx context.Context, envName string) ([]MetricDatum, error)
- func (b *InMemoryBackend) InvokeRestAPI(ctx context.Context, envName string, req *invokeRestAPIRequest) (*InvokeRestAPIResponse, error)
- func (b *InMemoryBackend) ListEnvironments(ctx context.Context) ([]string, error)
- func (b *InMemoryBackend) ListEnvironmentsPage(ctx context.Context, nextToken string, pageSize int) ([]string, string, error)
- func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resourceARN string) (map[string]string, error)
- func (b *InMemoryBackend) PublishMetrics(ctx context.Context, envName string, req *publishMetricsRequest) error
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) SetAppConfig(cfg any)
- func (b *InMemoryBackend) SetTransitionDelay(d time.Duration)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) TagResource(ctx context.Context, resourceARN string, tags map[string]string) error
- func (b *InMemoryBackend) TaggedResources() []TaggedEntry
- func (b *InMemoryBackend) UntagResource(ctx context.Context, resourceARN string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateEnvironment(ctx context.Context, name string, req *updateEnvironmentRequest) (*Environment, error)
- func (b *InMemoryBackend) WebLogin(ctx context.Context, token string) (*WebSession, error)
- type InvokeRestAPIResponse
- type LastUpdate
- type LoggingConfiguration
- type LoggingConfigurationInput
- type MetricDatum
- type ModuleLoggingConfiguration
- type ModuleLoggingConfigurationInput
- type NetworkConfig
- type Provider
- type StatisticSet
- type StorageBackend
- type TaggedEntry
- type UpdateError
- type UpdateNetworkConfig
- type WebSession
Constants ¶
const (
// EngineDocker is the engine mode that runs a real Airflow container per environment.
EngineDocker = "docker"
)
Variables ¶
var ( // ErrEnvironmentNotFound is returned when an environment does not exist. ErrEnvironmentNotFound = awserr.New("ResourceNotFoundException: environment not found", awserr.ErrNotFound) // ErrEnvironmentAlreadyExists is returned when an environment already exists. // The message deliberately does not say "AlreadyExistsException" -- MWAA's // API model has no such exception (see handler.go's writeEnvironmentResult), // so this sentinel is mapped to a real ValidationException/400 on the wire; // embedding the fabricated exception name in the message text would leak it // right back into the response body's "message" field. ErrEnvironmentAlreadyExists = awserr.New( "ValidationException: environment already exists", awserr.ErrAlreadyExists, ) // ErrInvalidParameter is returned when an invalid or missing parameter is provided. ErrInvalidParameter = awserr.New("ValidationException: invalid parameter", awserr.ErrInvalidParameter) )
Errors used by the backend.
var ErrNilAppContext = errors.New("nil AppContext passed to MWAA Provider.Init")
ErrNilAppContext is returned by Init when a nil AppContext is passed.
Functions ¶
This section is empty.
Types ¶
type AirflowConfig ¶
type AirflowConfig struct {
Runtime AirflowRuntime
// Ports hands out host ports for each webserver; nil picks a free OS port.
Ports *portalloc.Allocator
// HTTP calls the Airflow webserver; nil uses an isolated client.
HTTP AirflowHTTP
// Objects reads DAG sources; nil uses the emulated S3 backend wired through SetAppConfig.
Objects AirflowObjects
// Host is the address webserver ports are reached on; default 127.0.0.1.
Host string
// EndpointURL is the gopherstack URL as seen from inside containers (AWS_ENDPOINT_URL).
EndpointURL string
// Image overrides the apache/airflow:<version> image.
Image string
// StartTimeout bounds container boot until the webserver is healthy.
StartTimeout time.Duration
StopTimeout time.Duration
PollInterval time.Duration
// SyncInterval is how often DAGs are re-read from S3 while AVAILABLE.
SyncInterval time.Duration
// TokenTTL is the CLI and web token lifetime.
TokenTTL time.Duration
}
AirflowConfig configures docker-backed MWAA environments.
type AirflowHTTP ¶
AirflowHTTP is the slice of *http.Client used to reach the Airflow webserver.
type AirflowObjects ¶
type AirflowObjects interface {
List(ctx context.Context, bucket, prefix string) ([]string, error)
Get(ctx context.Context, bucket, key, version string) ([]byte, error)
}
AirflowObjects reads DAG sources from the emulated S3.
type AirflowRuntime ¶
type AirflowRuntime interface {
CreateAndStart(ctx context.Context, spec container.Spec) (string, error)
StopAndRemove(ctx context.Context, containerID string) error
Exec(ctx context.Context, containerID string, cmd []string) (container.ExecResult, error)
}
AirflowRuntime is the slice of container.Runtime the Airflow engine needs.
type EngineConfig ¶
EngineConfig exposes the MWAA engine mode (stub or docker) and the endpoint containers use to reach gopherstack.
type Environment ¶
type Environment struct {
Tags map[string]string `json:"Tags,omitempty"`
NetworkConfiguration *NetworkConfig `json:"NetworkConfiguration,omitempty"`
AirflowConfigurationOptions map[string]string `json:"AirflowConfigurationOptions,omitempty"`
LoggingConfiguration *LoggingConfiguration `json:"LoggingConfiguration,omitempty"`
LastUpdate *LastUpdate `json:"LastUpdate,omitempty"`
Name string `json:"Name"`
AirflowVersion string `json:"AirflowVersion"`
ExecutionRoleArn string `json:"ExecutionRoleArn"`
SourceBucketArn string `json:"SourceBucketArn"`
EnvironmentClass string `json:"EnvironmentClass"`
WebserverURL string `json:"WebserverUrl"`
WebserverAccessMode string `json:"WebserverAccessMode"`
DagS3Path string `json:"DagS3Path"`
Status string `json:"Status"`
ARN string `json:"Arn"`
KmsKey string `json:"KmsKey,omitempty"`
PluginsS3Path string `json:"PluginsS3Path,omitempty"`
PluginsS3ObjectVersion string `json:"PluginsS3ObjectVersion,omitempty"`
RequirementsS3Path string `json:"RequirementsS3Path,omitempty"`
RequirementsS3ObjectVersion string `json:"RequirementsS3ObjectVersion,omitempty"`
StartupScriptS3Path string `json:"StartupScriptS3Path,omitempty"`
StartupScriptS3ObjectVersion string `json:"StartupScriptS3ObjectVersion,omitempty"`
EndpointManagement string `json:"EndpointManagement,omitempty"`
ServiceRoleArn string `json:"ServiceRoleArn,omitempty"`
CeleryExecutorQueue string `json:"CeleryExecutorQueue,omitempty"`
DatabaseVpcEndpointService string `json:"DatabaseVpcEndpointService,omitempty"`
WebserverVpcEndpointService string `json:"WebserverVpcEndpointService,omitempty"`
WeeklyMaintenanceWindowStart string `json:"WeeklyMaintenanceWindowStart,omitempty"`
CreatedAt float64 `json:"CreatedAt"`
MaxWorkers int32 `json:"MaxWorkers"`
MinWorkers int32 `json:"MinWorkers"`
MaxWebservers int32 `json:"MaxWebservers,omitempty"`
MinWebservers int32 `json:"MinWebservers,omitempty"`
Schedulers int32 `json:"Schedulers,omitempty"`
// contains filtered or unexported fields
}
Environment represents an MWAA environment.
type ExportedCreateEnvironmentRequest ¶
type ExportedCreateEnvironmentRequest = createEnvironmentRequest
ExportedCreateEnvironmentRequest aliases createEnvironmentRequest for testing.
type ExportedEnvironment ¶
type ExportedEnvironment = Environment
ExportedEnvironment is a compatibility alias used by the dashboard package.
type ExportedInvokeRestAPIRequest ¶
type ExportedInvokeRestAPIRequest = invokeRestAPIRequest
ExportedInvokeRestAPIRequest aliases invokeRestAPIRequest for testing.
type ExportedMetricDatum ¶
type ExportedMetricDatum = MetricDatum
ExportedMetricDatum aliases MetricDatum for testing.
type ExportedPublishMetricsRequest ¶
type ExportedPublishMetricsRequest = publishMetricsRequest
ExportedPublishMetricsRequest aliases publishMetricsRequest for testing.
type ExportedUpdateEnvironmentRequest ¶
type ExportedUpdateEnvironmentRequest = updateEnvironmentRequest
ExportedUpdateEnvironmentRequest aliases updateEnvironmentRequest for testing.
type Handler ¶
type Handler struct {
Backend StorageBackend
AccountID string
DefaultRegion string
}
Handler is the HTTP handler for the AWS MWAA REST API.
func NewHandler ¶
func NewHandler(backend StorageBackend) *Handler
NewHandler creates a new MWAA handler.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this handler handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the operation name from the request path and method.
func (*Handler) ExtractResource ¶
ExtractResource extracts the environment name or ARN from the request path.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported MWAA operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the echo.HandlerFunc for this service.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches MWAA API requests. All path-based matches are gated on the SigV4 service name to prevent routing conflicts with other services that share similar REST paths.
func (*Handler) Snapshot ¶
Snapshot implements persistence.Persistable by delegating to the backend.
h.Backend is the StorageBackend interface, which already declares Snapshot(ctx context.Context) []byte (see interfaces.go) with a shape matching persistence.Persistable exactly, so this can call it directly -- no local type assertion needed. But interface membership alone does not help: h.Backend is a named field, not an embedded one, so InMemoryBackend's methods are never promoted onto *Handler. Without this delegation, cli.go's setupPersistence type-asserts the registered service.Registerable (this *Handler) against persistence.Persistable, fails silently, and never registers mwaa for snapshot/restore despite the backend being fully capable. Mirrors services/securityhub's Handler-level delegation.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the in-memory implementation of StorageBackend.
func NewInMemoryBackend ¶
func NewInMemoryBackend(region, accountID string) *InMemoryBackend
NewInMemoryBackend creates a new MWAA in-memory backend.
func (*InMemoryBackend) AccountID ¶
func (b *InMemoryBackend) AccountID() string
AccountID returns the configured account ID.
func (*InMemoryBackend) AddEnvironmentInternal ¶
func (b *InMemoryBackend) AddEnvironmentInternal(name string) *Environment
AddEnvironmentInternal creates an environment with minimal defaults, bypassing validation, intended for use in tests only. It uses the backend's default region.
func (*InMemoryBackend) AddEnvironmentInternalRegion ¶
func (b *InMemoryBackend) AddEnvironmentInternalRegion(region, name string) *Environment
AddEnvironmentInternalRegion creates an environment with minimal defaults in the given region, bypassing validation, intended for use in tests only.
func (*InMemoryBackend) AirflowEnabled ¶
func (b *InMemoryBackend) AirflowEnabled() bool
AirflowEnabled reports whether the docker engine is active.
func (*InMemoryBackend) Close ¶
func (b *InMemoryBackend) Close()
Close stops every Airflow container and waits for in-flight launches.
func (*InMemoryBackend) CreateCliToken ¶
func (b *InMemoryBackend) CreateCliToken(ctx context.Context, envName string) (string, string, error)
CreateCliToken validates that the environment exists and is AVAILABLE, then returns a JWT-shaped CLI token and the environment's webserver hostname. AWS returns ResourceNotFoundException when the environment is in any non-AVAILABLE state.
func (*InMemoryBackend) CreateEnvironment ¶
func (b *InMemoryBackend) CreateEnvironment( ctx context.Context, name string, req *createEnvironmentRequest, ) (*Environment, error)
CreateEnvironment creates a new MWAA environment in the region resolved from ctx.
func (*InMemoryBackend) CreateWebLoginToken ¶
func (b *InMemoryBackend) CreateWebLoginToken(ctx context.Context, envName string) (string, string, error)
CreateWebLoginToken validates that the environment exists and is AVAILABLE, then returns a JWT-shaped web login token and the environment's webserver hostname. AWS returns ResourceNotFoundException when the environment is in any non-AVAILABLE state.
func (*InMemoryBackend) DeleteEnvironment ¶
func (b *InMemoryBackend) DeleteEnvironment(ctx context.Context, name string) (*Environment, error)
DeleteEnvironment deletes an MWAA environment by name and cascades to metrics.
func (*InMemoryBackend) EnableAirflow ¶
func (b *InMemoryBackend) EnableAirflow(cfg AirflowConfig)
EnableAirflow switches the backend to docker mode: every environment runs a real Airflow container.
func (*InMemoryBackend) ExecCLI ¶
func (b *InMemoryBackend) ExecCLI(ctx context.Context, token, command string) (string, string, error)
ExecCLI runs `airflow <command>` in the environment's container, like MWAA's /aws_mwaa/cli endpoint.
func (*InMemoryBackend) GetEnvironment ¶
func (b *InMemoryBackend) GetEnvironment(ctx context.Context, name string) (*Environment, error)
GetEnvironment retrieves a deep copy of an MWAA environment by name.
func (*InMemoryBackend) GetMetrics ¶
func (b *InMemoryBackend) GetMetrics(ctx context.Context, envName string) ([]MetricDatum, error)
GetMetrics returns the stored metrics for the specified environment.
func (*InMemoryBackend) InvokeRestAPI ¶
func (b *InMemoryBackend) InvokeRestAPI( ctx context.Context, envName string, req *invokeRestAPIRequest, ) (*InvokeRestAPIResponse, error)
InvokeRestAPI simulates calling the Apache Airflow REST API on the specified environment's webserver. Like CreateCliToken/CreateWebLoginToken (the other two operations that reach the environment's Airflow webserver), the environment must be AVAILABLE: the webserver process doesn't exist yet while an environment is CREATING/UPDATING/etc, so AWS returns ResourceNotFoundException for any non-AVAILABLE state, not just a missing name.
func (*InMemoryBackend) ListEnvironments ¶
func (b *InMemoryBackend) ListEnvironments(ctx context.Context) ([]string, error)
ListEnvironments returns a sorted list of environment names.
func (*InMemoryBackend) ListEnvironmentsPage ¶
func (b *InMemoryBackend) ListEnvironmentsPage( ctx context.Context, nextToken string, pageSize int, ) ([]string, string, error)
ListEnvironmentsPage returns a paginated, sorted list of environment names. pageSize is clamped to [1, listEnvMaxPageSize]; 0 falls back to listEnvDefaultPageSize. nextToken is the name of the first environment to include in this page (exclusive start cursor of the previous page); empty starts at the beginning.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resourceARN string) (map[string]string, error)
ListTagsForResource returns all tags for a resource identified by its ARN.
func (*InMemoryBackend) PublishMetrics ¶
func (b *InMemoryBackend) PublishMetrics(ctx context.Context, envName string, req *publishMetricsRequest) error
PublishMetrics stores internal environment metrics for the specified environment. The total number of metrics per environment is capped at maxMetricsPerEnv.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the configured region.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset closes the current mutex and reinitialises all state.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot.
func (*InMemoryBackend) SetAppConfig ¶
func (b *InMemoryBackend) SetAppConfig(cfg any)
SetAppConfig records the service.AppContext.Config for lazy sibling lookup.
func (*InMemoryBackend) SetTransitionDelay ¶
func (b *InMemoryBackend) SetTransitionDelay(d time.Duration)
SetTransitionDelay makes environments stay CREATING/UPDATING/DELETING for d before settling; zero keeps the observe-once default.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(ctx context.Context, resourceARN string, tags map[string]string) error
TagResource adds or updates tags on a resource identified by its ARN.
func (*InMemoryBackend) TaggedResources ¶ added in v1.3.1
func (b *InMemoryBackend) TaggedResources() []TaggedEntry
TaggedResources returns every MWAA environment ARN that currently has at least one tag applied via TagResource.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(ctx context.Context, resourceARN string, tagKeys []string) error
UntagResource removes tags from a resource identified by its ARN.
func (*InMemoryBackend) UpdateEnvironment ¶
func (b *InMemoryBackend) UpdateEnvironment( ctx context.Context, name string, req *updateEnvironmentRequest, ) (*Environment, error)
UpdateEnvironment updates an existing MWAA environment.
func (*InMemoryBackend) WebLogin ¶
func (b *InMemoryBackend) WebLogin(ctx context.Context, token string) (*WebSession, error)
WebLogin validates a web login token, logs in server-side and returns the session for the browser.
type InvokeRestAPIResponse ¶
type InvokeRestAPIResponse struct {
RestAPIResponse any `json:"RestApiResponse"`
RestAPIStatusCode int32 `json:"RestApiStatusCode"`
}
InvokeRestAPIResponse is the response body for InvokeRestAPI.
type LastUpdate ¶
type LastUpdate struct {
Error *UpdateError `json:"Error,omitempty"`
Status string `json:"Status,omitempty"`
Source string `json:"Source,omitempty"`
WorkerReplacementStrategy string `json:"WorkerReplacementStrategy,omitempty"`
CreatedAt float64 `json:"CreatedAt,omitempty"`
}
LastUpdate captures the result of the most recent environment update.
type LoggingConfiguration ¶
type LoggingConfiguration struct {
DagProcessingLogs *ModuleLoggingConfiguration `json:"DagProcessingLogs,omitempty"`
SchedulerLogs *ModuleLoggingConfiguration `json:"SchedulerLogs,omitempty"`
TaskLogs *ModuleLoggingConfiguration `json:"TaskLogs,omitempty"`
WebserverLogs *ModuleLoggingConfiguration `json:"WebserverLogs,omitempty"`
WorkerLogs *ModuleLoggingConfiguration `json:"WorkerLogs,omitempty"`
}
LoggingConfiguration aggregates the five Airflow module logging configs.
type LoggingConfigurationInput ¶ added in v1.5.0
type LoggingConfigurationInput struct {
DagProcessingLogs *ModuleLoggingConfigurationInput `json:"DagProcessingLogs,omitempty"`
SchedulerLogs *ModuleLoggingConfigurationInput `json:"SchedulerLogs,omitempty"`
TaskLogs *ModuleLoggingConfigurationInput `json:"TaskLogs,omitempty"`
WebserverLogs *ModuleLoggingConfigurationInput `json:"WebserverLogs,omitempty"`
WorkerLogs *ModuleLoggingConfigurationInput `json:"WorkerLogs,omitempty"`
}
LoggingConfigurationInput is the wire shape CreateEnvironment/UpdateEnvironment requests use for LoggingConfiguration. Unlike the response's LoggingConfiguration, AWS's LoggingConfigurationInput/ModuleLoggingConfigurationInput has no CloudWatchLogGroupArn member -- that ARN is server-computed once a module's logs are enabled, never client-supplied. A prior version of this file reused the response type for request decode too, so a request body setting CloudWatchLogGroupArn was accepted and echoed straight back as if AWS-generated, even though no conformant SDK client (built from LoggingConfigurationInput) can ever send that field.
type MetricDatum ¶
type MetricDatum struct {
StatisticValues *StatisticSet `json:"StatisticValues,omitempty"`
Timestamp *float64 `json:"Timestamp,omitempty"`
Value *float64 `json:"Value,omitempty"`
MetricName string `json:"MetricName"`
Unit string `json:"Unit,omitempty"`
Dimensions []Dimension `json:"Dimensions,omitempty"`
}
MetricDatum represents a single metric data point for PublishMetrics.
type ModuleLoggingConfiguration ¶
type ModuleLoggingConfiguration struct {
Enabled *bool `json:"Enabled,omitempty"`
LogLevel string `json:"LogLevel,omitempty"`
CloudWatchLogGroupArn string `json:"CloudWatchLogGroupArn,omitempty"`
}
ModuleLoggingConfiguration is a single Airflow module logging configuration.
type ModuleLoggingConfigurationInput ¶ added in v1.5.0
type ModuleLoggingConfigurationInput struct {
Enabled *bool `json:"Enabled,omitempty"`
LogLevel string `json:"LogLevel,omitempty"`
}
ModuleLoggingConfigurationInput is a single Airflow module logging request; no CloudWatchLogGroupArn (see LoggingConfigurationInput).
type NetworkConfig ¶
type NetworkConfig struct {
SecurityGroupIDs []string `json:"SecurityGroupIds"`
SubnetIDs []string `json:"SubnetIds"`
}
NetworkConfig holds the VPC networking configuration.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for the MWAA service.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the MWAA service backend and handler.
type StatisticSet ¶
type StatisticSet struct {
Maximum *float64 `json:"Maximum,omitempty"`
Minimum *float64 `json:"Minimum,omitempty"`
SampleCount *int32 `json:"SampleCount,omitempty"`
Sum *float64 `json:"Sum,omitempty"`
}
StatisticSet represents the statistical values for a metric.
type StorageBackend ¶
type StorageBackend interface {
// Environment CRUD
CreateEnvironment(ctx context.Context, name string, req *createEnvironmentRequest) (*Environment, error)
GetEnvironment(ctx context.Context, name string) (*Environment, error)
DeleteEnvironment(ctx context.Context, name string) (*Environment, error)
UpdateEnvironment(ctx context.Context, name string, req *updateEnvironmentRequest) (*Environment, error)
ListEnvironments(ctx context.Context) ([]string, error)
ListEnvironmentsPage(ctx context.Context, nextToken string, pageSize int) ([]string, string, error)
// Tag operations
TagResource(ctx context.Context, resourceARN string, tags map[string]string) error
UntagResource(ctx context.Context, resourceARN string, tagKeys []string) error
ListTagsForResource(ctx context.Context, resourceARN string) (map[string]string, error)
// REST API / metrics
InvokeRestAPI(ctx context.Context, envName string, req *invokeRestAPIRequest) (*InvokeRestAPIResponse, error)
PublishMetrics(ctx context.Context, envName string, req *publishMetricsRequest) error
GetMetrics(ctx context.Context, envName string) ([]MetricDatum, error)
// Token operations — return (token, webserverHostname, error).
CreateCliToken(ctx context.Context, envName string) (string, string, error)
CreateWebLoginToken(ctx context.Context, envName string) (string, string, error)
// Lifecycle
Reset()
Region() string
AccountID() string
Snapshot(ctx context.Context) []byte
Restore(ctx context.Context, data []byte) error
}
StorageBackend is the interface for the MWAA in-memory backend. All per-resource operations take a context.Context carrying the request's AWS region so resources are isolated per region.
type TaggedEntry ¶ added in v1.3.1
TaggedEntry pairs a resource ARN with its tags.
type UpdateError ¶
type UpdateError struct {
ErrorCode string `json:"ErrorCode,omitempty"`
ErrorMessage string `json:"ErrorMessage,omitempty"`
}
UpdateError describes a failed update attempt.
type UpdateNetworkConfig ¶
type UpdateNetworkConfig struct {
SecurityGroupIDs []string `json:"SecurityGroupIds"`
}
UpdateNetworkConfig is the network configuration shape accepted by UpdateEnvironment. Unlike NetworkConfig (used by CreateEnvironment and returned by GetEnvironment), AWS's UpdateNetworkConfigurationInput shape has NO SubnetIds member -- subnets cannot be changed after an environment is created, only SecurityGroupIds can.
type WebSession ¶
WebSession is a logged-in webserver session handed to the browser by the SSO endpoint.
Source Files
¶
- airflow_access.go
- airflow_auth.go
- airflow_cli.go
- airflow_engine.go
- airflow_launch.go
- airflow_startup.go
- airflow_sync.go
- arn_tag_validation.go
- cli_token.go
- environments.go
- errors.go
- exports.go
- handler.go
- handler_airflow.go
- handler_cli_token.go
- handler_environments.go
- handler_metrics.go
- handler_rest_api.go
- handler_tags.go
- handler_web_login_token.go
- interfaces.go
- lifecycle.go
- list_token.go
- metrics.go
- models.go
- persistence.go
- provider.go
- rest_api.go
- store.go
- store_setup.go
- tags.go
- validation.go
- web_login_token.go