Querying exactly EvaluationPeriods buckets fell back to TreatMissingData as soon
as one was empty. Real datapoints reaching further back now decide the state
first, and the premature-transition rule is honored.
Fixes#2700
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
Adds a generic CloudWatch alarm evaluator plus an ECS CapacityAdjuster,
so a firing policy calls UpdateService to change desiredCount instead
of sitting inert. Adds DescribeScalingActivities to observe the result.
Closes#2565
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(applicationautoscaling): add Application Auto Scaling control plane
Adds a services/applicationautoscaling package emulating the Application
Auto Scaling API (JSON 1.1, AnyScaleFrontendService. target prefix,
application-autoscaling signing name). This is a distinct service from the
existing EC2 Auto Scaling package, which speaks Query under the
autoscaling signing name.
Implements the nine actions Terraform exercises: RegisterScalableTarget,
DescribeScalableTargets, DeregisterScalableTarget, PutScalingPolicy,
DescribeScalingPolicies, DeleteScalingPolicy, and the ListTagsForResource
/ TagResource / UntagResource trio.
Notable behaviours:
- Identity is the (ServiceNamespace, ResourceId, ScalableDimension)
triple; RegisterScalableTarget upserts on it and leaves unsupplied
parameters unchanged, matching AWS.
- ScalableTargetARN uses the application-autoscaling service name while
PolicyARN uses plain autoscaling and embeds the resource path and policy
name — the two ARN families genuinely differ.
- Tagging resolves by ScalableTargetARN because the Terraform provider's
transparent-tagging interceptor calls ListTagsForResource on every read,
keyed on the ARN it reads from DescribeScalableTargets.
- Target-tracking policies create the real pair of CloudWatch alarms AWS
creates on the caller's behalf; deregistering a scalable target deletes
its policies and their alarms.
- Optional configuration fields are only echoed back when supplied, so
Terraform never sees a value it did not configure.
Scaling policies are stored and described but inert: nothing evaluates
them and no capacity is adjusted, mirroring EC2 Auto Scaling's existing
PutScalingPolicy. This is documented in docs/services/applicationautoscaling.md.
Closes#2157
* refactor(applicationautoscaling): stop exposing the scalable target's tag map
getTags() handed out the live internal map, and the service mutated it in
place at three call sites. listTagsForResource also returned that same
live reference out to the handler layer, so a caller could alter stored
state without going through the service.
getTags() now returns an unmodifiable view, with putTags/removeTags for
the mutations the service actually needs, and a test pins the read-only
contract.
Reported by github-code-quality on #2159.