App-FargateStack
view release on metacpan or search on metacpan
lib/App/FargateStack/Pod.pm view on Meta::CPAN
If the checksum has not changed, it will skip the update to avoid
unnecessary API calls.
=back
This model gives you the best of both worlds: the "minimal
configuration, maximum results" of a secure default, and the full
"transparent box" control to customize your security posture as your
application's needs evolve.
=head3 Conflict and Drift Management
The framework includes robust safety checks to prevent accidental data
loss. If it detects that the Web ACL has been modified in the AWS
Console I<and> you have also modified your local F<web-acl.json> file,
it will detect the state conflict, refuse to make any changes, and
provide a clear error message with instructions on how to resolve it.
=head3 Estimated Cost
The default WAF configuration is designed to provide a strong security
baseline while remaining cost-effective. When you enable WAF without
specifying any C<managed_rules>, the framework applies the C<default>
bundle, which includes the C<base> and C<sql> rule sets.
The approximate monthly cost for this default configuration is
B<~$9.00 per month>, plus per-request charges.
The cost is broken down as follows:
=over 4
=item * B<$5.00 / month> for the Web ACL itself.
=item * B<$4.00 / month> for the four AWS Managed Rule Groups included
in the C<default> bundle (3 in 'base', 1 in 'sql').
=item * B<$0.60 / per 1 million requests> processed by the Web ACL.
=back
B<Warning:> Enabling the C<premium> rule set will incur significant
additional monthly and per-request fees for services like Bot Control
and Account Takeover Prevention. Always review the L<AWS WAF
pricing|https://aws.amazon.com/waf/pricing/> page before enabling
premium features.
=head2 Roadmap for HTTP Services
=over 4
=item * path based routing on ALB listeners
=back
=head1 AUTOSCALING
=head2 Overview
For services that experience variable load, such as HTTP applications or
background job processors, C<App::FargateStack> can automate the process of
scaling the number of running tasks up or down to meet demand. This ensures
high availability during traffic spikes and saves costs during quiet periods.
The framework integrates with AWS Application Auto Scaling to provide target
tracking scaling policies. This allows you to define a target metric - such as
average CPU utilization or the number of requests per minute - and the framework
will automatically manage the number of Fargate tasks to keep that metric at
your desired level.
=head2 Enabling Autoscaling
To enable autoscaling for a service, add an C<autoscaling> block to its task
configuration in your .yml configuration file.
tasks:
my-service:
# ... other task settings ...
autoscaling:
min_capacity: 1
max_capacity: 10
cpu: 60
=head2 Configuration Parameters
The C<autoscaling> block accepts the following keys:
=over
=item * B<min_capacity> (Required)
The minimum number of tasks to keep running at all times. The service will
never scale in below this number.
=item * B<max_capacity> (Required)
The maximum number of tasks that the service can scale out to. This acts as
a safeguard to control costs.
=item * B<cpu> OR B<requests> (Required, mutually exclusive)
You must specify exactly one scaling metric.
=over
=item * C<cpu>: The target average CPU utilization percentage across all tasks in
the service. Valid values are between 1 and 100.
=item * C<requests>: The target number of requests per minute for each task. This
is only valid for tasks of type C<http> or C<https> that are behind an
Application Load Balancer.
=back
=item * B<scale_in_cooldown> (Optional)
The amount of time, in seconds, to wait after a scale-in activity before
another scale-in activity can start. This prevents the service from scaling
in too aggressively.
Default: C<300>
( run in 2.021 seconds using v1.01-cache-2.11-cpan-f56aa216473 )