spendlens controls

Rightsizing and company standards (spendlens rightsize)

41 controls.

Service Control What it checks Parameters (sizing.*) $ estimate
cloudfront cloudfront_distribution_price_class_all CloudFront distributions using PriceClass_All should be reviewed - -
cloudwatch cloudwatch_log_group_kms_policy CloudWatch log groups should be KMS-encrypted when required by policy cloudwatch_log_group_kms_required -
cloudwatch cloudwatch_log_group_retention_policy CloudWatch log groups should not keep logs longer than the company maximum cloudwatch_log_group_retention_max_days -
dynamodb dynamodb_table_without_autoscaling Provisioned DynamoDB tables should use auto scaling or on-demand - -
ebs ebs_volume_gp2 EBS gp2 volumes should be migrated to gp3 - yes
ebs ebs_volume_high_iops Provisioned-IOPS EBS volumes above the company maximum should be reviewed ebs_volume_max_iops -
ebs ebs_volume_io1 EBS io1 volumes should be migrated to io2 - -
ebs ebs_volume_low_usage EBS volumes with very low I/O should be reviewed ebs_volume_ops_low, ebs_volume_ops_high -
ebs ebs_volume_oversized EBS volumes larger than the company maximum should be reviewed ebs_volume_max_size_gb -
ebs ebs_volume_piops_to_gp3 Provisioned-IOPS volumes with modest IOPS should move to gp3 ebs_volume_piops_to_gp3_max_iops yes
ec2 ec2_instance_ebs_delete_on_termination EC2 instance EBS volumes should be deleted on termination - -
ec2 ec2_instance_low_utilization EC2 instances with low CPU utilization should be downsized ec2_cpu_low, ec2_cpu_high yes
ec2 ec2_instance_older_generation EC2 instances should not use previous-generation instance families - yes
ec2 ec2_instance_reservation_candidate Long-running EC2 instances should be covered by a reservation or Savings Plan ec2_running_instance_age_max_days yes
ec2 ec2_instance_type_not_allowed EC2 instances should use an allowed instance type ec2_allowed_instance_types -
ec2 ec2_instance_without_graviton EC2 instances should consider Graviton (arm64) - yes
ec2 ec2_reserved_instance_expiring EC2 reserved instances expiring soon should be reviewed ec2_reserved_instance_expiration_warning_days -
ecs ecs_cluster_low_utilization ECS clusters with low CPU utilization should be consolidated ecs_cluster_cpu_low, ecs_cluster_cpu_high -
ecs ecs_container_instance_without_graviton ECS container instances should consider Graviton - -
ecs ecs_service_task_count_policy ECS services should run the number of tasks required for their environment ecs_desired_tasks_by_env -
ecs ecs_service_without_autoscaling Fargate ECS services should use auto scaling - -
ecs ecs_task_cpu_over_max ECS tasks should not exceed the company vCPU maximum ecs_task_max_vcpu -
ecs ecs_task_memory_over_max ECS tasks should not exceed the company memory maximum ecs_task_max_memory_gb -
eks eks_node_group_without_graviton EKS managed node groups should consider Graviton - -
elasticache elasticache_cluster_reservation_candidate Long-running ElastiCache clusters should be covered by reserved nodes elasticache_running_age_max_days, elasticache_running_age_warning_days -
emr emr_instance_group_older_generation EMR instance groups should not use previous-generation instance types - -
lambda lambda_function_excessive_timeout Lambda timeouts far above the average duration should be reduced lambda_timeout_max_multiple -
lambda lambda_function_high_error_rate Lambda functions with a high error rate should be investigated lambda_error_rate_max_pct -
lambda lambda_function_without_graviton Lambda functions should consider arm64 (Graviton) - -
rds rds_instance_backup_retention_policy RDS backup retention should not exceed the environment policy rds_backup_retention_max_days_by_env -
rds rds_instance_class_not_allowed RDS instances should use an allowed instance class rds_allowed_instance_classes yes
rds rds_instance_extended_support_version RDS instances on versions in paid Extended Support should be upgraded rds_extended_support_versions -
rds rds_instance_low_utilization RDS instances with low CPU utilization should be downsized rds_cpu_low, rds_cpu_high yes
rds rds_instance_multi_az_policy RDS Multi-AZ should match the environment policy rds_multi_az_by_env yes
rds rds_instance_performance_insights_policy RDS Performance Insights should match the environment policy rds_performance_insights_by_env -
rds rds_instance_reservation_candidate Long-running RDS instances should be covered by reserved instances rds_running_age_max_days, rds_running_age_warning_days yes
rds rds_instance_without_graviton RDS instances should consider Graviton classes - yes
redshift redshift_cluster_low_utilization Redshift clusters with low CPU utilization should be downsized redshift_cpu_low, redshift_cpu_high -
redshift redshift_cluster_reservation_candidate Long-running Redshift clusters should be covered by reserved nodes redshift_running_age_max_days, redshift_running_age_warning_days -
redshift redshift_cluster_without_pause_schedule Redshift clusters should pause outside working hours - -
route53 route53_record_low_ttl Route 53 records with low TTLs should be reviewed route53_record_min_ttl -

Idle and orphaned resources (spendlens waste)

24 controls.

Service Control What it checks Parameters (sizing.*) $ estimate
cloudtrail cloudtrail_trail_redundant Redundant CloudTrail trails should be removed - -
dynamodb dynamodb_table_stale DynamoDB tables without recent changes should be reviewed dynamodb_stale_max_days -
ebs ebs_snapshot_old EBS snapshots older than the retention maximum should be deleted ebs_snapshot_age_max_days yes
ebs ebs_snapshot_orphaned EBS snapshots whose source volume is gone and are not used by an AMI should be reviewed - yes
ebs ebs_volume_on_stopped_instance EBS volumes attached only to stopped instances should be reviewed - yes
ebs ebs_volume_unattached Unattached EBS volumes should be deleted or snapshotted - yes
ec2 ec2_ami_old Old self-owned AMIs should be deregistered with their snapshots ec2_ami_age_max_days yes
ec2 ec2_instance_stopped_long EC2 instances stopped for a long time should be terminated or snapshotted ec2_stopped_instance_max_days -
ecr ecr_repository_unused ECR repositories whose images are never pulled should be cleaned up ecr_image_pull_max_days -
ecr ecr_repository_without_lifecycle ECR repositories should have a lifecycle policy - -
elb ec2_application_load_balancer_unused Application load balancers without registered targets should be deleted - yes
elb ec2_classic_load_balancer_unused Classic load balancers without registered instances should be deleted - yes
elb ec2_gateway_load_balancer_unused Gateway load balancers without registered targets should be deleted - yes
elb ec2_network_load_balancer_unused Network load balancers without registered targets should be deleted - yes
emr emr_cluster_idle EMR clusters idle for 30+ minutes should be terminated - -
kms kms_key_disabled Disabled customer-managed KMS keys should be scheduled for deletion - yes
rds rds_instance_low_connections RDS instances with few or no connections should be reviewed rds_avg_connections_min yes
rds rds_snapshot_orphaned Manual RDS snapshots whose source instance is gone should be reviewed rds_snapshot_orphaned_max_days yes
route53 route53_health_check_unused Route 53 health checks not referenced by any record should be deleted - yes
s3 s3_bucket_versioned_without_lifecycle Versioned S3 buckets should expire noncurrent versions - -
s3 s3_bucket_without_lifecycle S3 buckets should have lifecycle rules - -
secretsmanager secretsmanager_secret_unused Secrets Manager secrets not used recently should be deleted secretsmanager_unused_max_days yes
vpc vpc_eip_unattached Unattached Elastic IPs should be released - yes
vpc vpc_nat_gateway_unused NAT gateways without traffic should be deleted - yes

Tag compliance (spendlens tags)

5 checks x 70 resource types = 350 controls, named tags_<check>_<resource_type>.

Check Parameter
mandatory tagging.* -> mandatory_tags
untagged -
prohibited tagging.* -> prohibited_tags
limit tagging.* -> tag_limit
expected_values tagging.* -> expected_tag_values

Resource types: accessanalyzer_analyzer, api_gateway_stage, cloudfront_distribution, cloudtrail_trail, cloudwatch_alarm, cloudwatch_log_group, codebuild_project, codecommit_repository, codepipeline_pipeline, config_rule, dax_cluster, directory_service_directory, dms_replication_instance, dynamodb_table, ebs_snapshot, ebs_volume, ec2_application_load_balancer, ec2_classic_load_balancer, ec2_gateway_load_balancer, ec2_instance, ec2_network_load_balancer, ec2_reserved_instance, ecr_repository, ecs_container_instance, ecs_service, efs_file_system, eks_addon, eks_cluster, eks_identity_provider_config, elastic_beanstalk_application, elastic_beanstalk_environment, elasticache_cluster, elasticsearch_domain, eventbridge_rule, guardduty_detector, iam_role, iam_server_certificate, iam_user, inspector_assessment_template, kinesis_firehose_delivery_stream, kms_key, lambda_function, rds_db_cluster, rds_db_cluster_parameter_group, rds_db_cluster_snapshot, rds_db_instance, rds_db_option_group, rds_db_parameter_group, rds_db_snapshot, rds_db_subnet_group, redshift_cluster, route53_domain, route53_resolver_endpoint, s3_bucket, sagemaker_endpoint_configuration, sagemaker_model, sagemaker_notebook_instance, sagemaker_training_job, secretsmanager_secret, ssm_parameter, vpc, vpc_eip, vpc_nat_gateway, vpc_network_acl, vpc_security_group, vpc_vpn_connection, wafv2_ip_set, wafv2_regex_pattern_set, wafv2_rule_group, wafv2_web_acl