Control: Directory Service directories manual snapshots limit should not be less than 2
Description
Ensure you keep track of the number of manual snapshots for your monitor to guarantee sufficient capacity when it becomes necessary.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.directory_service_directory_snapshots_limit_2
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.directory_service_directory_snapshots_limit_2 --share
SQL
This control uses a named query:
select arn as resource, case when snapshot_limit ->> 'ManualSnapshotsLimitReached' = 'true' then 'alarm' when ((snapshot_limit ->> 'ManualSnapshotsLimit')::int - (snapshot_limit ->> 'ManualSnapshotsCurrentCount')::int) <= 2 then 'alarm' else 'ok' end as status, case when snapshot_limit ->> 'ManualSnapshotsLimitReached' = 'true' then title || ' has reached ' || (snapshot_limit ->> 'ManualSnapshotsLimit') || ' snapshots limit.' when ((snapshot_limit ->> 'ManualSnapshotsLimit')::int - (snapshot_limit ->> 'ManualSnapshotsCurrentCount')::int) <= 2 then title || ' is about to reach its ' || (snapshot_limit ->> 'ManualSnapshotsLimit') || ' snapshot limit.' else title || ' is using ' || (snapshot_limit ->> 'ManualSnapshotsCurrentCount') || ' out of ' || (snapshot_limit ->> 'ManualSnapshotsLimit') || ' snapshots limit.' end as reason , region, account_idfrom aws_directory_service_directory;