Documentation
¶
Index ¶
- Constants
- Variables
- func TaskServicePrincipal() string
- type ASGInfo
- type AccountSetting
- type AlarmStateProvider
- type AttachmentStateChange
- type Attribute
- type AutoScalingGroupController
- type AutoScalingGroupProvider
- type AutoScalingGroupProviderUpdate
- type AutoScalingGroupResolver
- type AwsvpcConfiguration
- type Backend
- type CWLogsBackend
- type CanaryConfiguration
- type CapacityProvider
- type CapacityProviderStrategyItem
- type CloudMapRegistrar
- type Cluster
- type ClusterConfiguration
- type ClusterServiceConnectDefaults
- type ClusterSetting
- type Container
- type ContainerDefinition
- type ContainerDependency
- type ContainerInstance
- type ContainerInstanceDetails
- type ContainerMetadata
- type ContainerOverride
- type ContainerStateChangeItem
- type CreateCapacityProviderInput
- type CreateClusterInput
- type CreateDaemonInput
- type CreateExpressGatewayServiceInput
- type CreateServiceInput
- type CreateTaskSetInput
- type Daemon
- type DaemonAlarmConfiguration
- type DaemonContainerDefinition
- type DaemonDeployment
- type DaemonDeploymentConfiguration
- type DaemonRevision
- type DaemonTaskDefinition
- type DaemonVolume
- type Deployment
- type DeploymentAlarms
- type DeploymentCircuitBreaker
- type DeploymentConfiguration
- type DeploymentController
- type DeploymentLifecycleHook
- type DeploymentLifecycleHookTimeout
- type EFSAuthorizationConfig
- type EFSVolumeConfiguration
- type ELBTarget
- type ELBv2TargetHealthReader
- type ELBv2TargetRegistrar
- type EnvironmentFile
- type EphemeralStorage
- type EventPublisher
- type ExecuteCommandConfiguration
- type ExecuteCommandLogConfiguration
- type ExecuteCommandOutput
- type ExpressGatewayContainer
- type ExpressGatewayRepositoryCredentials
- type ExpressGatewayScalingTarget
- type ExpressGatewayService
- type ExpressGatewayServiceAwsLogsConfiguration
- type ExpressGatewayServiceConfiguration
- type ExpressGatewayServiceNetworkConfiguration
- type ExpressGatewayServiceStatus
- type Failure
- type FirelensConfiguration
- type Handler
- func (h *Handler) BackendFor(region string) Backend
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) EnableRegions(ctx context.Context)
- func (h *Handler) ExecuteFISAction(_ context.Context, action service.FISActionExecution) error
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) FISActions() []service.FISActionDefinition
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Purge(ctx context.Context, cutoff time.Time)
- func (h *Handler) RegionBackends() []Backend
- func (h *Handler) RegionHandler(region string) *Handler
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) ServeTaskCredentials(c *echo.Context) error
- func (h *Handler) ServeTaskMetadata(c *echo.Context) error
- func (h *Handler) SetCWLogsFactory(f func(region string) CWLogsBackend)
- func (h *Handler) SetMetricEmitter(e cwmetric.Emitter)
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type HealthCheck
- type HostVolumeProperties
- type InMemoryBackend
- func (b *InMemoryBackend) AddAccountSettingInternal(_ string, setting *AccountSetting)
- func (b *InMemoryBackend) AddAttributeInternal(cluster string, attr *Attribute)
- func (b *InMemoryBackend) AddCapacityProviderInternal(cp *CapacityProvider)
- func (b *InMemoryBackend) AddServiceDeploymentInternal(sd *ServiceDeployment)
- func (b *InMemoryBackend) ContinueServiceDeployment(serviceDeploymentArn, hookID, action string) (*ServiceDeployment, error)
- func (b *InMemoryBackend) CountRunningTasksForService(clusterName, serviceName string) int
- func (b *InMemoryBackend) CreateCapacityProvider(input CreateCapacityProviderInput) (*CapacityProvider, error)
- func (b *InMemoryBackend) CreateCluster(input CreateClusterInput) (*Cluster, error)
- func (b *InMemoryBackend) CreateDaemon(input CreateDaemonInput) (*Daemon, error)
- func (b *InMemoryBackend) CreateExpressGatewayService(input CreateExpressGatewayServiceInput) (*ExpressGatewayService, error)
- func (b *InMemoryBackend) CreateService(input CreateServiceInput) (*Service, error)
- func (b *InMemoryBackend) CreateTaskSet(input CreateTaskSetInput) (*TaskSet, error)
- func (b *InMemoryBackend) DeleteAccountSetting(name, principalArn string) (*AccountSetting, error)
- func (b *InMemoryBackend) DeleteAttributes(cluster string, attrs []Attribute) ([]Attribute, error)
- func (b *InMemoryBackend) DeleteCapacityProvider(nameOrArn string) (*CapacityProvider, error)
- func (b *InMemoryBackend) DeleteCluster(clusterName string) (*Cluster, error)
- func (b *InMemoryBackend) DeleteDaemon(daemonArn string) (*Daemon, error)
- func (b *InMemoryBackend) DeleteDaemonTaskDefinition(familyOrArn string) (*DaemonTaskDefinition, error)
- func (b *InMemoryBackend) DeleteExpressGatewayService(serviceArn string) (*ExpressGatewayService, error)
- func (b *InMemoryBackend) DeleteService(cluster, serviceName string, force ...bool) (*Service, error)
- func (b *InMemoryBackend) DeleteTaskDefinitions(taskDefinitionArns []string) ([]TaskDefinition, []Failure, error)
- func (b *InMemoryBackend) DeleteTaskSet(cluster, service, taskSet string) (*TaskSet, error)
- func (b *InMemoryBackend) DeregisterContainerInstance(cluster, containerInstance string, force bool) (*ContainerInstance, error)
- func (b *InMemoryBackend) DeregisterTaskDefinition(taskDefinitionArn string) (*TaskDefinition, error)
- func (b *InMemoryBackend) DescribeCapacityProviders(nameOrArns []string, cluster string) ([]CapacityProvider, []Failure, error)
- func (b *InMemoryBackend) DescribeClusters(clusterNames []string) ([]Cluster, []Failure, error)
- func (b *InMemoryBackend) DescribeContainerInstances(cluster string, containerInstances []string) ([]ContainerInstance, []Failure, error)
- func (b *InMemoryBackend) DescribeDaemon(daemonArn string) (*Daemon, error)
- func (b *InMemoryBackend) DescribeDaemonDeployments(arns []string) ([]DaemonDeployment, []Failure, error)
- func (b *InMemoryBackend) DescribeDaemonRevisions(arns []string) ([]DaemonRevision, []Failure, error)
- func (b *InMemoryBackend) DescribeDaemonTaskDefinition(familyOrArn string) (*DaemonTaskDefinition, error)
- func (b *InMemoryBackend) DescribeExpressGatewayService(serviceArn string) (*ExpressGatewayService, error)
- func (b *InMemoryBackend) DescribeServiceDeployments(serviceDeploymentArns []string) ([]ServiceDeployment, []Failure, error)
- func (b *InMemoryBackend) DescribeServiceRevisions(arns []string) ([]ServiceRevision, []Failure)
- func (b *InMemoryBackend) DescribeServices(cluster string, serviceNames []string) ([]Service, []Failure, error)
- func (b *InMemoryBackend) DescribeTaskDefinition(familyOrArn string) (*TaskDefinition, error)
- func (b *InMemoryBackend) DescribeTaskSets(cluster, service string, taskSets []string) ([]TaskSet, []Failure, error)
- func (b *InMemoryBackend) DescribeTasks(cluster string, taskArns []string) ([]Task, []Failure, error)
- func (b *InMemoryBackend) DiscoverPollEndpoint() (string, string, string)
- func (b *InMemoryBackend) EndpointURL() string
- func (b *InMemoryBackend) ExecuteCommand(cluster, task, container, command string, interactive bool) (*ExecuteCommandOutput, error)
- func (b *InMemoryBackend) ExpressServicesInCluster(cluster string, names []string) []Service
- func (b *InMemoryBackend) GetRegion() string
- func (b *InMemoryBackend) GetTaskProtection(cluster string, taskArns []string) ([]TaskProtection, []Failure, error)
- func (b *InMemoryBackend) ListAccountSettings(name, principalArn string, effectiveSettings bool) ([]AccountSetting, error)
- func (b *InMemoryBackend) ListAttributes(cluster, targetType, attributeName, targetID string) ([]Attribute, error)
- func (b *InMemoryBackend) ListClusters() ([]Cluster, error)
- func (b *InMemoryBackend) ListContainerInstances(cluster, status string) ([]string, error)
- func (b *InMemoryBackend) ListDaemonDeployments(input ListDaemonDeploymentsInput) ([]DaemonDeployment, error)
- func (b *InMemoryBackend) ListDaemonTaskDefinitions(input ListDaemonTaskDefinitionsInput) ([]DaemonTaskDefinition, error)
- func (b *InMemoryBackend) ListDaemons(input ListDaemonsInput) ([]Daemon, error)
- func (b *InMemoryBackend) ListServiceDeployments(cluster, service string) ([]ServiceDeployment, error)
- func (b *InMemoryBackend) ListServices(cluster, launchType, schedulingStrategy string) ([]string, error)
- func (b *InMemoryBackend) ListServicesByNamespace(namespace string) ([]string, error)
- func (b *InMemoryBackend) ListTagsForResource(resourceArn string) ([]Tag, error)
- func (b *InMemoryBackend) ListTaskDefinitionFamilies(familyPrefix, status string) ([]string, error)
- func (b *InMemoryBackend) ListTaskDefinitions(familyPrefix string) ([]string, error)
- func (b *InMemoryBackend) ListTaskDefinitionsFiltered(input ListTaskDefinitionsInput) ([]string, error)
- func (b *InMemoryBackend) ListTasks(cluster string) ([]string, error)
- func (b *InMemoryBackend) ListTasksFiltered(input ListTasksInput) ([]string, error)
- func (b *InMemoryBackend) Purge(_ context.Context, cutoff time.Time)
- func (b *InMemoryBackend) PutAccountSetting(name, value, principalArn string) (*AccountSetting, error)
- func (b *InMemoryBackend) PutAccountSettingDefault(name, value string) (*AccountSetting, error)
- func (b *InMemoryBackend) PutAttributes(cluster string, attrs []Attribute) ([]Attribute, error)
- func (b *InMemoryBackend) PutClusterCapacityProviders(cluster string, capacityProviders []string, ...) (*Cluster, error)
- func (b *InMemoryBackend) ReconcileCapacity(ctx context.Context)
- func (b *InMemoryBackend) RegisterClusterDeleteHook(fn func(clusterName string))
- func (b *InMemoryBackend) RegisterContainerInstance(cluster, ec2InstanceID string) (*ContainerInstance, error)
- func (b *InMemoryBackend) RegisterContainerInstanceWithDetails(cluster, ec2InstanceID string, details ContainerInstanceDetails) (*ContainerInstance, error)
- func (b *InMemoryBackend) RegisterDaemonTaskDefinition(input RegisterDaemonTaskDefinitionInput) (*DaemonTaskDefinition, error)
- func (b *InMemoryBackend) RegisterTaskDefinition(input RegisterTaskDefinitionInput) (*TaskDefinition, error)
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) RunTask(input RunTaskInput) ([]Task, []Failure, error)
- func (b *InMemoryBackend) SFNRunTask(_ context.Context, input map[string]any) (any, error)
- func (b *InMemoryBackend) SetAlarmStateProvider(p AlarmStateProvider)
- func (b *InMemoryBackend) SetAutoScalingGroupController(c AutoScalingGroupController)
- func (b *InMemoryBackend) SetAutoScalingGroupResolver(r AutoScalingGroupResolver)
- func (b *InMemoryBackend) SetCWLogsBackend(cwl CWLogsBackend)
- func (b *InMemoryBackend) SetCloudMapRegistrar(r CloudMapRegistrar)
- func (b *InMemoryBackend) SetELBv2Registrar(r ELBv2TargetRegistrar)
- func (b *InMemoryBackend) SetEndpointURL(u string)
- func (b *InMemoryBackend) SetEventPublisher(p EventPublisher)
- func (b *InMemoryBackend) SetInstanceResourceResolver(r InstanceResourceResolver)
- func (b *InMemoryBackend) SetLambdaInvoker(l LambdaInvoker)
- func (b *InMemoryBackend) SetLinkLocal(l LinkLocal)
- func (b *InMemoryBackend) SetMetricEmitter(e cwmetric.Emitter)
- func (b *InMemoryBackend) SetRoleCredentialIssuer(i RoleCredentialIssuer)
- func (b *InMemoryBackend) SetStartDelay(d time.Duration)
- func (b *InMemoryBackend) SetStopDelay(d time.Duration)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartTask(input StartTaskInput) ([]Task, []Failure, error)
- func (b *InMemoryBackend) StartTaskForService(clusterName, serviceName, taskDefinitionArn string) error
- func (b *InMemoryBackend) StopOldestServiceTask(clusterName, serviceName string) error
- func (b *InMemoryBackend) StopServiceDeployment(serviceDeploymentArn, stopType string) (*ServiceDeployment, error)
- func (b *InMemoryBackend) StopTask(cluster, taskArn, reason string) (*Task, error)
- func (b *InMemoryBackend) SubmitAttachmentStateChanges(cluster string, attachments []AttachmentStateChange) error
- func (b *InMemoryBackend) SubmitContainerStateChange(input SubmitContainerStateChangeInput) error
- func (b *InMemoryBackend) SubmitTaskStateChange(input SubmitTaskStateChangeInput) error
- func (b *InMemoryBackend) TagResource(resourceArn string, tags []Tag) error
- func (b *InMemoryBackend) TaggedResources() []TaggedEntry
- func (b *InMemoryBackend) TaskMetadataFor(taskID string, withTags bool) (TaskMetadata, bool)
- func (b *InMemoryBackend) UntagResource(resourceArn string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateCapacityProvider(input UpdateCapacityProviderInput) (*CapacityProvider, error)
- func (b *InMemoryBackend) UpdateCluster(input UpdateClusterInput) (*Cluster, error)
- func (b *InMemoryBackend) UpdateClusterSettings(cluster string, settings []ClusterSetting) (*Cluster, error)
- func (b *InMemoryBackend) UpdateContainerAgent(cluster, containerInstance string) (*ContainerInstance, error)
- func (b *InMemoryBackend) UpdateContainerInstancesState(cluster string, containerInstances []string, status string) ([]ContainerInstance, []Failure, error)
- func (b *InMemoryBackend) UpdateDaemon(input UpdateDaemonInput) (*Daemon, error)
- func (b *InMemoryBackend) UpdateExpressGatewayService(input UpdateExpressGatewayServiceInput) (*ExpressGatewayService, error)
- func (b *InMemoryBackend) UpdateService(input UpdateServiceInput) (*Service, error)
- func (b *InMemoryBackend) UpdateServicePrimaryTaskSet(cluster, service, primaryTaskSet string) (*TaskSet, error)
- func (b *InMemoryBackend) UpdateTaskProtection(cluster string, taskArns []string, protectionEnabled bool, ...) ([]TaskProtection, []Failure, error)
- func (b *InMemoryBackend) UpdateTaskSet(cluster, service, taskSet string, scale TaskSetScale) (*TaskSet, error)
- type InferenceAccelerator
- type IngressPathSummary
- type InstanceResourceResolver
- type Janitor
- type KeyValuePair
- type LambdaInvoker
- type LifecycleHookDetail
- type LinearConfiguration
- type LinkLocal
- type ListDaemonDeploymentsInput
- type ListDaemonTaskDefinitionsInput
- type ListDaemonsInput
- type ListTaskDefinitionsInput
- type ListTasksInput
- type LoadBalancer
- type LogConfiguration
- type ManagedScaling
- type ManagedStorageConfiguration
- type MetricConfiguration
- type MonitoringConfiguration
- type MountPoint
- type NetworkBinding
- type NetworkConfiguration
- type NetworkInterface
- type PlacementConstraint
- type PlacementStrategy
- type PortMapping
- type Provider
- type ProxyConfiguration
- type Reconciler
- type RegisterDaemonTaskDefinitionInput
- type RegisterTaskDefinitionInput
- type RepositoryCredentials
- type Resource
- type ResourceRequirement
- type RoleCredentialIssuer
- type RoleCredentials
- type RunTaskInput
- type RuntimePlatform
- type SecretOption
- type SecretReference
- type Service
- type ServiceConnectClientAlias
- type ServiceConnectConfiguration
- type ServiceConnectService
- type ServiceDeployment
- type ServiceDeploymentAlarms
- type ServiceDeploymentCircuitBreaker
- type ServiceDeploymentRollback
- type ServiceEvent
- type ServiceRegistry
- type ServiceRevision
- type ServiceRevisionSummary
- type Session
- type Snapshottable
- type StartTaskInput
- type SubmitContainerStateChangeInput
- type SubmitTaskStateChangeInput
- type Tag
- type TaggedEntry
- type Task
- type TaskAttachment
- type TaskDefinition
- type TaskMetadata
- type TaskOverride
- type TaskProtection
- type TaskRunner
- type TaskSet
- type TaskSetScale
- type TaskUsageReader
- type UpdateCapacityProviderInput
- type UpdateClusterInput
- type UpdateDaemonInput
- type UpdateExpressGatewayServiceInput
- type UpdateServiceInput
- type VersionInfo
- type Volume
- type VolumeFrom
Constants ¶
const (
// LinkLocalHost is the address real ECS serves task credentials and metadata on.
LinkLocalHost = "169.254.170.2"
)
Variables ¶
var ( // ErrDaemonNotFound is returned when a daemon does not exist. This mirrors // types.DaemonNotFoundException in aws-sdk-go-v2/service/ecs. ErrDaemonNotFound = awserr.New("DaemonNotFoundException", awserr.ErrNotFound) // ErrDaemonNotActive is returned when attempting to update a daemon that is // not ACTIVE. This mirrors types.DaemonNotActiveException. ErrDaemonNotActive = awserr.New("DaemonNotActiveException", awserr.ErrConflict) // ErrDaemonTaskDefinitionNotFound is returned when a daemon task definition // does not exist. Amazon ECS does not model a dedicated NotFound exception // shape for daemon task definitions; it uses the generic ClientException // (mirrors real DescribeTaskDefinition / DeregisterTaskDefinition behavior). ErrDaemonTaskDefinitionNotFound = awserr.New("ClientException", awserr.ErrNotFound) // ErrDaemonAlreadyExists is returned when a daemon with the same name // already exists in the cluster. Amazon ECS does not model a dedicated // AlreadyExists exception for daemons; it uses the generic ResourceInUseException. ErrDaemonAlreadyExists = awserr.New("ResourceInUseException", awserr.ErrAlreadyExists) )
var ( // ErrClusterNotFound is returned when a cluster does not exist. ErrClusterNotFound = awserr.New("ClusterNotFoundException", awserr.ErrNotFound) // ErrServiceNotFound is returned when a service does not exist. ErrServiceNotFound = awserr.New("ServiceNotFoundException", awserr.ErrNotFound) // ErrResourceNotFound is returned when a generic resource does not exist // (e.g. DescribeExpressGatewayService's not-found case: unlike its // Delete/Update siblings, which model plain ServiceNotFoundException, // this op's own deserializer models ResourceNotFoundException instead). ErrResourceNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound) // ErrInvalidParameter is returned when a required parameter is missing or invalid. ErrInvalidParameter = awserr.New("InvalidParameterException", awserr.ErrInvalidParameter) // ErrClient is returned when a request is structurally invalid in a way that // AWS ECS reports as a ClientException (for example, malformed container // definitions or an unsupported network mode / launch-type combination). ErrClient = awserr.New("ClientException", awserr.ErrInvalidParameter) // ErrCapacityProviderInUse is returned when deleting a capacity provider // still associated with a cluster. Uses the ErrAlreadyExists kind (like // ErrDaemonAlreadyExists in daemon.go) since handleError only maps // ErrNotFound/ErrAlreadyExists/ErrInvalidParameter kinds to 400; the wire // code is still the real SDK's ResourceInUseException. ErrCapacityProviderInUse = awserr.New("ResourceInUseException", awserr.ErrAlreadyExists) // ErrTaskIDInUse is returned when a gopherstack:id tag pins an already-used task ID. ErrTaskIDInUse = awserr.New("ResourceInUseException", awserr.ErrAlreadyExists) // ErrClusterContainsServices is returned by DeleteCluster when the cluster // still has services; they must be deleted first. ErrClusterContainsServices = awserr.New("ClusterContainsServicesException", awserr.ErrInvalidParameter) // ErrClusterContainsTasks is returned by DeleteCluster when the cluster // still has active (non-STOPPED) tasks. ErrClusterContainsTasks = awserr.New("ClusterContainsTasksException", awserr.ErrInvalidParameter) // ErrClusterContainsContainerInstances is returned by DeleteCluster when the // cluster still has registered container instances; they must be // deregistered first. ErrClusterContainsContainerInstances = awserr.New( "ClusterContainsContainerInstancesException", awserr.ErrInvalidParameter, ) )
ErrContainerStatsUnavailable is returned when the task runner cannot report container stats.
var ErrNilAppContext = errors.New("AppContext is required")
ErrNilAppContext is returned when Provider.Init is called with a nil AppContext.
var ErrServiceDeploymentNotFound = awserr.New( "ServiceDeploymentNotFoundException", awserr.ErrNotFound, )
ErrServiceDeploymentNotFound is returned when a service deployment does not exist.
ErrTaskCredentialsUnavailable is returned when a task has no role or no issuer is wired.
var ErrTaskSetNotFound = awserr.New("TaskSetNotFoundException", awserr.ErrNotFound)
ErrTaskSetNotFound is returned when a task set does not exist.
Functions ¶
func TaskServicePrincipal ¶
func TaskServicePrincipal() string
TaskServicePrincipal is the service principal a task role must trust.
Types ¶
type ASGInfo ¶
type ASGInfo struct {
Name string
InstanceType string
InServiceInstanceIDs []string
Min, Max, Desired int
}
ASGInfo is the slice of an Auto Scaling group managed scaling needs.
type AccountSetting ¶
type AccountSetting struct {
Name string `json:"name"`
Value string `json:"value"`
PrincipalArn string `json:"principalArn,omitempty"`
}
AccountSetting represents an ECS account setting for a principal.
type AlarmStateProvider ¶
AlarmStateProvider reports which of the named CloudWatch alarms in region are in ALARM state.
type AttachmentStateChange ¶
type AttachmentStateChange struct {
AttachmentArn string `json:"attachmentArn"`
Status string `json:"status"`
}
AttachmentStateChange reports a status transition for a single task attachment (e.g. an ENI), identified by the attachment ARN previously handed out by ECS.
type Attribute ¶
type Attribute struct {
Name string `json:"name"`
Value string `json:"value,omitempty"`
TargetID string `json:"targetId,omitempty"`
TargetType string `json:"targetType,omitempty"`
}
Attribute represents a custom ECS resource attribute.
type AutoScalingGroupController ¶
type AutoScalingGroupController interface {
AutoScalingGroupResolver
DescribeGroup(arnOrName string) (ASGInfo, bool)
SetDesiredCapacity(arnOrName string, desired int) error
SetInstanceProtection(arnOrName string, instanceIDs []string, protected bool) error
}
AutoScalingGroupController reads and drives the Auto Scaling group behind a capacity provider.
type AutoScalingGroupProvider ¶
type AutoScalingGroupProvider struct {
AutoScalingGroupArn string `json:"autoScalingGroupArn"`
ManagedScaling *ManagedScaling `json:"managedScaling,omitempty"`
ManagedTerminationProtection string `json:"managedTerminationProtection,omitempty"`
ManagedDraining string `json:"managedDraining,omitempty"`
}
AutoScalingGroupProvider configures an ASG-backed capacity provider.
type AutoScalingGroupProviderUpdate ¶ added in v1.2.0
type AutoScalingGroupProviderUpdate struct {
ManagedScaling *ManagedScaling
ManagedTerminationProtection string
ManagedDraining string
}
AutoScalingGroupProviderUpdate holds the mutable subset of AutoScalingGroupProvider that UpdateCapacityProvider can change. Unlike AutoScalingGroupProvider (used at creation time), it has no AutoScalingGroupArn: the ASG a capacity provider wraps cannot be swapped after creation, matching the real UpdateCapacityProviderRequest's AutoScalingGroupProviderUpdate shape.
type AutoScalingGroupResolver ¶
AutoScalingGroupResolver reports whether an Auto Scaling group (by ARN or name) exists.
type AwsvpcConfiguration ¶
type AwsvpcConfiguration struct {
AssignPublicIP string `json:"assignPublicIp,omitempty"`
Subnets []string `json:"subnets"`
SecurityGroups []string `json:"securityGroups,omitempty"`
}
AwsvpcConfiguration holds awsvpc mode network settings.
type Backend ¶
type Backend interface {
CreateCluster(input CreateClusterInput) (*Cluster, error)
ListClusters() ([]Cluster, error)
DescribeClusters(clusterNames []string) ([]Cluster, []Failure, error)
DeleteCluster(clusterName string) (*Cluster, error)
RegisterTaskDefinition(input RegisterTaskDefinitionInput) (*TaskDefinition, error)
DescribeTaskDefinition(family string) (*TaskDefinition, error)
DeregisterTaskDefinition(taskDefinitionArn string) (*TaskDefinition, error)
ListTaskDefinitions(familyPrefix string) ([]string, error)
ListTaskDefinitionsFiltered(input ListTaskDefinitionsInput) ([]string, error)
DeleteTaskDefinitions(taskDefinitionArns []string) ([]TaskDefinition, []Failure, error)
CreateService(input CreateServiceInput) (*Service, error)
DescribeServices(cluster string, serviceNames []string) ([]Service, []Failure, error)
UpdateService(input UpdateServiceInput) (*Service, error)
DeleteService(cluster, serviceName string, force ...bool) (*Service, error)
ListServices(cluster, launchType, schedulingStrategy string) ([]string, error)
ExpressServicesInCluster(cluster string, names []string) []Service
RunTask(input RunTaskInput) ([]Task, []Failure, error)
DescribeTasks(cluster string, taskArns []string) ([]Task, []Failure, error)
StopTask(cluster, taskArn, reason string) (*Task, error)
ListTasks(cluster string) ([]string, error)
ListTasksFiltered(input ListTasksInput) ([]string, error)
RegisterContainerInstance(cluster, ec2InstanceID string) (*ContainerInstance, error)
RegisterContainerInstanceWithDetails(
cluster, ec2InstanceID string,
details ContainerInstanceDetails,
) (*ContainerInstance, error)
DeregisterContainerInstance(
cluster, containerInstance string,
force bool,
) (*ContainerInstance, error)
DescribeContainerInstances(
cluster string,
containerInstances []string,
) ([]ContainerInstance, []Failure, error)
ListContainerInstances(cluster, status string) ([]string, error)
UpdateContainerInstancesState(
cluster string,
containerInstances []string,
status string,
) ([]ContainerInstance, []Failure, error)
CreateTaskSet(input CreateTaskSetInput) (*TaskSet, error)
DeleteTaskSet(cluster, service, taskSet string) (*TaskSet, error)
DescribeTaskSets(cluster, service string, taskSets []string) ([]TaskSet, []Failure, error)
UpdateTaskSet(cluster, service, taskSet string, scale TaskSetScale) (*TaskSet, error)
UpdateServicePrimaryTaskSet(cluster, service, primaryTaskSet string) (*TaskSet, error)
ExecuteCommand(
cluster, task, container, command string,
interactive bool,
) (*ExecuteCommandOutput, error)
CreateCapacityProvider(input CreateCapacityProviderInput) (*CapacityProvider, error)
DeleteCapacityProvider(nameOrArn string) (*CapacityProvider, error)
DescribeCapacityProviders(nameOrArns []string, cluster string) ([]CapacityProvider, []Failure, error)
DeleteAccountSetting(name, principalArn string) (*AccountSetting, error)
ListAccountSettings(name, principalArn string, effectiveSettings bool) ([]AccountSetting, error)
PutAccountSetting(name, value, principalArn string) (*AccountSetting, error)
PutAccountSettingDefault(name, value string) (*AccountSetting, error)
DeleteAttributes(cluster string, attrs []Attribute) ([]Attribute, error)
ListAttributes(cluster, targetType, attributeName, targetID string) ([]Attribute, error)
PutAttributes(cluster string, attrs []Attribute) ([]Attribute, error)
PutClusterCapacityProviders(
cluster string,
capacityProviders []string,
defaultCapacityProviderStrategy []CapacityProviderStrategyItem,
) (*Cluster, error)
UpdateClusterSettings(cluster string, settings []ClusterSetting) (*Cluster, error)
UpdateContainerAgent(cluster, containerInstance string) (*ContainerInstance, error)
UpdateCluster(input UpdateClusterInput) (*Cluster, error)
UpdateCapacityProvider(input UpdateCapacityProviderInput) (*CapacityProvider, error)
ListTaskDefinitionFamilies(familyPrefix, status string) ([]string, error)
StartTask(input StartTaskInput) ([]Task, []Failure, error)
ListServicesByNamespace(namespace string) ([]string, error)
TagResource(resourceArn string, tags []Tag) error
UntagResource(resourceArn string, tagKeys []string) error
ListTagsForResource(resourceArn string) ([]Tag, error)
DescribeServiceDeployments(
serviceDeploymentArns []string,
) ([]ServiceDeployment, []Failure, error)
ListServiceDeployments(cluster, service string) ([]ServiceDeployment, error)
StopServiceDeployment(serviceDeploymentArn, stopType string) (*ServiceDeployment, error)
ContinueServiceDeployment(serviceDeploymentArn, hookID, action string) (*ServiceDeployment, error)
CreateExpressGatewayService(
input CreateExpressGatewayServiceInput,
) (*ExpressGatewayService, error)
DeleteExpressGatewayService(serviceArn string) (*ExpressGatewayService, error)
DescribeExpressGatewayService(serviceArn string) (*ExpressGatewayService, error)
UpdateExpressGatewayService(
input UpdateExpressGatewayServiceInput,
) (*ExpressGatewayService, error)
GetTaskProtection(cluster string, taskArns []string) ([]TaskProtection, []Failure, error)
UpdateTaskProtection(
cluster string,
taskArns []string,
protectionEnabled bool,
expiresInMinutes *int,
) ([]TaskProtection, []Failure, error)
CreateDaemon(input CreateDaemonInput) (*Daemon, error)
DeleteDaemon(daemonArn string) (*Daemon, error)
DescribeDaemon(daemonArn string) (*Daemon, error)
UpdateDaemon(input UpdateDaemonInput) (*Daemon, error)
ListDaemons(input ListDaemonsInput) ([]Daemon, error)
DescribeDaemonDeployments(arns []string) ([]DaemonDeployment, []Failure, error)
ListDaemonDeployments(input ListDaemonDeploymentsInput) ([]DaemonDeployment, error)
DescribeDaemonRevisions(arns []string) ([]DaemonRevision, []Failure, error)
RegisterDaemonTaskDefinition(input RegisterDaemonTaskDefinitionInput) (*DaemonTaskDefinition, error)
DescribeDaemonTaskDefinition(familyOrArn string) (*DaemonTaskDefinition, error)
DeleteDaemonTaskDefinition(familyOrArn string) (*DaemonTaskDefinition, error)
ListDaemonTaskDefinitions(input ListDaemonTaskDefinitionsInput) ([]DaemonTaskDefinition, error)
DescribeServiceRevisions(arns []string) ([]ServiceRevision, []Failure)
DiscoverPollEndpoint() (endpoint, serviceConnectEndpoint, telemetryEndpoint string)
SubmitTaskStateChange(input SubmitTaskStateChangeInput) error
SubmitContainerStateChange(input SubmitContainerStateChangeInput) error
SubmitAttachmentStateChanges(cluster string, attachments []AttachmentStateChange) error
GetRegion() string
}
Backend defines the interface for ECS control-plane operations. InMemoryBackend implements this interface; alternative backends (e.g. test doubles or future persistence-aware backends) can implement it too.
type CWLogsBackend ¶
type CWLogsBackend interface {
EnsureLogGroupAndStream(groupName, streamName string) error
PutLogLines(groupName, streamName string, messages []string) error
}
CWLogsBackend is the subset of CloudWatch Logs operations that ECS needs to make an awslogs-driver container's log group/stream discoverable, wired via SetCWLogsBackend. Identical in shape to lambda.CWLogsBackend and firehose.CWLogsBackend (see services/lambda/store.go), this repo's convention for a cross-service log sink.
type CanaryConfiguration ¶
type CanaryConfiguration struct {
CanaryBakeTimeInMinutes *int `json:"canaryBakeTimeInMinutes,omitempty"`
CanaryPercent *float64 `json:"canaryPercent,omitempty"`
}
CanaryConfiguration mirrors types.CanaryConfiguration.
type CapacityProvider ¶
type CapacityProvider struct {
CreatedAt time.Time `json:"createdAt"`
CapacityProviderArn string `json:"capacityProviderArn"`
Name string `json:"name"`
Status string `json:"status"`
UpdateStatus string `json:"updateStatus,omitempty"`
UpdateStatusReason string `json:"updateStatusReason,omitempty"`
AutoScalingGroupProvider *AutoScalingGroupProvider `json:"autoScalingGroupProvider,omitempty"`
Tags []Tag `json:"tags,omitempty"`
}
CapacityProvider represents an ECS capacity provider.
type CapacityProviderStrategyItem ¶
type CapacityProviderStrategyItem struct {
CapacityProvider string `json:"capacityProvider"`
Base int `json:"base,omitempty"`
Weight int `json:"weight,omitempty"`
}
CapacityProviderStrategyItem represents a single item in a default capacity provider strategy.
type CloudMapRegistrar ¶
type CloudMapRegistrar interface {
ValidateRegistry(ctx context.Context, registryArn string) error
RegisterInstance(ctx context.Context, registryArn, instanceID string, attrs map[string]string) error
DeregisterInstance(ctx context.Context, registryArn, instanceID string) error
}
CloudMapRegistrar registers ECS tasks as AWS Cloud Map instances. The ECS backend resolves it at call time; ValidateRegistry rejects a registry ARN that names no Cloud Map service.
type Cluster ¶
type Cluster struct {
CreatedAt time.Time `json:"createdAt"`
ServiceConnectDefaults *ClusterServiceConnectDefaults `json:"serviceConnectDefaults,omitempty"`
Configuration *ClusterConfiguration `json:"configuration,omitempty"`
ClusterArn string `json:"clusterArn"`
ClusterName string `json:"clusterName"`
Status string `json:"status"`
DefaultCapacityProviderStrategy []CapacityProviderStrategyItem `json:"defaultCapacityProviderStrategy,omitempty"`
Settings []ClusterSetting `json:"settings,omitempty"`
CapacityProviders []string `json:"capacityProviders,omitempty"`
ActiveServicesCount int `json:"activeServicesCount"`
PendingTasksCount int `json:"pendingTasksCount"`
RegisteredContainerInstancesCount int `json:"registeredContainerInstancesCount"`
RunningTasksCount int `json:"runningTasksCount"`
}
Cluster represents an ECS cluster.
type ClusterConfiguration ¶
type ClusterConfiguration struct {
ExecuteCommandConfiguration *ExecuteCommandConfiguration `json:"executeCommandConfiguration,omitempty"`
ManagedStorageConfiguration *ManagedStorageConfiguration `json:"managedStorageConfiguration,omitempty"`
}
ClusterConfiguration is a cluster's execute-command and managed-storage settings.
type ClusterServiceConnectDefaults ¶
type ClusterServiceConnectDefaults struct {
Namespace string `json:"namespace,omitempty"`
}
ClusterServiceConnectDefaults holds the cluster-level default Service Connect namespace, echoed back on Cluster (mirrors types.ClusterServiceConnectDefaults in the SDK).
type ClusterSetting ¶
ClusterSetting represents a single cluster setting name/value pair.
type Container ¶
type Container struct {
ContainerArn string `json:"containerArn,omitempty"`
TaskArn string `json:"taskArn,omitempty"`
Name string `json:"name"`
Image string `json:"image,omitempty"`
ImageDigest string `json:"imageDigest,omitempty"`
RuntimeID string `json:"runtimeId,omitempty"`
LastStatus string `json:"lastStatus"`
HealthStatus string `json:"healthStatus,omitempty"`
CPU string `json:"cpu,omitempty"`
Memory string `json:"memory,omitempty"`
MemoryReservation string `json:"memoryReservation,omitempty"`
Reason string `json:"reason,omitempty"`
ExitCode *int `json:"exitCode,omitempty"`
NetworkInterfaces []NetworkInterface `json:"networkInterfaces,omitempty"`
NetworkBindings []NetworkBinding `json:"networkBindings,omitempty"`
}
Container holds the runtime status of a single container within a task.
type ContainerDefinition ¶
type ContainerDefinition struct {
LogConfiguration *LogConfiguration `json:"logConfiguration,omitempty"`
FirelensConfiguration *FirelensConfiguration `json:"firelensConfiguration,omitempty"`
HealthCheck *HealthCheck `json:"healthCheck,omitempty"`
RepositoryCredentials *RepositoryCredentials `json:"repositoryCredentials,omitempty"`
Image string `json:"image"`
Name string `json:"name"`
EntryPoint []string `json:"entryPoint,omitempty"`
Command []string `json:"command,omitempty"`
Environment []KeyValuePair `json:"environment,omitempty"`
Secrets []SecretReference `json:"secrets,omitempty"`
EnvironmentFiles []EnvironmentFile `json:"environmentFiles,omitempty"`
ResourceRequirements []ResourceRequirement `json:"resourceRequirements,omitempty"`
PortMappings []PortMapping `json:"portMappings,omitempty"`
MountPoints []MountPoint `json:"mountPoints,omitempty"`
VolumesFrom []VolumeFrom `json:"volumesFrom,omitempty"`
DependsOn []ContainerDependency `json:"dependsOn,omitempty"`
Memory int `json:"memory,omitempty"`
MemoryReservation int `json:"memoryReservation,omitempty"`
CPU int `json:"cpu,omitempty"`
Essential bool `json:"essential"`
DisableNetworking bool `json:"disableNetworking,omitempty"`
Privileged bool `json:"privileged,omitempty"`
ReadonlyRootFilesystem bool `json:"readonlyRootFilesystem,omitempty"`
}
ContainerDefinition represents a container definition in a task definition.
func (*ContainerDefinition) UnmarshalJSON ¶
func (c *ContainerDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON defaults Essential to true when the key is omitted, per types.ContainerDefinition.Essential's documented default.
type ContainerDependency ¶
type ContainerDependency struct {
ContainerName string `json:"containerName"`
Condition string `json:"condition"`
}
ContainerDependency specifies a start/stop dependency between containers.
type ContainerInstance ¶
type ContainerInstance struct {
RegisteredAt time.Time `json:"registeredAt"`
// InactiveAt is when DeregisterContainerInstance moved the instance to INACTIVE.
InactiveAt time.Time `json:"inactiveAt,omitzero"`
// AllocatedPorts tracks host ports currently reserved on this instance by
// bridge/host-mode EC2-launch-type tasks, keyed by "<protocol>/<hostPort>"
// (e.g. "tcp/51000") -- see host_ports.go. Not part of any real ECS wire
// shape (AWS exposes reserved ports via DescribeContainerInstances'
// remainingResources instead); this is purely gopherstack's internal
// placement-bookkeeping, persisted additively so reservations survive a
// restart instead of going stale.
AllocatedPorts map[string]bool `json:"allocatedPorts,omitempty"`
// RegisteredResources is the capacity the instance reported at registration; empty (legacy) means unmetered.
RegisteredResources []Resource `json:"registeredResources,omitempty"`
// RemainingResources is derived on read from RegisteredResources and the instance's live tasks.
RemainingResources []Resource `json:"-"`
VersionInfo *VersionInfo `json:"versionInfo,omitempty"`
ContainerInstanceArn string `json:"containerInstanceArn"`
EC2InstanceID string `json:"ec2InstanceId"`
ClusterArn string `json:"clusterArn"`
Status string `json:"status"`
AgentUpdateStatus string `json:"agentUpdateStatus,omitempty"`
// ManagedBy names the capacity provider whose scaler registered this instance.
ManagedBy string `json:"managedBy,omitempty"`
// Attributes is derived from the cluster attribute table on read.
Attributes []Attribute `json:"-"`
Version int64 `json:"version"`
RunningTasksCount int `json:"runningTasksCount"`
PendingTasksCount int `json:"pendingTasksCount"`
AgentConnected bool `json:"agentConnected"`
}
ContainerInstance represents a registered ECS container instance.
type ContainerInstanceDetails ¶
type ContainerInstanceDetails struct {
VersionInfo *VersionInfo
ManagedBy string
Resources []Resource
Attributes []Attribute
Tags []Tag
}
ContainerInstanceDetails carries the optional RegisterContainerInstance members.
type ContainerMetadata ¶
type ContainerMetadata struct {
Limits metadataLimits `json:"Limits"`
Labels map[string]string `json:"Labels"`
ExitCode *int `json:"ExitCode,omitempty"`
DockerID string `json:"DockerId"`
Name string `json:"Name"`
DockerName string `json:"DockerName"`
Image string `json:"Image"`
ImageID string `json:"ImageID,omitempty"`
DesiredStatus string `json:"DesiredStatus"`
KnownStatus string `json:"KnownStatus"`
CreatedAt string `json:"CreatedAt,omitempty"`
StartedAt string `json:"StartedAt,omitempty"`
Type string `json:"Type"`
ContainerARN string `json:"ContainerARN,omitempty"`
LogDriver string `json:"LogDriver,omitempty"`
LogOptions map[string]string `json:"LogOptions,omitempty"`
Networks []metadataNetwork `json:"Networks,omitempty"`
Ports []metadataPort `json:"Ports,omitempty"`
}
ContainerMetadata is the task metadata v4 container document.
type ContainerOverride ¶
type ContainerOverride struct {
CPU *int `json:"cpu,omitempty"`
Memory *int `json:"memory,omitempty"`
Name string `json:"name"`
Command []string `json:"command,omitempty"`
Environment []KeyValuePair `json:"environment,omitempty"`
Secrets []SecretReference `json:"secrets,omitempty"`
}
ContainerOverride represents a container override for a task.
type ContainerStateChangeItem ¶
type ContainerStateChangeItem struct {
ExitCode *int `json:"exitCode,omitempty"`
ContainerName string `json:"containerName,omitempty"`
ImageDigest string `json:"imageDigest,omitempty"`
Reason string `json:"reason,omitempty"`
RuntimeID string `json:"runtimeId,omitempty"`
NetworkBindings []NetworkBinding `json:"networkBindings,omitempty"`
}
ContainerStateChangeItem reports a status transition for a single container within a SubmitTaskStateChange call.
type CreateCapacityProviderInput ¶
type CreateCapacityProviderInput struct {
Name string
AutoScalingGroupProvider *AutoScalingGroupProvider
Tags []Tag
}
CreateCapacityProviderInput holds input for CreateCapacityProvider.
type CreateClusterInput ¶
type CreateClusterInput struct {
ServiceConnectDefaults *ClusterServiceConnectDefaults
Configuration *ClusterConfiguration
ClusterName string
Settings []ClusterSetting
CapacityProviders []string
DefaultCapacityProviderStrategy []CapacityProviderStrategyItem
Tags []Tag
}
CreateClusterInput holds input for CreateCluster.
type CreateDaemonInput ¶
type CreateDaemonInput struct {
DeploymentConfiguration *DaemonDeploymentConfiguration
Critical *bool
DaemonName string
ClusterArn string
DaemonTaskDefinitionArn string
PropagateTags string
CapacityProviderArns []string
Tags []Tag
EnableECSManagedTags bool
EnableExecuteCommand bool
}
CreateDaemonInput holds input for CreateDaemon.
type CreateExpressGatewayServiceInput ¶
type CreateExpressGatewayServiceInput struct {
NetworkConfiguration *ExpressGatewayServiceNetworkConfiguration
PrimaryContainer *ExpressGatewayContainer
ScalingTarget *ExpressGatewayScalingTarget
ExecutionRoleArn string
InfrastructureRoleArn string
Cluster string
ServiceName string
CPU string
Memory string
HealthCheckPath string
TaskDefinitionArn string
TaskRoleArn string
Tags []Tag
}
CreateExpressGatewayServiceInput holds input for CreateExpressGatewayService.
type CreateServiceInput ¶
type CreateServiceInput struct {
DeploymentConfiguration *DeploymentConfiguration `json:"deploymentConfiguration,omitempty"`
DeploymentController *DeploymentController `json:"deploymentController,omitempty"`
NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
ServiceConnectConfiguration *ServiceConnectConfiguration `json:"serviceConnectConfiguration,omitempty"`
HealthCheckGracePeriodSeconds *int `json:"healthCheckGracePeriodSeconds,omitempty"`
Monitoring *MonitoringConfiguration `json:"monitoring,omitempty"`
ServiceName string `json:"serviceName"`
Cluster string `json:"cluster,omitempty"`
TaskDefinition string `json:"taskDefinition"`
LaunchType string `json:"launchType,omitempty"`
SchedulingStrategy string `json:"schedulingStrategy,omitempty"`
PropagateTags string `json:"propagateTags,omitempty"`
AvailabilityZoneRebalancing string `json:"availabilityZoneRebalancing,omitempty"`
PlatformVersion string `json:"platformVersion,omitempty"`
RoleArn string `json:"roleArn,omitempty"`
ClientToken string `json:"clientToken,omitempty"`
Tags []Tag `json:"tags,omitempty"`
LoadBalancers []LoadBalancer `json:"loadBalancers,omitempty"`
ServiceRegistries []ServiceRegistry `json:"serviceRegistries,omitempty"`
CapacityProviderStrategy []CapacityProviderStrategyItem `json:"capacityProviderStrategy,omitempty"`
PlacementConstraints []PlacementConstraint `json:"placementConstraints,omitempty"`
PlacementStrategy []PlacementStrategy `json:"placementStrategy,omitempty"`
DesiredCount int `json:"desiredCount"`
EnableExecuteCommand bool `json:"enableExecuteCommand,omitempty"`
EnableECSManagedTags bool `json:"enableECSManagedTags,omitempty"`
}
CreateServiceInput holds input for CreateService.
type CreateTaskSetInput ¶
type CreateTaskSetInput struct {
NetworkConfiguration *NetworkConfiguration
Scale *TaskSetScale
Cluster string
Service string
TaskDefinition string
ExternalID string
PlatformVersion string
LaunchType string
LoadBalancers []LoadBalancer
ServiceRegistries []ServiceRegistry
CapacityProviderStrategy []CapacityProviderStrategyItem
Tags []Tag
}
CreateTaskSetInput holds input for CreateTaskSet.
type Daemon ¶
type Daemon struct {
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeploymentConfiguration *DaemonDeploymentConfiguration `json:"deploymentConfiguration,omitempty"`
DeploymentArn string `json:"deploymentArn,omitempty"`
ClusterArn string `json:"clusterArn"`
DaemonTaskDefinitionArn string `json:"daemonTaskDefinitionArn"`
DaemonName string `json:"daemonName"`
CurrentDaemonRevisionArn string `json:"currentDaemonRevisionArn,omitempty"`
Status string `json:"status"`
DaemonArn string `json:"daemonArn"`
PropagateTags string `json:"propagateTags,omitempty"`
CapacityProviderArns []string `json:"capacityProviderArns,omitempty"`
Tags []Tag `json:"tags,omitempty"`
EnableECSManagedTags bool `json:"enableECSManagedTags,omitempty"`
EnableExecuteCommand bool `json:"enableExecuteCommand,omitempty"`
Critical bool `json:"critical"`
}
Daemon represents an Amazon ECS Managed Daemon.
type DaemonAlarmConfiguration ¶
type DaemonAlarmConfiguration struct {
AlarmNames []string `json:"alarmNames,omitempty"`
Enable bool `json:"enable,omitempty"`
}
DaemonAlarmConfiguration configures CloudWatch alarm-based rollback for a daemon deployment.
type DaemonContainerDefinition ¶
type DaemonContainerDefinition struct {
HealthCheck *HealthCheck `json:"healthCheck,omitempty"`
LogConfiguration *LogConfiguration `json:"logConfiguration,omitempty"`
RepositoryCredentials *RepositoryCredentials `json:"repositoryCredentials,omitempty"`
FirelensConfiguration *FirelensConfiguration `json:"firelensConfiguration,omitempty"`
Name string `json:"name"`
Image string `json:"image"`
WorkingDirectory string `json:"workingDirectory,omitempty"`
User string `json:"user,omitempty"`
Command []string `json:"command,omitempty"`
EntryPoint []string `json:"entryPoint,omitempty"`
Environment []KeyValuePair `json:"environment,omitempty"`
EnvironmentFiles []EnvironmentFile `json:"environmentFiles,omitempty"`
Secrets []SecretReference `json:"secrets,omitempty"`
MountPoints []MountPoint `json:"mountPoints,omitempty"`
DependsOn []ContainerDependency `json:"dependsOn,omitempty"`
CPU int `json:"cpu,omitempty"`
Memory int `json:"memory,omitempty"`
MemoryReservation int `json:"memoryReservation,omitempty"`
StartTimeout int `json:"startTimeout,omitempty"`
StopTimeout int `json:"stopTimeout,omitempty"`
Essential bool `json:"essential"`
Interactive bool `json:"interactive,omitempty"`
PseudoTerminal bool `json:"pseudoTerminal,omitempty"`
Privileged bool `json:"privileged,omitempty"`
ReadonlyRootFilesystem bool `json:"readonlyRootFilesystem,omitempty"`
}
DaemonContainerDefinition is a container definition within a daemon task definition.
type DaemonDeployment ¶
type DaemonDeployment struct {
CreatedAt time.Time `json:"createdAt"`
StartedAt *time.Time `json:"startedAt,omitempty"`
FinishedAt *time.Time `json:"finishedAt,omitempty"`
DeploymentConfiguration *DaemonDeploymentConfiguration `json:"deploymentConfiguration,omitempty"`
DaemonDeploymentArn string `json:"daemonDeploymentArn"`
DaemonArn string `json:"daemonArn"`
ClusterArn string `json:"clusterArn"`
Status string `json:"status"`
StatusReason string `json:"statusReason,omitempty"`
TargetDaemonRevisionArn string `json:"targetDaemonRevisionArn,omitempty"`
}
DaemonDeployment represents the progressive rollout of a daemon change.
type DaemonDeploymentConfiguration ¶
type DaemonDeploymentConfiguration struct {
Alarms *DaemonAlarmConfiguration `json:"alarms,omitempty"`
BakeTimeInMinutes int `json:"bakeTimeInMinutes,omitempty"`
DrainPercent float64 `json:"drainPercent,omitempty"`
}
DaemonDeploymentConfiguration controls how a daemon rolls out updates.
type DaemonRevision ¶
type DaemonRevision struct {
CreatedAt time.Time `json:"createdAt"`
ClusterArn string `json:"clusterArn,omitempty"`
DaemonArn string `json:"daemonArn"`
DaemonRevisionArn string `json:"daemonRevisionArn"`
DaemonTaskDefinitionArn string `json:"daemonTaskDefinitionArn"`
PropagateTags string `json:"propagateTags,omitempty"`
EnableECSManagedTags bool `json:"enableECSManagedTags"`
EnableExecuteCommand bool `json:"enableExecuteCommand"`
Critical bool `json:"critical"`
}
DaemonRevision is a snapshot of a daemon's configuration at deployment time.
type DaemonTaskDefinition ¶
type DaemonTaskDefinition struct {
RegisteredAt time.Time `json:"registeredAt"`
DeleteRequestedAt *time.Time `json:"deleteRequestedAt,omitempty"`
DaemonTaskDefinitionArn string `json:"daemonTaskDefinitionArn"`
Family string `json:"family"`
CPU string `json:"cpu,omitempty"`
Memory string `json:"memory,omitempty"`
ExecutionRoleArn string `json:"executionRoleArn,omitempty"`
TaskRoleArn string `json:"taskRoleArn,omitempty"`
RegisteredBy string `json:"registeredBy,omitempty"`
Status string `json:"status"`
IpcMode string `json:"ipcMode,omitempty"`
PidMode string `json:"pidMode,omitempty"`
ContainerDefinitions []DaemonContainerDefinition `json:"containerDefinitions"`
Volumes []DaemonVolume `json:"volumes,omitempty"`
Revision int `json:"revision"`
}
DaemonTaskDefinition is a template describing the containers that form a daemon.
type DaemonVolume ¶
type DaemonVolume struct {
Host *HostVolumeProperties `json:"host,omitempty"`
Name string `json:"name"`
}
DaemonVolume is a data volume definition for a daemon task.
type Deployment ¶
type Deployment struct {
CreatedAt *float64 `json:"createdAt,omitempty"`
UpdatedAt *float64 `json:"updatedAt,omitempty"`
ID string `json:"id"`
Status string `json:"status"`
TaskDefinition string `json:"taskDefinition"`
LaunchType string `json:"launchType,omitempty"`
PlatformVersion string `json:"platformVersion,omitempty"`
RolloutState string `json:"rolloutState,omitempty"`
RolloutStateReason string `json:"rolloutStateReason,omitempty"`
ServiceRevisionArn string `json:"serviceRevisionArn,omitempty"`
DesiredCount int `json:"desiredCount"`
PendingCount int `json:"pendingCount"`
RunningCount int `json:"runningCount"`
FailedTasks int `json:"failedTasks"`
// contains filtered or unexported fields
}
Deployment represents an active or completed deployment on an ECS service.
type DeploymentAlarms ¶
type DeploymentAlarms struct {
AlarmNames []string `json:"alarmNames"`
Enable bool `json:"enable"`
Rollback bool `json:"rollback"`
}
DeploymentAlarms configures CloudWatch alarm-based rollback for a service deployment.
type DeploymentCircuitBreaker ¶
type DeploymentCircuitBreaker struct {
Enable bool `json:"enable"`
Rollback bool `json:"rollback"`
}
DeploymentCircuitBreaker configures the deployment circuit breaker for a service.
type DeploymentConfiguration ¶
type DeploymentConfiguration struct {
DeploymentCircuitBreaker *DeploymentCircuitBreaker `json:"deploymentCircuitBreaker,omitempty"`
MinimumHealthyPercent *int `json:"minimumHealthyPercent,omitempty"`
MaximumPercent *int `json:"maximumPercent,omitempty"`
Alarms *DeploymentAlarms `json:"alarms,omitempty"`
BakeTimeInMinutes *int `json:"bakeTimeInMinutes,omitempty"`
CanaryConfiguration *CanaryConfiguration `json:"canaryConfiguration,omitempty"`
LinearConfiguration *LinearConfiguration `json:"linearConfiguration,omitempty"`
Strategy string `json:"strategy,omitempty"`
LifecycleHooks []DeploymentLifecycleHook `json:"lifecycleHooks,omitempty"`
}
DeploymentConfiguration holds deployment settings for a service. MinimumHealthyPercent and MaximumPercent default to the AWS values of 100 and 200.
type DeploymentController ¶
type DeploymentController struct {
Type string `json:"type"`
}
DeploymentController specifies the deployment controller type for a service.
type DeploymentLifecycleHook ¶
type DeploymentLifecycleHook struct {
HookDetails any `json:"hookDetails,omitempty"`
TimeoutConfiguration *DeploymentLifecycleHookTimeout `json:"timeoutConfiguration,omitempty"`
HookTargetArn string `json:"hookTargetArn,omitempty"`
RoleArn string `json:"roleArn,omitempty"`
TargetType string `json:"targetType,omitempty"`
LifecycleStages []string `json:"lifecycleStages,omitempty"`
}
DeploymentLifecycleHook mirrors types.DeploymentLifecycleHook.
type DeploymentLifecycleHookTimeout ¶
type DeploymentLifecycleHookTimeout struct {
TimeoutInMinutes *int `json:"timeoutInMinutes,omitempty"`
Action string `json:"action,omitempty"`
}
DeploymentLifecycleHookTimeout mirrors types.DeploymentLifecycleHookTimeoutConfiguration.
type EFSAuthorizationConfig ¶
type EFSAuthorizationConfig struct {
AccessPointID string `json:"accessPointId,omitempty"`
IAM string `json:"iam,omitempty"`
}
EFSAuthorizationConfig holds EFS authorization settings.
type EFSVolumeConfiguration ¶
type EFSVolumeConfiguration struct {
AuthorizationConfig *EFSAuthorizationConfig `json:"authorizationConfig,omitempty"`
FileSystemID string `json:"fileSystemId"`
RootDirectory string `json:"rootDirectory,omitempty"`
TransitEncryption string `json:"transitEncryption,omitempty"`
}
EFSVolumeConfiguration holds EFS-specific volume options.
type ELBTarget ¶
ELBTarget identifies a single ELBv2 target to register or deregister. For awsvpc-mode tasks, ID is the task's ENI private IP address and Port is the container port (ECS registers "ip" target-type targets for these, forwarding straight to the ENI -- the container and host port are the same address space). For bridge/host-mode EC2-launch-type tasks, ID is instead the container instance's EC2 instance ID and Port is the allocated host port (ECS registers "instance" target-type targets for these -- see host_ports.go and https://docs.aws.amazon.com/elasticloadbalancing/latest/application/target-group-register-targets.html on target-group targetType "instance" taking an instance ID vs "ip" taking an IP address; services/elbv2 already models both).
type ELBv2TargetHealthReader ¶
type ELBv2TargetHealthReader interface {
// TargetHealthState returns the target's health state; ok is false when the target is not registered.
TargetHealthState(ctx context.Context, targetGroupARN string, target ELBTarget) (state string, ok bool)
}
ELBv2TargetHealthReader is an optional extension of ELBv2TargetRegistrar: when the wired registrar implements it, tasks whose ELBv2 target is unhealthy are stopped so the service scheduler replaces them.
type ELBv2TargetRegistrar ¶
type ELBv2TargetRegistrar interface {
// RegisterTargets registers targets with the given target group.
RegisterTargets(ctx context.Context, targetGroupARN string, targets []ELBTarget) error
// DeregisterTargets deregisters targets from the given target group.
DeregisterTargets(ctx context.Context, targetGroupARN string, targets []ELBTarget) error
}
ELBv2TargetRegistrar lets the ECS backend register/deregister real ELBv2 targets as tasks belonging to a service with LoadBalancers reach or leave RUNNING, so ELBv2 DescribeTargetHealth reflects ECS-managed tasks instead of Service.LoadBalancers being stored and echoed with no effect. When no registrar is configured (the default), behavior is unchanged from before this feature existed.
type EnvironmentFile ¶
type EnvironmentFile struct {
Type string `json:"type"` // always "s3"
Value string `json:"value"` // S3 ARN
}
EnvironmentFile specifies an S3 ARN containing environment variables for a container.
type EphemeralStorage ¶
type EphemeralStorage struct {
SizeInGiB int `json:"sizeInGiB"`
}
EphemeralStorage specifies the amount of ephemeral storage for a Fargate task.
type EventPublisher ¶
type EventPublisher interface {
PublishEvent(ctx context.Context, source, detailType string, resources []string, detail string)
}
EventPublisher puts events on the default event bus.
type ExecuteCommandConfiguration ¶
type ExecuteCommandConfiguration struct {
LogConfiguration *ExecuteCommandLogConfiguration `json:"logConfiguration,omitempty"`
KmsKeyID string `json:"kmsKeyId,omitempty"`
Logging string `json:"logging,omitempty"`
}
ExecuteCommandConfiguration configures ECS Exec for a cluster.
type ExecuteCommandLogConfiguration ¶
type ExecuteCommandLogConfiguration struct {
CloudWatchLogGroupName string `json:"cloudWatchLogGroupName,omitempty"`
S3BucketName string `json:"s3BucketName,omitempty"`
S3KeyPrefix string `json:"s3KeyPrefix,omitempty"`
CloudWatchEncryptionEnabled bool `json:"cloudWatchEncryptionEnabled,omitempty"`
S3EncryptionEnabled bool `json:"s3EncryptionEnabled,omitempty"`
}
ExecuteCommandLogConfiguration is the OVERRIDE log destination for ECS Exec.
type ExecuteCommandOutput ¶
type ExecuteCommandOutput struct {
Session Session `json:"session"`
ClusterArn string `json:"clusterArn"`
ContainerArn string `json:"containerArn"`
ContainerName string `json:"containerName"`
TaskArn string `json:"taskArn"`
Interactive bool `json:"interactive"`
}
ExecuteCommandOutput is the output from ExecuteCommand.
type ExpressGatewayContainer ¶ added in v1.2.0
type ExpressGatewayContainer struct {
AwsLogsConfiguration *ExpressGatewayServiceAwsLogsConfiguration `json:"awsLogsConfiguration,omitempty"`
RepositoryCredentials *ExpressGatewayRepositoryCredentials `json:"repositoryCredentials,omitempty"`
ContainerPort *int `json:"containerPort,omitempty"`
Image string `json:"image"`
Command []string `json:"command,omitempty"`
Environment []KeyValuePair `json:"environment,omitempty"`
Secrets []SecretReference `json:"secrets,omitempty"`
}
ExpressGatewayContainer is the primary container configuration for an Express service revision. Mirrors types.ExpressGatewayContainer.
type ExpressGatewayRepositoryCredentials ¶ added in v1.2.0
type ExpressGatewayRepositoryCredentials struct {
CredentialsParameter string `json:"credentialsParameter"`
}
ExpressGatewayRepositoryCredentials references the private-registry credentials for an Express service's primary container image. Mirrors types.ExpressGatewayRepositoryCredentials.
type ExpressGatewayScalingTarget ¶ added in v1.2.0
type ExpressGatewayScalingTarget struct {
AutoScalingTargetValue *int `json:"autoScalingTargetValue,omitempty"`
MaxTaskCount *int `json:"maxTaskCount,omitempty"`
MinTaskCount *int `json:"minTaskCount,omitempty"`
AutoScalingMetric string `json:"autoScalingMetric,omitempty"`
}
ExpressGatewayScalingTarget is the auto-scaling configuration for an Express service revision. Mirrors types.ExpressGatewayScalingTarget.
type ExpressGatewayService ¶
type ExpressGatewayService struct {
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
ServiceArn string `json:"serviceArn"`
ServiceName string `json:"serviceName"`
Cluster string `json:"cluster"`
Status string `json:"status"`
StatusReason string `json:"statusReason,omitempty"`
InfrastructureRoleArn string `json:"infrastructureRoleArn"`
CurrentDeployment string `json:"currentDeployment,omitempty"`
ActiveConfigurations []ExpressGatewayServiceConfiguration `json:"activeConfigurations,omitempty"`
Tags []Tag `json:"tags,omitempty"`
}
ExpressGatewayService represents an ECS express gateway service. Mirrors types.ECSExpressGatewayService. Note ExecutionRoleArn/TaskRoleArn/CPU/ Memory/etc. are NOT top-level fields on the real shape -- they live on each entry of ActiveConfigurations (see ExpressGatewayServiceConfiguration); this struct previously invented a top-level ExecutionRoleArn field that does not exist on the wire.
type ExpressGatewayServiceAwsLogsConfiguration ¶ added in v1.2.0
type ExpressGatewayServiceAwsLogsConfiguration struct {
LogGroup string `json:"logGroup"`
LogStreamPrefix string `json:"logStreamPrefix"`
}
ExpressGatewayServiceAwsLogsConfiguration is the CloudWatch Logs configuration for an Express service's primary container. Mirrors types.ExpressGatewayServiceAwsLogsConfiguration.
type ExpressGatewayServiceConfiguration ¶ added in v1.2.0
type ExpressGatewayServiceConfiguration struct {
CreatedAt time.Time `json:"createdAt"`
NetworkConfiguration *ExpressGatewayServiceNetworkConfiguration `json:"networkConfiguration,omitempty"`
PrimaryContainer *ExpressGatewayContainer `json:"primaryContainer,omitempty"`
ScalingTarget *ExpressGatewayScalingTarget `json:"scalingTarget,omitempty"`
ServiceRevisionArn string `json:"serviceRevisionArn,omitempty"`
CPU string `json:"cpu,omitempty"`
Memory string `json:"memory,omitempty"`
HealthCheckPath string `json:"healthCheckPath,omitempty"`
ExecutionRoleArn string `json:"executionRoleArn,omitempty"`
TaskRoleArn string `json:"taskRoleArn,omitempty"`
TaskDefinitionArn string `json:"taskDefinitionArn,omitempty"`
IngressPaths []IngressPathSummary `json:"ingressPaths,omitempty"`
}
ExpressGatewayServiceConfiguration is a single service-revision snapshot of an Express service's compute/network/scaling configuration. Every Create/UpdateExpressGatewayService call produces one of these, appended to (or replacing, per real AWS "one active revision" semantics -- see CreateExpressGatewayService/UpdateExpressGatewayService in express_gateway.go) ExpressGatewayService.ActiveConfigurations. Mirrors types.ExpressGatewayServiceConfiguration.
type ExpressGatewayServiceNetworkConfiguration ¶ added in v1.2.0
type ExpressGatewayServiceNetworkConfiguration struct {
SecurityGroups []string `json:"securityGroups,omitempty"`
Subnets []string `json:"subnets,omitempty"`
}
ExpressGatewayServiceNetworkConfiguration is the VPC network configuration for an Express service's tasks. Mirrors types.ExpressGatewayServiceNetworkConfiguration.
type ExpressGatewayServiceStatus ¶ added in v1.2.0
type ExpressGatewayServiceStatus struct {
StatusCode string `json:"statusCode,omitempty"`
StatusReason string `json:"statusReason,omitempty"`
}
ExpressGatewayServiceStatus is the current status of an Express service. Mirrors types.ExpressGatewayServiceStatus (StatusCode + StatusReason), which real AWS nests as an object rather than a bare status string.
type Failure ¶
type Failure struct {
Arn string `json:"arn,omitempty"`
Detail string `json:"detail,omitempty"`
Reason string `json:"reason,omitempty"`
}
Failure represents a resource-level failure returned in batch operations.
type FirelensConfiguration ¶
type FirelensConfiguration struct {
Options map[string]string `json:"options,omitempty"`
Type string `json:"type"`
}
FirelensConfiguration specifies FireLens routing for container logs.
type Handler ¶
type Handler struct {
Backend Backend
// contains filtered or unexported fields
}
Handler is the Echo HTTP handler for ECS operations.
func (*Handler) BackendFor ¶
BackendFor returns the backend serving region: the home backend, or the sibling for any other region (built on first use).
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this ECS instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) EnableRegions ¶
EnableRegions makes h serve every other region through lazily built per-region siblings, each with its own task runner, reconciler and janitor running under ctx.
func (*Handler) ExecuteFISAction ¶
ExecuteFISAction executes a FIS action against resolved ECS targets.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the ECS action from the request.
func (*Handler) ExtractResource ¶
ExtractResource extracts the primary resource identifier from the request.
func (*Handler) FISActions ¶
func (h *Handler) FISActions() []service.FISActionDefinition
FISActions returns the FIS action definitions that the ECS service supports.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported ECS operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for ECS requests.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority for ECS.
func (*Handler) Purge ¶
Purge implements service.Purgeable by removing all ECS resources older than cutoff.
func (*Handler) RegionBackends ¶
RegionBackends returns the home backend followed by every sibling built so far.
func (*Handler) RegionHandler ¶
RegionHandler returns the handler serving region: h itself for the home region, else its sibling.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches ECS requests via X-Amz-Target.
func (*Handler) ServeTaskCredentials ¶
ServeTaskCredentials serves the task-role credentials endpoint (container credential provider JSON).
func (*Handler) ServeTaskMetadata ¶
ServeTaskMetadata serves the task metadata endpoint v4: /, /task, /taskWithTags, /stats and /task/stats.
func (*Handler) SetCWLogsFactory ¶
func (h *Handler) SetCWLogsFactory(f func(region string) CWLogsBackend)
SetCWLogsFactory sets how sibling regions resolve their CloudWatch Logs sink.
func (*Handler) SetMetricEmitter ¶
SetMetricEmitter installs e on the home backend and every region sibling built so far.
type HealthCheck ¶
type HealthCheck struct {
Command []string `json:"command"`
Interval int `json:"interval,omitempty"`
Timeout int `json:"timeout,omitempty"`
Retries int `json:"retries,omitempty"`
StartPeriod int `json:"startPeriod,omitempty"`
}
HealthCheck configures the container health check.
type HostVolumeProperties ¶
type HostVolumeProperties struct {
SourcePath string `json:"sourcePath,omitempty"`
}
HostVolumeProperties holds host-bind volume path.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend stores ECS state in memory.
Field ordering is optimised for pointer-byte alignment (govet fieldalignment); keep new fields grouped with their kind rather than by logical concern.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string, runner TaskRunner) *InMemoryBackend
NewInMemoryBackend creates a new InMemoryBackend.
func (*InMemoryBackend) AddAccountSettingInternal ¶
func (b *InMemoryBackend) AddAccountSettingInternal(_ string, setting *AccountSetting)
AddAccountSettingInternal adds an account setting directly (seed helper for tests). key is unused now that the store.Table derives its own key from setting's fields (accountSettingsKeyFn); retained in the signature so existing call sites (which always pass a key consistent with accountSettingKey(setting.Name, setting.PrincipalArn)) do not need updating.
func (*InMemoryBackend) AddAttributeInternal ¶
func (b *InMemoryBackend) AddAttributeInternal(cluster string, attr *Attribute)
AddAttributeInternal adds an attribute directly (seed helper for tests).
func (*InMemoryBackend) AddCapacityProviderInternal ¶
func (b *InMemoryBackend) AddCapacityProviderInternal(cp *CapacityProvider)
AddCapacityProviderInternal adds a capacity provider directly (seed helper for tests).
func (*InMemoryBackend) AddServiceDeploymentInternal ¶
func (b *InMemoryBackend) AddServiceDeploymentInternal(sd *ServiceDeployment)
AddServiceDeploymentInternal adds a service deployment directly (seed helper for tests).
func (*InMemoryBackend) ContinueServiceDeployment ¶
func (b *InMemoryBackend) ContinueServiceDeployment( serviceDeploymentArn, hookID, action string, ) (*ServiceDeployment, error)
ContinueServiceDeployment continues or rolls back a service deployment paused at a PAUSE lifecycle hook.
func (*InMemoryBackend) CountRunningTasksForService ¶
func (b *InMemoryBackend) CountRunningTasksForService(clusterName, serviceName string) int
CountRunningTasksForService counts running tasks for a service on a cluster.
func (*InMemoryBackend) CreateCapacityProvider ¶
func (b *InMemoryBackend) CreateCapacityProvider( input CreateCapacityProviderInput, ) (*CapacityProvider, error)
CreateCapacityProvider creates a new capacity provider.
func (*InMemoryBackend) CreateCluster ¶
func (b *InMemoryBackend) CreateCluster(input CreateClusterInput) (*Cluster, error)
CreateCluster creates a new ECS cluster.
func (*InMemoryBackend) CreateDaemon ¶
func (b *InMemoryBackend) CreateDaemon(input CreateDaemonInput) (*Daemon, error)
CreateDaemon creates a new daemon and its initial deployment.
func (*InMemoryBackend) CreateExpressGatewayService ¶
func (b *InMemoryBackend) CreateExpressGatewayService( input CreateExpressGatewayServiceInput, ) (*ExpressGatewayService, error)
CreateExpressGatewayService creates a new express gateway service.
func (*InMemoryBackend) CreateService ¶
func (b *InMemoryBackend) CreateService(input CreateServiceInput) (*Service, error)
CreateService creates a new ECS service.
func (*InMemoryBackend) CreateTaskSet ¶
func (b *InMemoryBackend) CreateTaskSet(input CreateTaskSetInput) (*TaskSet, error)
CreateTaskSet creates a task set within a service.
func (*InMemoryBackend) DeleteAccountSetting ¶
func (b *InMemoryBackend) DeleteAccountSetting(name, principalArn string) (*AccountSetting, error)
DeleteAccountSetting deletes an account setting for a principal.
func (*InMemoryBackend) DeleteAttributes ¶
func (b *InMemoryBackend) DeleteAttributes(cluster string, attrs []Attribute) ([]Attribute, error)
DeleteAttributes deletes custom attributes from ECS resources.
func (*InMemoryBackend) DeleteCapacityProvider ¶
func (b *InMemoryBackend) DeleteCapacityProvider(nameOrArn string) (*CapacityProvider, error)
DeleteCapacityProvider deletes a capacity provider by name or ARN.
func (*InMemoryBackend) DeleteCluster ¶
func (b *InMemoryBackend) DeleteCluster(clusterName string) (*Cluster, error)
DeleteCluster removes a cluster. Matching real AWS, this fails with a ClusterContains*Exception if the cluster still has services, active tasks, or registered container instances -- it does NOT cascade-delete them.
func (*InMemoryBackend) DeleteDaemon ¶
func (b *InMemoryBackend) DeleteDaemon(daemonArn string) (*Daemon, error)
DeleteDaemon deletes a daemon. The returned snapshot reflects the DELETE_IN_PROGRESS transitional status returned synchronously by real AWS.
func (*InMemoryBackend) DeleteDaemonTaskDefinition ¶
func (b *InMemoryBackend) DeleteDaemonTaskDefinition(familyOrArn string) (*DaemonTaskDefinition, error)
DeleteDaemonTaskDefinition marks a daemon task definition revision as DELETED.
func (*InMemoryBackend) DeleteExpressGatewayService ¶
func (b *InMemoryBackend) DeleteExpressGatewayService( serviceArn string, ) (*ExpressGatewayService, error)
DeleteExpressGatewayService deletes an express gateway service by ARN.
func (*InMemoryBackend) DeleteService ¶
func (b *InMemoryBackend) DeleteService(cluster, serviceName string, force ...bool) (*Service, error)
DeleteService removes a service from the cluster.
func (*InMemoryBackend) DeleteTaskDefinitions ¶
func (b *InMemoryBackend) DeleteTaskDefinitions( taskDefinitionArns []string, ) ([]TaskDefinition, []Failure, error)
DeleteTaskDefinitions deletes task definitions that are INACTIVE. Definitions that are not INACTIVE are reported as failures.
func (*InMemoryBackend) DeleteTaskSet ¶
func (b *InMemoryBackend) DeleteTaskSet(cluster, service, taskSet string) (*TaskSet, error)
DeleteTaskSet removes a task set.
func (*InMemoryBackend) DeregisterContainerInstance ¶
func (b *InMemoryBackend) DeregisterContainerInstance( cluster, containerInstance string, force bool, ) (*ContainerInstance, error)
DeregisterContainerInstance removes a container instance from a cluster.
func (*InMemoryBackend) DeregisterTaskDefinition ¶
func (b *InMemoryBackend) DeregisterTaskDefinition( taskDefinitionArn string, ) (*TaskDefinition, error)
DeregisterTaskDefinition marks a task definition revision as INACTIVE.
func (*InMemoryBackend) DescribeCapacityProviders ¶
func (b *InMemoryBackend) DescribeCapacityProviders( nameOrArns []string, cluster string, ) ([]CapacityProvider, []Failure, error)
DescribeCapacityProviders returns capacity providers, optionally filtered by name/ARN and/or by cluster association. Names/ARNs that don't resolve to a known or built-in capacity provider are reported in the returned Failures slice (reason MISSING), matching AWS's DescribeCapacityProviders behavior of partial success rather than failing the whole call.
When cluster is non-empty, only capacity providers associated with that cluster (via CreateCluster/UpdateCluster/PutClusterCapacityProviders) are considered, matching AWS's documented Cluster filter parameter. An unknown cluster name yields an empty result (not an error), consistent with AWS's filter semantics for this parameter.
func (*InMemoryBackend) DescribeClusters ¶
func (b *InMemoryBackend) DescribeClusters(clusterNames []string) ([]Cluster, []Failure, error)
DescribeClusters returns cluster metadata. Per DescribeClustersInput.Clusters ("If you do not specify a cluster, the default cluster is assumed."), an empty clusterNames describes only the "default" cluster -- unlike ListClusters, a different operation whose own input documents no such default-substitution and legitimately returns everything. Unknown cluster names are returned as failures, not errors, matching AWS behaviour.
func (*InMemoryBackend) DescribeContainerInstances ¶
func (b *InMemoryBackend) DescribeContainerInstances( cluster string, containerInstances []string, ) ([]ContainerInstance, []Failure, error)
DescribeContainerInstances returns container instances for a cluster.
func (*InMemoryBackend) DescribeDaemon ¶
func (b *InMemoryBackend) DescribeDaemon(daemonArn string) (*Daemon, error)
DescribeDaemon returns the full detail of a daemon.
func (*InMemoryBackend) DescribeDaemonDeployments ¶
func (b *InMemoryBackend) DescribeDaemonDeployments(arns []string) ([]DaemonDeployment, []Failure, error)
DescribeDaemonDeployments returns daemon deployments for the given ARNs, reporting a Failure for each ARN that does not exist.
func (*InMemoryBackend) DescribeDaemonRevisions ¶
func (b *InMemoryBackend) DescribeDaemonRevisions(arns []string) ([]DaemonRevision, []Failure, error)
DescribeDaemonRevisions returns daemon revisions for the given ARNs, reporting a Failure for each ARN that does not exist.
func (*InMemoryBackend) DescribeDaemonTaskDefinition ¶
func (b *InMemoryBackend) DescribeDaemonTaskDefinition(familyOrArn string) (*DaemonTaskDefinition, error)
DescribeDaemonTaskDefinition returns a daemon task definition by family, ARN, or family:revision.
func (*InMemoryBackend) DescribeExpressGatewayService ¶
func (b *InMemoryBackend) DescribeExpressGatewayService( serviceArn string, ) (*ExpressGatewayService, error)
DescribeExpressGatewayService returns an express gateway service by ARN.
func (*InMemoryBackend) DescribeServiceDeployments ¶
func (b *InMemoryBackend) DescribeServiceDeployments( serviceDeploymentArns []string, ) ([]ServiceDeployment, []Failure, error)
DescribeServiceDeployments returns service deployments by ARN.
func (*InMemoryBackend) DescribeServiceRevisions ¶
func (b *InMemoryBackend) DescribeServiceRevisions(arns []string) ([]ServiceRevision, []Failure)
DescribeServiceRevisions returns the service revisions captured by past and current deployments across all clusters that match the given ARNs. Unknown ARNs are reported as failures, matching AWS behaviour for batch describes.
func (*InMemoryBackend) DescribeServices ¶
func (b *InMemoryBackend) DescribeServices( cluster string, serviceNames []string, ) ([]Service, []Failure, error)
DescribeServices returns services for the given cluster, optionally filtered by name. Unknown service names are returned as failures, not errors, matching AWS behaviour.
func (*InMemoryBackend) DescribeTaskDefinition ¶
func (b *InMemoryBackend) DescribeTaskDefinition(familyOrArn string) (*TaskDefinition, error)
DescribeTaskDefinition returns the latest revision of a task definition by family or ARN.
func (*InMemoryBackend) DescribeTaskSets ¶
func (b *InMemoryBackend) DescribeTaskSets( cluster, service string, taskSets []string, ) ([]TaskSet, []Failure, error)
DescribeTaskSets returns task sets for a service. Task sets named in the taskSets filter that don't exist are reported per-item in the returned failures, matching every sibling batch-describe op (DescribeClusters, DescribeServices, DescribeTasks) rather than failing the whole call.
func (*InMemoryBackend) DescribeTasks ¶
func (b *InMemoryBackend) DescribeTasks( cluster string, taskArns []string, ) ([]Task, []Failure, error)
DescribeTasks returns tasks on a given cluster, optionally filtered by ARN. Unknown task ARNs are returned as failures, not errors, matching AWS behaviour.
func (*InMemoryBackend) DiscoverPollEndpoint ¶
func (b *InMemoryBackend) DiscoverPollEndpoint() (string, string, string)
DiscoverPollEndpoint returns the ECS agent poll, Service Connect, and telemetry endpoints for the configured region. Real ECS agents use this to discover which regional endpoint to poll for task state updates.
func (*InMemoryBackend) EndpointURL ¶
func (b *InMemoryBackend) EndpointURL() string
EndpointURL returns the base URL task containers use to reach this server.
func (*InMemoryBackend) ExecuteCommand ¶
func (b *InMemoryBackend) ExecuteCommand( cluster, task, container, command string, interactive bool, ) (*ExecuteCommandOutput, error)
ExecuteCommand simulates an ECS Exec session.
func (*InMemoryBackend) ExpressServicesInCluster ¶
func (b *InMemoryBackend) ExpressServicesInCluster(cluster string, names []string) []Service
ExpressServicesInCluster returns the express gateway services in cluster as ECS services, filtered to names (names or ARNs) when non-empty.
func (*InMemoryBackend) GetRegion ¶
func (b *InMemoryBackend) GetRegion() string
GetRegion returns the AWS region this backend is configured for.
func (*InMemoryBackend) GetTaskProtection ¶
func (b *InMemoryBackend) GetTaskProtection( cluster string, taskArns []string, ) ([]TaskProtection, []Failure, error)
GetTaskProtection returns the protection state for the given tasks on a cluster.
func (*InMemoryBackend) ListAccountSettings ¶
func (b *InMemoryBackend) ListAccountSettings( name, principalArn string, effectiveSettings bool, ) ([]AccountSetting, error)
ListAccountSettings returns all account settings, optionally filtered by name and principal.
ListAccountSettingsInput.EffectiveSettings's own doc comment: "If true, the account settings for the root user or the default setting for the principalArn are returned. If false, the account settings for the principalArn are returned if they're set. Otherwise, no account settings are returned." When true, any setting name for which principalArn has no explicit value falls back to the account-level default (the setting stored with an empty PrincipalArn, as PutAccountSettingDefault does).
func (*InMemoryBackend) ListAttributes ¶
func (b *InMemoryBackend) ListAttributes( cluster, targetType, attributeName, targetID string, ) ([]Attribute, error)
ListAttributes returns attributes for resources in a cluster, optionally filtered by attribute name, target type, and target ID.
func (*InMemoryBackend) ListClusters ¶
func (b *InMemoryBackend) ListClusters() ([]Cluster, error)
ListClusters returns all clusters.
func (*InMemoryBackend) ListContainerInstances ¶
func (b *InMemoryBackend) ListContainerInstances(cluster, status string) ([]string, error)
ListContainerInstances returns container instance ARNs for a cluster.
func (*InMemoryBackend) ListDaemonDeployments ¶
func (b *InMemoryBackend) ListDaemonDeployments(input ListDaemonDeploymentsInput) ([]DaemonDeployment, error)
ListDaemonDeployments returns deployment summaries for a daemon, optionally filtered by status.
func (*InMemoryBackend) ListDaemonTaskDefinitions ¶
func (b *InMemoryBackend) ListDaemonTaskDefinitions( input ListDaemonTaskDefinitionsInput, ) ([]DaemonTaskDefinition, error)
ListDaemonTaskDefinitions returns daemon task definition summaries, unsorted; the handler applies the documented family/revision order (see handleListDaemonTaskDefinitions).
func (*InMemoryBackend) ListDaemons ¶
func (b *InMemoryBackend) ListDaemons(input ListDaemonsInput) ([]Daemon, error)
ListDaemons returns daemons, optionally filtered by cluster or capacity provider. Per ListDaemonsInput.ClusterArn's doc ("If you do not specify a cluster, the default cluster is assumed."), an unset ClusterArn scopes to the "default" cluster rather than every cluster.
func (*InMemoryBackend) ListServiceDeployments ¶
func (b *InMemoryBackend) ListServiceDeployments(cluster, service string) ([]ServiceDeployment, error)
ListServiceDeployments returns service deployment briefs for a service in a cluster.
func (*InMemoryBackend) ListServices ¶
func (b *InMemoryBackend) ListServices( cluster, launchType, schedulingStrategy string, ) ([]string, error)
ListServices returns service ARNs for a cluster, optionally filtered by launch type and scheduling strategy.
func (*InMemoryBackend) ListServicesByNamespace ¶
func (b *InMemoryBackend) ListServicesByNamespace(namespace string) ([]string, error)
ListServicesByNamespace returns service ARNs whose Service Connect configuration is attached to the given Cloud Map namespace. Real ListServicesByNamespaceInput has no Cluster member at all -- "Tasks can connect to services across all of the clusters in the namespace" (api_op_ListServicesByNamespace.go doc comment) -- so this searches every cluster, not one scoped by a (fabricated) cluster parameter. Namespace matches against Service.ServiceConnectConfiguration.Namespace, the real field this op filters by; it is not a substring match against the service's own name, which has nothing to do with Service Connect namespaces.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(resourceArn string) ([]Tag, error)
ListTagsForResource returns all tags for a resource.
func (*InMemoryBackend) ListTaskDefinitionFamilies ¶
func (b *InMemoryBackend) ListTaskDefinitionFamilies( familyPrefix, status string, ) ([]string, error)
ListTaskDefinitionFamilies returns distinct task definition family names.
func (*InMemoryBackend) ListTaskDefinitions ¶
func (b *InMemoryBackend) ListTaskDefinitions(familyPrefix string) ([]string, error)
ListTaskDefinitions returns ARNs of task definitions, optionally filtered by family prefix. ARNs are returned sorted for deterministic output.
func (*InMemoryBackend) ListTaskDefinitionsFiltered ¶
func (b *InMemoryBackend) ListTaskDefinitionsFiltered( input ListTaskDefinitionsInput, ) ([]string, error)
ListTaskDefinitionsFiltered returns task definition ARNs with status filtering. By default (input.Sort != "DESC"), results are ordered lexicographically by family name and in ascending numerical order by revision, matching the real API's documented default (ecs@v1.90.0 api_op_ListTaskDefinitions.go ListTaskDefinitionsInput.Sort); "DESC" reverses both. Revision must be compared numerically, not as part of the ARN string -- "family:10" sorts before "family:2" as a string.
func (*InMemoryBackend) ListTasks ¶
func (b *InMemoryBackend) ListTasks(cluster string) ([]string, error)
func (*InMemoryBackend) ListTasksFiltered ¶
func (b *InMemoryBackend) ListTasksFiltered(input ListTasksInput) ([]string, error)
ListTasksFiltered returns task ARNs matching the given filters. Per ListTasksInput.DesiredStatus's doc ("The default status filter is RUNNING"), an unset DesiredStatus narrows to RUNNING tasks rather than matching every status.
func (*InMemoryBackend) Purge ¶
func (b *InMemoryBackend) Purge(_ context.Context, cutoff time.Time)
Purge removes all ECS resources created before the given cutoff time.
The expensive scan over every task-definition family/revision is performed under a read lock (phase 1) to build a deletion plan; the write lock is then taken only to apply that plan (phase 2), so it is held O(deletions) rather than O(all revisions). Deletions are re-validated in phase 2 so a resource re-created between the phases is not purged.
func (*InMemoryBackend) PutAccountSetting ¶
func (b *InMemoryBackend) PutAccountSetting( name, value, principalArn string, ) (*AccountSetting, error)
PutAccountSetting creates or updates an account setting for a specific principal.
func (*InMemoryBackend) PutAccountSettingDefault ¶
func (b *InMemoryBackend) PutAccountSettingDefault(name, value string) (*AccountSetting, error)
PutAccountSettingDefault creates or updates an account-level default setting (no principal).
func (*InMemoryBackend) PutAttributes ¶
func (b *InMemoryBackend) PutAttributes(cluster string, attrs []Attribute) ([]Attribute, error)
PutAttributes creates or updates custom attributes on ECS resources in a cluster.
func (*InMemoryBackend) PutClusterCapacityProviders ¶
func (b *InMemoryBackend) PutClusterCapacityProviders( cluster string, capacityProviders []string, defaultCapacityProviderStrategy []CapacityProviderStrategyItem, ) (*Cluster, error)
PutClusterCapacityProviders associates capacity providers with a cluster.
func (*InMemoryBackend) ReconcileCapacity ¶
func (b *InMemoryBackend) ReconcileCapacity(ctx context.Context)
ReconcileCapacity places tasks waiting for capacity and runs one managed-scaling pass per provider.
func (*InMemoryBackend) RegisterClusterDeleteHook ¶
func (b *InMemoryBackend) RegisterClusterDeleteHook(fn func(clusterName string))
RegisterClusterDeleteHook registers a callback invoked (outside the backend lock) with the key of each cluster removed by DeleteCluster or Purge. It lets external components — such as the Reconciler's per-cluster launch semaphores — release cluster-scoped resources and avoid unbounded growth.
func (*InMemoryBackend) RegisterContainerInstance ¶
func (b *InMemoryBackend) RegisterContainerInstance( cluster, ec2InstanceID string, ) (*ContainerInstance, error)
RegisterContainerInstance registers a container instance to a cluster.
func (*InMemoryBackend) RegisterContainerInstanceWithDetails ¶
func (b *InMemoryBackend) RegisterContainerInstanceWithDetails( cluster, ec2InstanceID string, details ContainerInstanceDetails, ) (*ContainerInstance, error)
RegisterContainerInstanceWithDetails registers an instance and applies its attributes, tags and version info.
func (*InMemoryBackend) RegisterDaemonTaskDefinition ¶
func (b *InMemoryBackend) RegisterDaemonTaskDefinition( input RegisterDaemonTaskDefinitionInput, ) (*DaemonTaskDefinition, error)
RegisterDaemonTaskDefinition registers a new daemon task definition revision.
func (*InMemoryBackend) RegisterTaskDefinition ¶
func (b *InMemoryBackend) RegisterTaskDefinition( input RegisterTaskDefinitionInput, ) (*TaskDefinition, error)
RegisterTaskDefinition registers a new task definition revision.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset zeroes all backend state for test isolation.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot.
func (*InMemoryBackend) RunTask ¶
func (b *InMemoryBackend) RunTask(input RunTaskInput) ([]Task, []Failure, error)
RunTask starts one or more tasks on the given cluster. A per-task placement failure (no eligible container instance, or its host ports cannot satisfy the task definition's port mappings) is reported as a Failure entry rather than an error, matching real RunTask -- see createTaskEntriesLocked.
func (*InMemoryBackend) SFNRunTask ¶
SFNRunTask implements the Step Functions ECS RunTask service integration. It maps the SFN input map (ClusterArn, TaskDefinition, LaunchType, Overrides, etc.) to a RunTaskInput and returns the standard ECS RunTask response shape.
func (*InMemoryBackend) SetAlarmStateProvider ¶
func (b *InMemoryBackend) SetAlarmStateProvider(p AlarmStateProvider)
SetAlarmStateProvider wires the alarm source used by deployment alarm monitoring.
func (*InMemoryBackend) SetAutoScalingGroupController ¶
func (b *InMemoryBackend) SetAutoScalingGroupController(c AutoScalingGroupController)
SetAutoScalingGroupController wires the Auto Scaling backend: it validates provider ASGs and lets managed scaling observe and resize them.
func (*InMemoryBackend) SetAutoScalingGroupResolver ¶
func (b *InMemoryBackend) SetAutoScalingGroupResolver(r AutoScalingGroupResolver)
SetAutoScalingGroupResolver wires the lookup CreateCapacityProvider uses to validate AutoScalingGroupArn.
func (*InMemoryBackend) SetCWLogsBackend ¶
func (b *InMemoryBackend) SetCWLogsBackend(cwl CWLogsBackend)
SetCWLogsBackend wires CloudWatch Logs so an awslogs-driver container's log group/stream become discoverable when its task starts, and (when the configured TaskRunner supports it) its stdout/stderr get forwarded there. Passing nil restores the historical behavior of LogConfiguration being stored and echoed with no effect on CloudWatch Logs.
func (*InMemoryBackend) SetCloudMapRegistrar ¶
func (b *InMemoryBackend) SetCloudMapRegistrar(r CloudMapRegistrar)
SetCloudMapRegistrar wires the Cloud Map registrar; nil disables service discovery registration.
func (*InMemoryBackend) SetELBv2Registrar ¶
func (b *InMemoryBackend) SetELBv2Registrar(r ELBv2TargetRegistrar)
SetELBv2Registrar wires an ELBv2TargetRegistrar so subsequent task start/stop transitions register or deregister real ELBv2 targets for services with LoadBalancers configured. Passing nil restores the historical, registration-less behavior. Intended to be called once during service wiring, before the backend serves traffic.
func (*InMemoryBackend) SetEndpointURL ¶
func (b *InMemoryBackend) SetEndpointURL(u string)
SetEndpointURL sets the base URL task containers use to reach this server.
func (*InMemoryBackend) SetEventPublisher ¶
func (b *InMemoryBackend) SetEventPublisher(p EventPublisher)
SetEventPublisher wires the default-bus publisher for ECS state-change events.
func (*InMemoryBackend) SetInstanceResourceResolver ¶
func (b *InMemoryBackend) SetInstanceResourceResolver(r InstanceResourceResolver)
SetInstanceResourceResolver wires the EC2 lookup that sizes container instances registered without totalResources.
func (*InMemoryBackend) SetLambdaInvoker ¶
func (b *InMemoryBackend) SetLambdaInvoker(l LambdaInvoker)
SetLambdaInvoker wires the invoker used by AWS_LAMBDA lifecycle hooks. Without one the hooks are not run.
func (*InMemoryBackend) SetLinkLocal ¶
func (b *InMemoryBackend) SetLinkLocal(l LinkLocal)
SetLinkLocal routes task credentials and metadata through LinkLocalHost when l is active.
func (*InMemoryBackend) SetMetricEmitter ¶
func (b *InMemoryBackend) SetMetricEmitter(e cwmetric.Emitter)
SetMetricEmitter sets the emitter that publishes AWS/ECS service utilization metrics to CloudWatch.
func (*InMemoryBackend) SetRoleCredentialIssuer ¶
func (b *InMemoryBackend) SetRoleCredentialIssuer(i RoleCredentialIssuer)
SetRoleCredentialIssuer wires STS-backed task-role credentials into task containers.
func (*InMemoryBackend) SetStartDelay ¶
func (b *InMemoryBackend) SetStartDelay(d time.Duration)
SetStartDelay configures the per-phase delay applied to the no-runner task start lifecycle (PROVISIONING→PENDING→RUNNING). Zero (the default) keeps the immediate transition.
func (*InMemoryBackend) SetStopDelay ¶
func (b *InMemoryBackend) SetStopDelay(d time.Duration)
SetStopDelay configures the per-phase delay applied to the task stop lifecycle. A positive delay makes StopTask leave the task in DEACTIVATING and advance it through STOPPING/DEPROVISIONING/STOPPED on subsequent lifecycle steps, so waiters can observe the intermediate states. Zero (the default) restores the immediate RUNNING→STOPPED transition.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON.
func (*InMemoryBackend) StartTask ¶
func (b *InMemoryBackend) StartTask(input StartTaskInput) ([]Task, []Failure, error)
StartTask places tasks on specific container instances (as opposed to RunTask which auto-places).
func (*InMemoryBackend) StartTaskForService ¶
func (b *InMemoryBackend) StartTaskForService( clusterName, serviceName, taskDefinitionArn string, ) error
StartTaskForService launches a task on behalf of a service. It reads the service's PropagateTags, Tags, and EnableECSManagedTags settings so that tasks spawned by the reconciler honour the same tag propagation as tasks started directly via RunTask.
func (*InMemoryBackend) StopOldestServiceTask ¶
func (b *InMemoryBackend) StopOldestServiceTask(clusterName, serviceName string) error
StopOldestServiceTask stops the oldest running task for a service.
func (*InMemoryBackend) StopServiceDeployment ¶
func (b *InMemoryBackend) StopServiceDeployment( serviceDeploymentArn, stopType string, ) (*ServiceDeployment, error)
StopServiceDeployment stops an in-progress service deployment. stopType ROLLBACK also reverts the service to its previous service revision.
func (*InMemoryBackend) StopTask ¶
func (b *InMemoryBackend) StopTask(cluster, taskArn, reason string) (*Task, error)
StopTask stops a running task.
func (*InMemoryBackend) SubmitAttachmentStateChanges ¶
func (b *InMemoryBackend) SubmitAttachmentStateChanges(cluster string, attachments []AttachmentStateChange) error
SubmitAttachmentStateChanges records attachment status transitions reported by the ECS agent for one or more attachments within a cluster. Unknown clusters or attachment ARNs are tolerated as no-ops.
func (*InMemoryBackend) SubmitContainerStateChange ¶
func (b *InMemoryBackend) SubmitContainerStateChange(input SubmitContainerStateChangeInput) error
SubmitContainerStateChange records a single container's status transition reported by the ECS agent. Unknown clusters, tasks, or containers are tolerated as no-ops.
func (*InMemoryBackend) SubmitTaskStateChange ¶
func (b *InMemoryBackend) SubmitTaskStateChange(input SubmitTaskStateChangeInput) error
SubmitTaskStateChange records a task (and its containers'/attachments') status transition reported by the ECS agent. Unknown clusters or tasks are tolerated as no-ops, matching the tolerant, eventually-consistent contract of this agent-internal API.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(resourceArn string, tags []Tag) error
TagResource applies key/value tags to a resource identified by its ARN.
func (*InMemoryBackend) TaggedResources ¶ added in v1.2.0
func (b *InMemoryBackend) TaggedResources() []TaggedEntry
TaggedResources returns every ECS resource ARN that currently has at least one tag applied via TagResource, spanning every ECS resource kind that shares the flat resourceTags side map (clusters, services, task definitions, container instances, task sets, capacity providers, and more).
func (*InMemoryBackend) TaskMetadataFor ¶
func (b *InMemoryBackend) TaskMetadataFor(taskID string, withTags bool) (TaskMetadata, bool)
TaskMetadataFor builds the task metadata v4 document for the task with ID taskID.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(resourceArn string, tagKeys []string) error
UntagResource removes tags with the given keys from a resource.
func (*InMemoryBackend) UpdateCapacityProvider ¶
func (b *InMemoryBackend) UpdateCapacityProvider( input UpdateCapacityProviderInput, ) (*CapacityProvider, error)
UpdateCapacityProvider updates the managed-scaling settings of an ASG-backed capacity provider. Unlike CreateCapacityProvider, the ASG the provider wraps cannot be changed here (there is no ARN field on the real UpdateCapacityProviderRequest's AutoScalingGroupProviderUpdate) -- only ManagedScaling/ManagedTerminationProtection/ManagedDraining are merged onto the existing AutoScalingGroupProvider, so its ARN is preserved.
func (*InMemoryBackend) UpdateCluster ¶
func (b *InMemoryBackend) UpdateCluster(input UpdateClusterInput) (*Cluster, error)
UpdateCluster updates an ECS cluster's settings. Capacity-provider association is not part of this operation in real AWS -- see PutClusterCapacityProviders for that.
func (*InMemoryBackend) UpdateClusterSettings ¶
func (b *InMemoryBackend) UpdateClusterSettings( cluster string, settings []ClusterSetting, ) (*Cluster, error)
UpdateClusterSettings updates the settings for an ECS cluster.
func (*InMemoryBackend) UpdateContainerAgent ¶
func (b *InMemoryBackend) UpdateContainerAgent( cluster, containerInstance string, ) (*ContainerInstance, error)
UpdateContainerAgent initiates an update of the container agent on the given instance.
func (*InMemoryBackend) UpdateContainerInstancesState ¶
func (b *InMemoryBackend) UpdateContainerInstancesState( cluster string, containerInstances []string, status string, ) ([]ContainerInstance, []Failure, error)
UpdateContainerInstancesState updates the status of container instances. Unknown ARNs are reported as failures instead of failing the whole batch, matching AWS behaviour for this operation.
func (*InMemoryBackend) UpdateDaemon ¶
func (b *InMemoryBackend) UpdateDaemon(input UpdateDaemonInput) (*Daemon, error)
UpdateDaemon updates a daemon's configuration and triggers a new deployment.
func (*InMemoryBackend) UpdateExpressGatewayService ¶
func (b *InMemoryBackend) UpdateExpressGatewayService( input UpdateExpressGatewayServiceInput, ) (*ExpressGatewayService, error)
UpdateExpressGatewayService updates an express gateway service, replacing its active configuration with a new service revision built from the supplied fields (real AWS creates a new revision and rolls out to it; this emulator does not model rollout progress, so the new revision becomes current immediately).
func (*InMemoryBackend) UpdateService ¶
func (b *InMemoryBackend) UpdateService(input UpdateServiceInput) (*Service, error)
UpdateService updates an existing ECS service.
func (*InMemoryBackend) UpdateServicePrimaryTaskSet ¶
func (b *InMemoryBackend) UpdateServicePrimaryTaskSet( cluster, service, primaryTaskSet string, ) (*TaskSet, error)
UpdateServicePrimaryTaskSet sets the primary task set for a service.
func (*InMemoryBackend) UpdateTaskProtection ¶
func (b *InMemoryBackend) UpdateTaskProtection( cluster string, taskArns []string, protectionEnabled bool, expiresInMinutes *int, ) ([]TaskProtection, []Failure, error)
UpdateTaskProtection updates task protection for tasks in a cluster.
func (*InMemoryBackend) UpdateTaskSet ¶
func (b *InMemoryBackend) UpdateTaskSet( cluster, service, taskSet string, scale TaskSetScale, ) (*TaskSet, error)
UpdateTaskSet updates the scale of a task set.
type InferenceAccelerator ¶
type InferenceAccelerator struct {
DeviceName string `json:"deviceName"`
DeviceType string `json:"deviceType"`
}
InferenceAccelerator specifies an Elastic Inference accelerator for a task definition.
type IngressPathSummary ¶ added in v1.2.0
type IngressPathSummary struct {
AccessType string `json:"accessType,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
}
IngressPathSummary is an access endpoint for an Express service revision. This backend does not emulate the managed ALB/target-group infrastructure an Express service provisions, so IngressPaths is always empty -- see ECSExpressGatewayService.ActiveConfigurations in models.go and the managed-infrastructure note on ExpressGatewayServiceConfiguration. Mirrors types.IngressPathSummary.
type InstanceResourceResolver ¶
type InstanceResourceResolver interface {
ContainerInstanceResources(ec2InstanceID string) (cpuUnits, memoryMiB int, ok bool)
InstanceTypeResources(instanceType string) (cpuUnits, memoryMiB int, ok bool)
}
InstanceResourceResolver reports the CPU units and memory MiB of an EC2 instance's type.
type Janitor ¶
type Janitor struct {
Backend *InMemoryBackend
Interval time.Duration
TaskTimeout time.Duration
// contains filtered or unexported fields
}
Janitor is the ECS background worker that evicts stopped tasks older than a configurable TTL to prevent unbounded growth of the tasks map.
func NewJanitor ¶
func NewJanitor(backend *InMemoryBackend, interval time.Duration) *Janitor
NewJanitor creates a new ECS Janitor for the given backend. If interval is zero it falls back to defaultECSJanitorInterval.
func (*Janitor) SetTaskTTL ¶
SetTaskTTL overrides the default stopped-task TTL. Intended for testing.
type KeyValuePair ¶
KeyValuePair is a name/value pair.
type LambdaInvoker ¶
type LambdaInvoker interface {
Invoke(ctx context.Context, functionARN string, payload []byte) ([]byte, error)
}
LambdaInvoker runs a function synchronously; a function error must be returned as an error.
type LifecycleHookDetail ¶
type LifecycleHookDetail struct {
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
HookID string `json:"hookId"`
Status string `json:"status"`
TargetArn string `json:"targetArn,omitempty"`
TargetType string `json:"targetType,omitempty"`
TimeoutAction string `json:"timeoutAction,omitempty"`
Stage string `json:"stage,omitempty"`
}
LifecycleHookDetail mirrors types.DeploymentLifecycleHookDetail; Stage is internal.
type LinearConfiguration ¶
type LinearConfiguration struct {
StepBakeTimeInMinutes *int `json:"stepBakeTimeInMinutes,omitempty"`
StepPercent *float64 `json:"stepPercent,omitempty"`
}
LinearConfiguration mirrors types.LinearConfiguration.
type LinkLocal ¶
type LinkLocal interface {
Active(ctx context.Context) bool
Attach(ctx context.Context, containerID, owner string) error
}
LinkLocal makes LinkLocalHost reachable from task containers.
type ListDaemonDeploymentsInput ¶
ListDaemonDeploymentsInput holds filters for ListDaemonDeployments.
type ListDaemonTaskDefinitionsInput ¶
type ListDaemonTaskDefinitionsInput struct {
Family string
FamilyPrefix string
Status string // "", "ACTIVE" (default), "DELETE_IN_PROGRESS", or "ALL"
}
ListDaemonTaskDefinitionsInput holds optional filters for ListDaemonTaskDefinitions.
type ListDaemonsInput ¶
ListDaemonsInput holds optional filters for ListDaemons.
type ListTaskDefinitionsInput ¶
type ListTaskDefinitionsInput struct {
FamilyPrefix string
// Status filters by task definition status: "ACTIVE", "INACTIVE", or
// "DELETE_IN_PROGRESS". Empty string matches only ACTIVE (AWS default).
Status string
// Sort is "ASC" (default) or "DESC"; see ListTaskDefinitionsFiltered.
Sort string
}
ListTaskDefinitionsInput holds optional filters for ListTaskDefinitions.
type ListTasksInput ¶
type ListTasksInput struct {
Cluster string
ContainerInstance string
Family string
ServiceName string
DaemonName string
DesiredStatus string
LaunchType string
StartedBy string
}
ListTasksInput holds optional filters for ListTasks.
type LoadBalancer ¶
type LoadBalancer struct {
TargetGroupArn string `json:"targetGroupArn,omitempty"`
LoadBalancerName string `json:"loadBalancerName,omitempty"`
ContainerName string `json:"containerName,omitempty"`
ContainerPort int `json:"containerPort,omitempty"`
}
LoadBalancer wires ECS tasks to ALB/NLB target groups.
type LogConfiguration ¶
type LogConfiguration struct {
LogDriver string `json:"logDriver"`
Options map[string]string `json:"options,omitempty"`
SecretOptions []SecretOption `json:"secretOptions,omitempty"`
}
LogConfiguration specifies the logging driver and options for a container.
type ManagedScaling ¶
type ManagedScaling struct {
Status string `json:"status,omitempty"`
TargetCapacityPercent int `json:"targetCapacity,omitempty"`
MinimumScalingStepSize int `json:"minimumScalingStepSize,omitempty"`
MaximumScalingStepSize int `json:"maximumScalingStepSize,omitempty"`
InstanceWarmupPeriod int `json:"instanceWarmupPeriod,omitempty"`
TargetCapacityUtilization int `json:"targetCapacityUtilization,omitempty"`
}
ManagedScaling configures managed scaling for an ASG-backed capacity provider.
type ManagedStorageConfiguration ¶
type ManagedStorageConfiguration struct {
FargateEphemeralStorageKmsKeyID string `json:"fargateEphemeralStorageKmsKeyId,omitempty"`
KmsKeyID string `json:"kmsKeyId,omitempty"`
}
ManagedStorageConfiguration holds the KMS keys encrypting a cluster's managed storage.
type MetricConfiguration ¶
type MetricConfiguration struct {
MetricNames []string `json:"metricNames"`
ResolutionSeconds int `json:"resolutionSeconds"`
}
MetricConfiguration is a single service-level CloudWatch metric resolution setting (mirrors types.MetricConfiguration).
type MonitoringConfiguration ¶
type MonitoringConfiguration struct {
MetricConfigurations []MetricConfiguration `json:"metricConfigurations,omitempty"`
}
MonitoringConfiguration is the optional per-service CloudWatch metric resolution config (mirrors types.MonitoringConfiguration). It is stored and echoed back on ServiceRevision -- this backend does not emit real CloudWatch metrics, so no resolution behaviour is simulated.
type MountPoint ¶
type MountPoint struct {
SourceVolume string `json:"sourceVolume,omitempty"`
ContainerPath string `json:"containerPath,omitempty"`
ReadOnly bool `json:"readOnly,omitempty"`
}
MountPoint maps a volume into a container.
type NetworkBinding ¶
type NetworkBinding struct {
BindIP string `json:"bindIP,omitempty"`
Protocol string `json:"protocol,omitempty"`
ContainerPortRange string `json:"containerPortRange,omitempty"`
HostPortRange string `json:"hostPortRange,omitempty"`
ContainerPort int `json:"containerPort,omitempty"`
HostPort int `json:"hostPort,omitempty"`
}
NetworkBinding maps a container port to a host port. Field names verified against ecs@v1.96.0 deserializers.go's awsAwsjson11_deserializeDocumentNetworkBinding (bindIP, containerPort, containerPortRange, hostPort, hostPortRange, protocol).
type NetworkConfiguration ¶
type NetworkConfiguration struct {
AwsvpcConfiguration *AwsvpcConfiguration `json:"awsvpcConfiguration,omitempty"`
}
NetworkConfiguration holds the network settings for a task or service.
type NetworkInterface ¶
type NetworkInterface struct {
AttachmentID string `json:"attachmentId,omitempty"`
PrivateIpv4Address string `json:"privateIpv4Address,omitempty"`
Ipv6Address string `json:"ipv6Address,omitempty"`
}
NetworkInterface holds the network interface details for a running container.
type PlacementConstraint ¶
type PlacementConstraint struct {
Type string `json:"type,omitempty"`
Expression string `json:"expression,omitempty"`
}
PlacementConstraint specifies a placement constraint for a task or service.
type PlacementStrategy ¶
type PlacementStrategy struct {
Type string `json:"type,omitempty"`
Field string `json:"field,omitempty"`
}
PlacementStrategy specifies a placement strategy for tasks.
type PortMapping ¶
type PortMapping struct {
Name string `json:"name,omitempty"`
Protocol string `json:"protocol,omitempty"`
AppProtocol string `json:"appProtocol,omitempty"`
ContainerPortRange string `json:"containerPortRange,omitempty"`
ContainerPort int `json:"containerPort,omitempty"`
HostPort int `json:"hostPort,omitempty"`
}
PortMapping maps a container port to a host port.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for Amazon ECS.
func (*Provider) Init ¶
func (p *Provider) Init(appCtx *service.AppContext) (service.Registerable, error)
Init initializes the ECS service backend and handler.
type ProxyConfiguration ¶
type ProxyConfiguration struct {
ContainerName string `json:"containerName"`
Type string `json:"type,omitempty"`
Properties []KeyValuePair `json:"properties,omitempty"`
}
ProxyConfiguration is the App Mesh proxy configuration of a task definition.
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler manages ECS service desired-count reconciliation. It runs in the background, comparing DesiredCount vs running task count and starting or stopping tasks as needed.
func NewReconciler ¶
func NewReconciler(backend *InMemoryBackend) *Reconciler
NewReconciler creates a new Reconciler for the given backend.
func (*Reconciler) EvictCluster ¶
func (r *Reconciler) EvictCluster(clusterName string)
EvictCluster removes the per-cluster launch semaphore for a deleted cluster. Without this, r.sems would grow one permanent entry per cluster ever created, leaking memory as clusters are created and destroyed. It is registered as a cluster-delete hook on the backend so eviction happens promptly on DeleteCluster/Purge.
func (*Reconciler) RunOnce ¶
func (r *Reconciler) RunOnce(ctx context.Context)
RunOnce performs a single reconciliation pass. Exported for testing.
func (*Reconciler) SemCount ¶
func (r *Reconciler) SemCount() int
SemCount returns the number of live per-cluster semaphores. Intended for tests that assert the leak fix.
func (*Reconciler) Start ¶
func (r *Reconciler) Start(ctx context.Context)
Start launches the reconciliation loop. It runs until ctx is cancelled.
type RegisterDaemonTaskDefinitionInput ¶
type RegisterDaemonTaskDefinitionInput struct {
Family string
CPU string
Memory string
ExecutionRoleArn string
TaskRoleArn string
IpcMode string
PidMode string
ContainerDefinitions []DaemonContainerDefinition
Volumes []DaemonVolume
Tags []Tag
}
RegisterDaemonTaskDefinitionInput holds input for RegisterDaemonTaskDefinition.
type RegisterTaskDefinitionInput ¶
type RegisterTaskDefinitionInput struct {
ProxyConfiguration *ProxyConfiguration `json:"proxyConfiguration,omitempty"`
RuntimePlatform *RuntimePlatform `json:"runtimePlatform,omitempty"`
EphemeralStorage *EphemeralStorage `json:"ephemeralStorage,omitempty"`
Family string `json:"family"`
TaskRoleArn string `json:"taskRoleArn,omitempty"`
ExecutionRoleArn string `json:"executionRoleArn,omitempty"`
NetworkMode string `json:"networkMode,omitempty"`
CPU string `json:"cpu,omitempty"`
Memory string `json:"memory,omitempty"`
PlatformFamily string `json:"platformFamily,omitempty"`
IpcMode string `json:"ipcMode,omitempty"`
PidMode string `json:"pidMode,omitempty"`
ContainerDefinitions []ContainerDefinition `json:"containerDefinitions"`
Volumes []Volume `json:"volumes,omitempty"`
PlacementConstraints []PlacementConstraint `json:"placementConstraints,omitempty"`
RequiresCompatibilities []string `json:"requiresCompatibilities,omitempty"`
InferenceAccelerators []InferenceAccelerator `json:"inferenceAccelerators,omitempty"`
Tags []Tag `json:"tags,omitempty"`
EnableFaultInjection bool `json:"enableFaultInjection,omitempty"`
}
RegisterTaskDefinitionInput holds input for RegisterTaskDefinition.
type RepositoryCredentials ¶
type RepositoryCredentials struct {
CredentialsParameter string `json:"credentialsParameter"`
}
RepositoryCredentials references a SecretsManager secret for private registry pulls.
type Resource ¶
type Resource struct {
Name string `json:"name"`
Type string `json:"type"`
StringSetValue []string `json:"stringSetValue,omitempty"`
DoubleValue float64 `json:"doubleValue"`
LongValue int64 `json:"longValue"`
IntegerValue int32 `json:"integerValue"`
}
Resource mirrors types.Resource: a named, typed container-instance resource value.
type ResourceRequirement ¶
type ResourceRequirement struct {
Type string `json:"type"` // GPU or InferenceAccelerator
Value string `json:"value"` // quantity (e.g. "1")
}
ResourceRequirement specifies a GPU or InferenceAccelerator requirement for a container.
type RoleCredentialIssuer ¶
type RoleCredentialIssuer interface {
IssueTaskCredentials(roleArn, sessionName string) (RoleCredentials, error)
}
RoleCredentialIssuer mints task-role credentials for a task container.
type RoleCredentials ¶
type RoleCredentials struct {
Expires time.Time
AccessKeyID string
SecretAccessKey string
SessionToken string
}
RoleCredentials are temporary credentials for a task role.
type RunTaskInput ¶
type RunTaskInput struct {
PinnedTaskID string `json:"-"`
Overrides *TaskOverride `json:"overrides,omitempty"`
NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
Cluster string `json:"cluster,omitempty"`
TaskDefinition string `json:"taskDefinition"`
LaunchType string `json:"launchType,omitempty"`
Group string `json:"group,omitempty"`
StartedBy string `json:"startedBy,omitempty"`
PlatformVersion string `json:"platformVersion,omitempty"`
PropagateTags string `json:"propagateTags,omitempty"`
Tags []Tag `json:"tags,omitempty"`
PlacementConstraints []PlacementConstraint `json:"placementConstraints,omitempty"`
PlacementStrategy []PlacementStrategy `json:"placementStrategy,omitempty"`
CapacityProviderStrategy []CapacityProviderStrategyItem `json:"capacityProviderStrategy,omitempty"`
Count int `json:"count,omitempty"`
EnableECSManagedTags bool `json:"enableECSManagedTags,omitempty"`
EnableExecuteCommand bool `json:"enableExecuteCommand,omitempty"`
// contains filtered or unexported fields
}
RunTaskInput holds input for RunTask.
type RuntimePlatform ¶
type RuntimePlatform struct {
CPUArchitecture string `json:"cpuArchitecture,omitempty"`
OperatingSystemFamily string `json:"operatingSystemFamily,omitempty"`
}
RuntimePlatform specifies the CPU architecture and OS family for a task definition.
type SecretOption ¶
SecretOption is a secret key/value pair for log driver authentication.
type SecretReference ¶
SecretReference resolves a SecretsManager ARN or SSM path into an env var.
type Service ¶
type Service struct {
Events []ServiceEvent `json:"-"`
CreatedAt time.Time `json:"createdAt"`
// DrainDeadline is when a Status of DRAINING resolves to INACTIVE,
// lazily applied by sweepServiceTransitionsLocked. Zero when Status is
// not DRAINING.
DrainDeadline time.Time `json:"drainDeadline"`
// InactiveAt is when Status became INACTIVE; sweepServiceTransitionsLocked
// evicts the service inactiveServiceTTL past this point. Zero when Status
// is not INACTIVE.
InactiveAt time.Time `json:"inactiveAt"`
HealthCheckGracePeriodSeconds *int `json:"healthCheckGracePeriodSeconds,omitempty"`
ServiceConnectConfiguration *ServiceConnectConfiguration `json:"serviceConnectConfiguration,omitempty"`
DeploymentConfiguration *DeploymentConfiguration `json:"deploymentConfiguration,omitempty"`
DeploymentController *DeploymentController `json:"deploymentController,omitempty"`
NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
Monitoring *MonitoringConfiguration `json:"monitoring,omitempty"`
ServiceArn string `json:"serviceArn"`
ServiceName string `json:"serviceName"`
ClusterArn string `json:"clusterArn"`
TaskDefinition string `json:"taskDefinition"`
Status string `json:"status"`
LaunchType string `json:"launchType,omitempty"`
SchedulingStrategy string `json:"schedulingStrategy,omitempty"`
PropagateTags string `json:"propagateTags,omitempty"`
AvailabilityZoneRebalancing string `json:"availabilityZoneRebalancing,omitempty"`
PlatformVersion string `json:"platformVersion,omitempty"`
RoleArn string `json:"roleArn,omitempty"`
ClientToken string `json:"clientToken,omitempty"`
Tags []Tag `json:"tags,omitempty"`
LoadBalancers []LoadBalancer `json:"loadBalancers,omitempty"`
ServiceRegistries []ServiceRegistry `json:"serviceRegistries,omitempty"`
PlacementConstraints []PlacementConstraint `json:"placementConstraints,omitempty"`
PlacementStrategy []PlacementStrategy `json:"placementStrategy,omitempty"`
CapacityProviderStrategy []CapacityProviderStrategyItem `json:"capacityProviderStrategy,omitempty"`
Deployments []Deployment `json:"deployments,omitempty"`
DesiredCount int `json:"desiredCount"`
PendingCount int `json:"pendingCount"`
RunningCount int `json:"runningCount"`
EnableExecuteCommand bool `json:"enableExecuteCommand,omitempty"`
EnableECSManagedTags bool `json:"enableECSManagedTags,omitempty"`
// contains filtered or unexported fields
}
Service represents an ECS service.
type ServiceConnectClientAlias ¶
type ServiceConnectClientAlias struct {
DNSName string `json:"dnsName,omitempty"`
Port int `json:"port"`
}
ServiceConnectClientAlias represents an alias for a service connect client.
type ServiceConnectConfiguration ¶
type ServiceConnectConfiguration struct {
Namespace string `json:"namespace,omitempty"`
Services []ServiceConnectService `json:"services,omitempty"`
Enabled bool `json:"enabled"`
}
ServiceConnectConfiguration represents the service connect configuration for a service.
type ServiceConnectService ¶
type ServiceConnectService struct {
PortName string `json:"portName"`
DiscoveryName string `json:"discoveryName,omitempty"`
ClientAliases []ServiceConnectClientAlias `json:"clientAliases,omitempty"`
}
ServiceConnectService represents a service in a service connect configuration.
type ServiceDeployment ¶
type ServiceDeployment struct {
Alarms *ServiceDeploymentAlarms `json:"alarms,omitempty"`
StartedAt *time.Time `json:"startedAt,omitempty"`
StoppedAt *time.Time `json:"stoppedAt,omitempty"`
FinishedAt *time.Time `json:"finishedAt,omitempty"`
Rollback *ServiceDeploymentRollback `json:"rollback,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
BakeStartedAt *time.Time `json:"bakeStartedAt,omitempty"`
ClusterArn string `json:"clusterArn"`
Status string `json:"status"`
StatusReason string `json:"statusReason,omitempty"`
TargetServiceRevisionArn string `json:"targetServiceRevisionArn,omitempty"`
LifecycleStage string `json:"lifecycleStage,omitempty"`
ServiceArn string `json:"serviceArn"`
ServiceDeploymentArn string `json:"serviceDeploymentArn"`
LifecycleHookDetails []LifecycleHookDetail `json:"lifecycleHookDetails,omitempty"`
LifecycleCursor int `json:"lifecycleCursor,omitempty"`
LifecycleEntered bool `json:"lifecycleEntered,omitempty"`
// contains filtered or unexported fields
}
ServiceDeployment represents an ECS service deployment.
type ServiceDeploymentAlarms ¶
type ServiceDeploymentAlarms struct {
Status string `json:"status"`
AlarmNames []string `json:"alarmNames,omitempty"`
TriggeredAlarmNames []string `json:"triggeredAlarmNames,omitempty"`
}
ServiceDeploymentAlarms mirrors types.ServiceDeploymentAlarms.
type ServiceDeploymentCircuitBreaker ¶
ServiceDeploymentCircuitBreaker mirrors types.ServiceDeploymentCircuitBreaker.
type ServiceDeploymentRollback ¶
type ServiceDeploymentRollback struct {
StartedAt *time.Time `json:"startedAt,omitempty"`
Reason string `json:"reason,omitempty"`
ServiceRevisionArn string `json:"serviceRevisionArn,omitempty"`
}
ServiceDeploymentRollback mirrors types.Rollback.
type ServiceEvent ¶
ServiceEvent is one DescribeServices event message.
type ServiceRegistry ¶
type ServiceRegistry struct {
RegistryArn string `json:"registryArn,omitempty"`
ContainerName string `json:"containerName,omitempty"`
Port int `json:"port,omitempty"`
ContainerPort int `json:"containerPort,omitempty"`
}
ServiceRegistry wires tasks into a CloudMap namespace for service discovery.
type ServiceRevision ¶
type ServiceRevision struct {
CreatedAt *float64 `json:"createdAt,omitempty"`
NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
ServiceConnectConfiguration *ServiceConnectConfiguration `json:"serviceConnectConfiguration,omitempty"`
Monitoring *MonitoringConfiguration `json:"monitoring,omitempty"`
ClusterArn string `json:"clusterArn,omitempty"`
LaunchType string `json:"launchType,omitempty"`
PlatformVersion string `json:"platformVersion,omitempty"`
ServiceArn string `json:"serviceArn,omitempty"`
ServiceRevisionArn string `json:"serviceRevisionArn,omitempty"`
TaskDefinition string `json:"taskDefinition,omitempty"`
CapacityProviderStrategy []CapacityProviderStrategyItem `json:"capacityProviderStrategy,omitempty"`
LoadBalancers []LoadBalancer `json:"loadBalancers,omitempty"`
ServiceRegistries []ServiceRegistry `json:"serviceRegistries,omitempty"`
}
ServiceRevision describes the workload configuration captured by a single deployment of an ECS service, as returned by DescribeServiceRevisions.
type ServiceRevisionSummary ¶
type ServiceRevisionSummary struct {
Arn string
PendingTaskCount int
RequestedTaskCount int
RunningTaskCount int
}
ServiceRevisionSummary mirrors the counts of types.ServiceRevisionSummary.
type Session ¶
type Session struct {
SessionID string `json:"sessionId"`
StreamURL string `json:"streamUrl"`
TokenValue string `json:"tokenValue"`
}
Session represents an ECS Exec interactive session.
type Snapshottable ¶
type Snapshottable interface {
Snapshot(ctx context.Context) []byte
Restore(context.Context, []byte) error
}
Snapshottable is an optional interface that a Backend may implement to support snapshot/restore for persistence or test isolation.
type StartTaskInput ¶
type StartTaskInput struct {
Overrides *TaskOverride
NetworkConfiguration *NetworkConfiguration
Cluster string
TaskDefinition string
Group string
StartedBy string
PropagateTags string
ContainerInstances []string
Tags []Tag
EnableExecuteCommand bool
EnableECSManagedTags bool
}
StartTaskInput holds input for StartTask (place a task on a specific container instance).
type SubmitContainerStateChangeInput ¶
type SubmitContainerStateChangeInput struct {
ExitCode *int `json:"exitCode,omitempty"`
Cluster string `json:"cluster,omitempty"`
ContainerName string `json:"containerName,omitempty"`
Reason string `json:"reason,omitempty"`
RuntimeID string `json:"runtimeId,omitempty"`
Status string `json:"status,omitempty"`
Task string `json:"task,omitempty"`
NetworkBindings []NetworkBinding `json:"networkBindings,omitempty"`
}
SubmitContainerStateChangeInput holds input for SubmitContainerStateChange.
type SubmitTaskStateChangeInput ¶
type SubmitTaskStateChangeInput struct {
Cluster string `json:"cluster,omitempty"`
Reason string `json:"reason,omitempty"`
Status string `json:"status,omitempty"`
Task string `json:"task,omitempty"`
Attachments []AttachmentStateChange `json:"attachments,omitempty"`
Containers []ContainerStateChangeItem `json:"containers,omitempty"`
}
SubmitTaskStateChangeInput holds input for SubmitTaskStateChange.
type TaggedEntry ¶ added in v1.2.0
TaggedEntry pairs a resource ARN with its tag map, for cross-service tag enumeration by the Resource Groups Tagging API (see cli.go's wireTaggingECS).
type Task ¶
type Task struct {
StartedAt *time.Time `json:"startedAt,omitempty"`
StoppedAt *time.Time `json:"stoppedAt,omitempty"`
ConnectivityAt *time.Time `json:"connectivityAt,omitempty"`
Overrides *TaskOverride `json:"overrides,omitempty"`
NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
TaskArn string `json:"taskArn"`
ClusterArn string `json:"clusterArn"`
TaskDefinitionArn string `json:"taskDefinitionArn"`
LastStatus string `json:"lastStatus"`
DesiredStatus string `json:"desiredStatus"`
Connectivity string `json:"connectivity,omitempty"`
StoppedReason string `json:"stoppedReason,omitempty"`
Group string `json:"group,omitempty"`
LaunchType string `json:"launchType,omitempty"`
ContainerInstanceArn string `json:"containerInstanceArn,omitempty"`
StartedBy string `json:"startedBy,omitempty"`
PlatformVersion string `json:"platformVersion,omitempty"`
PlatformFamily string `json:"platformFamily,omitempty"`
RuntimeID string `json:"runtimeId,omitempty"`
PropagateTags string `json:"propagateTags,omitempty"`
// TaskRoleArn is the effective IAM role ARN for task containers.
// Resolved from Overrides.TaskRoleArn if set, else from the task definition.
TaskRoleArn string `json:"taskRoleArn,omitempty"`
// CapacityProviderName is the capacity provider actually selected to run this
// task. Set from RunTaskInput.CapacityProviderStrategy (the first entry, as a
// documented simplification: this backend does not model weight/base-driven
// distribution across multiple providers -- see RunTask in tasks.go).
CapacityProviderName string `json:"capacityProviderName,omitempty"`
Tags []Tag `json:"tags,omitempty"`
Attachments []TaskAttachment `json:"attachments,omitempty"`
Containers []Container `json:"containers,omitempty"`
EnableExecuteCommand bool `json:"enableExecuteCommand,omitempty"`
// AwaitingCapacity marks a PROVISIONING task waiting for a managed-scaling provider to add instances.
AwaitingCapacity bool `json:"awaitingCapacity,omitempty"`
// contains filtered or unexported fields
}
Task represents an ECS task.
type TaskAttachment ¶
type TaskAttachment struct {
ID string `json:"id"`
Type string `json:"type"`
Status string `json:"status"`
Details []KeyValuePair `json:"details,omitempty"`
}
TaskAttachment represents an ENI or other attachment on a task (e.g. Fargate ENI).
type TaskDefinition ¶
type TaskDefinition struct {
ProxyConfiguration *ProxyConfiguration `json:"proxyConfiguration,omitempty"`
RuntimePlatform *RuntimePlatform `json:"runtimePlatform,omitempty"`
EphemeralStorage *EphemeralStorage `json:"ephemeralStorage,omitempty"`
RegisteredAt time.Time `json:"registeredAt"`
TaskDefinitionArn string `json:"taskDefinitionArn"`
Family string `json:"family"`
TaskRoleArn string `json:"taskRoleArn,omitempty"`
ExecutionRoleArn string `json:"executionRoleArn,omitempty"`
NetworkMode string `json:"networkMode,omitempty"`
Status string `json:"status"`
PlatformFamily string `json:"platformFamily,omitempty"`
CPU string `json:"cpu,omitempty"`
Memory string `json:"memory,omitempty"`
IpcMode string `json:"ipcMode,omitempty"`
PidMode string `json:"pidMode,omitempty"`
ContainerDefinitions []ContainerDefinition `json:"containerDefinitions"`
Volumes []Volume `json:"volumes,omitempty"`
PlacementConstraints []PlacementConstraint `json:"placementConstraints,omitempty"`
RequiresCompatibilities []string `json:"requiresCompatibilities,omitempty"`
InferenceAccelerators []InferenceAccelerator `json:"inferenceAccelerators,omitempty"`
Revision int `json:"revision"`
EnableFaultInjection bool `json:"enableFaultInjection,omitempty"`
}
TaskDefinition represents an ECS task definition.
type TaskMetadata ¶
type TaskMetadata struct {
Limits metadataLimits `json:"Limits"`
ContainerInstanceTags map[string]string `json:"ContainerInstanceTags,omitempty"`
TaskTags map[string]string `json:"TaskTags,omitempty"`
Cluster string `json:"Cluster"`
TaskARN string `json:"TaskARN"`
Family string `json:"Family"`
Revision string `json:"Revision"`
DesiredStatus string `json:"DesiredStatus"`
KnownStatus string `json:"KnownStatus"`
AvailabilityZone string `json:"AvailabilityZone"`
LaunchType string `json:"LaunchType"`
ServiceName string `json:"ServiceName,omitempty"`
Containers []ContainerMetadata `json:"Containers"`
}
TaskMetadata is the task metadata v4 task document.
type TaskOverride ¶
type TaskOverride struct {
TaskRoleArn string `json:"taskRoleArn,omitempty"`
ExecutionRoleArn string `json:"executionRoleArn,omitempty"`
CPU string `json:"cpu,omitempty"`
Memory string `json:"memory,omitempty"`
ContainerOverrides []ContainerOverride `json:"containerOverrides,omitempty"`
}
TaskOverride represents overrides for a task run.
type TaskProtection ¶
type TaskProtection struct {
ExpirationDate *time.Time `json:"expirationDate,omitempty"`
TaskArn string `json:"taskArn"`
ProtectionEnabled bool `json:"protectionEnabled"`
}
TaskProtection represents the protection state for a task.
type TaskRunner ¶
type TaskRunner interface {
RunTask(task *Task, td *TaskDefinition) error
StopTask(task *Task) error
}
TaskRunner is the interface for launching container tasks. The no-op implementation is used when no runtime is configured.
func NewDockerRunner ¶
func NewDockerRunner(ctx context.Context) (TaskRunner, error)
NewDockerRunner creates a TaskRunner backed by the local Docker daemon. It uses the standard DOCKER_HOST / DOCKER_TLS_VERIFY environment variables via client.FromEnv, so it works both locally and inside docker-in-docker.
func NewNoopRunner ¶
func NewNoopRunner() TaskRunner
NewNoopRunner returns a TaskRunner that does nothing.
type TaskSet ¶
type TaskSet struct {
NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
StabilityStatusAt time.Time `json:"stabilityStatusAt"`
Status string `json:"status"`
TaskSetArn string `json:"taskSetArn"`
ID string `json:"id"`
ServiceArn string `json:"serviceArn"`
ClusterArn string `json:"clusterArn"`
TaskDefinition string `json:"taskDefinition"`
ExternalID string `json:"externalId,omitempty"`
PlatformVersion string `json:"platformVersion,omitempty"`
LaunchType string `json:"launchType,omitempty"`
StabilityStatus string `json:"stabilityStatus,omitempty"`
Scale TaskSetScale `json:"scale"`
LoadBalancers []LoadBalancer `json:"loadBalancers,omitempty"`
ServiceRegistries []ServiceRegistry `json:"serviceRegistries,omitempty"`
CapacityProviderStrategy []CapacityProviderStrategyItem `json:"capacityProviderStrategy,omitempty"`
}
TaskSet represents an ECS task set within a service.
type TaskSetScale ¶
TaskSetScale specifies a scale for a task set.
type TaskUsageReader ¶
type TaskUsageReader interface {
// TaskUsage returns the CPU (1024 units per vCPU) and memory bytes in use across the task's containers.
TaskUsage(ctx context.Context, taskArn string) (cpuUnits, memoryBytes float64, ok bool)
}
TaskUsageReader is implemented by runners that can sample a task's live resource use.
type UpdateCapacityProviderInput ¶
type UpdateCapacityProviderInput struct {
AutoScalingGroupProvider *AutoScalingGroupProviderUpdate
Name string
}
UpdateCapacityProviderInput holds input for UpdateCapacityProvider. Note this has no Status or Tags: the real UpdateCapacityProviderRequest only has name, cluster, autoScalingGroupProvider, and managedInstancesProvider.
type UpdateClusterInput ¶
type UpdateClusterInput struct {
ServiceConnectDefaults *ClusterServiceConnectDefaults
Configuration *ClusterConfiguration
Cluster string
Settings []ClusterSetting
}
UpdateClusterInput holds input for UpdateCluster. Note this does not include CapacityProviders/DefaultCapacityProviderStrategy: the real UpdateClusterRequest has no such fields (only cluster, settings, configuration, serviceConnectDefaults) -- capacity-provider association is exclusively managed by the separate PutClusterCapacityProviders operation. configuration is still not modeled by this backend.
type UpdateDaemonInput ¶
type UpdateDaemonInput struct {
DeploymentConfiguration *DaemonDeploymentConfiguration
Critical *bool
DaemonArn string
DaemonTaskDefinitionArn string
PropagateTags string
CapacityProviderArns []string
EnableECSManagedTags bool
EnableExecuteCommand bool
}
UpdateDaemonInput holds input for UpdateDaemon.
type UpdateExpressGatewayServiceInput ¶
type UpdateExpressGatewayServiceInput struct {
NetworkConfiguration *ExpressGatewayServiceNetworkConfiguration
PrimaryContainer *ExpressGatewayContainer
ScalingTarget *ExpressGatewayScalingTarget
CPU *string
Memory *string
HealthCheckPath *string
ExecutionRoleArn *string
TaskDefinitionArn *string
TaskRoleArn *string
ServiceArn string
InfrastructureRoleArn string
}
UpdateExpressGatewayServiceInput holds input for UpdateExpressGatewayService. Mirrors the real UpdateExpressGatewayServiceInput shape: most fields describe the next service-revision configuration (CPU/Memory/HealthCheckPath/ NetworkConfiguration/PrimaryContainer/ScalingTarget/TaskDefinitionArn/ TaskRoleArn/ExecutionRoleArn), while InfrastructureRoleArn is the only field that mutates the service itself rather than spawning a new revision.
type UpdateServiceInput ¶
type UpdateServiceInput struct {
EnableExecuteCommand *bool `json:"enableExecuteCommand,omitempty"`
EnableECSManagedTags *bool `json:"enableECSManagedTags,omitempty"`
DesiredCount *int `json:"desiredCount,omitempty"`
HealthCheckGracePeriodSeconds *int `json:"healthCheckGracePeriodSeconds,omitempty"`
DeploymentConfiguration *DeploymentConfiguration `json:"deploymentConfiguration,omitempty"`
NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
ServiceConnectConfiguration *ServiceConnectConfiguration `json:"serviceConnectConfiguration,omitempty"`
Monitoring *MonitoringConfiguration `json:"monitoring,omitempty"`
Cluster string `json:"cluster,omitempty"`
Service string `json:"service"`
TaskDefinition *string `json:"taskDefinition,omitempty"`
PropagateTags string `json:"propagateTags,omitempty"`
AvailabilityZoneRebalancing string `json:"availabilityZoneRebalancing,omitempty"`
PlatformVersion string `json:"platformVersion,omitempty"`
LoadBalancers []LoadBalancer `json:"loadBalancers,omitempty"`
ServiceRegistries []ServiceRegistry `json:"serviceRegistries,omitempty"`
CapacityProviderStrategy []CapacityProviderStrategyItem `json:"capacityProviderStrategy,omitempty"`
PlacementConstraints []PlacementConstraint `json:"placementConstraints,omitempty"`
PlacementStrategy []PlacementStrategy `json:"placementStrategy,omitempty"`
ForceNewDeployment bool `json:"forceNewDeployment,omitempty"`
}
UpdateServiceInput holds input for UpdateService.
type VersionInfo ¶
type VersionInfo struct {
AgentHash string `json:"agentHash,omitempty"`
AgentVersion string `json:"agentVersion,omitempty"`
DockerVersion string `json:"dockerVersion,omitempty"`
}
VersionInfo is the container agent and Docker version reported at registration.
type Volume ¶
type Volume struct {
Host *HostVolumeProperties `json:"host,omitempty"`
EFSVolumeConfiguration *EFSVolumeConfiguration `json:"efsVolumeConfiguration,omitempty"`
Name string `json:"name"`
ConfiguredAtLaunch bool `json:"configuredAtLaunch,omitempty"`
}
Volume defines a storage volume for a task definition.
type VolumeFrom ¶
type VolumeFrom struct {
SourceContainer string `json:"sourceContainer,omitempty"`
ReadOnly bool `json:"readOnly,omitempty"`
}
VolumeFrom specifies a container whose volumes to mount.
Source Files
¶
- account_settings.go
- agent.go
- asg_resolver.go
- capacity_providers.go
- cloudmap.go
- clusters.go
- container_instances.go
- daemon.go
- deployment.go
- deployment_lifecycle.go
- docker_runner.go
- docker_usage.go
- elb_health.go
- elbv2_targets.go
- errors.go
- events.go
- express_gateway.go
- fis.go
- handler.go
- handler_account_settings.go
- handler_agent_ops.go
- handler_capacity_providers.go
- handler_clusters.go
- handler_container_instances.go
- handler_daemon.go
- handler_express_gateway.go
- handler_service_deployments.go
- handler_services.go
- handler_tags.go
- handler_task_definitions.go
- handler_task_sets.go
- handler_tasks.go
- host_ports.go
- interfaces.go
- janitor.go
- lambda_hooks.go
- lifecycle.go
- logs.go
- managed_scaling.go
- models.go
- persistence.go
- port_ranges.go
- provider.go
- purge.go
- reconciler.go
- region_handler.go
- regions.go
- resource_ledger.go
- rolling_deployment.go
- service_deployments.go
- services.go
- sfn_integration.go
- store.go
- store_setup.go
- tags.go
- task_containers.go
- task_definitions.go
- task_metadata.go
- task_placement.go
- task_runtime.go
- task_sets.go
- taskdef_validation.go
- tasks.go
- utilization.go