Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS extended support pricing for old RDS closes #170 #174

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion controls/rds.sp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ benchmark "rds" {
control.long_running_rds_db_instances,
control.rds_db_instance_with_graviton,
control.rds_db_low_connection_count,
control.rds_db_low_utilization
control.rds_db_low_utilization,
control.rds_mysql_postresql_db_no_unsupported_version
]

tags = merge(local.rds_common_tags, {
Expand Down Expand Up @@ -240,3 +241,39 @@ control "rds_db_instance_with_graviton" {
EOQ
}

control "rds_mysql_postresql_db_no_unsupported_version" {
title = "RDS MySQL and PostgreSQL DB instances with unsupported version should be reviewed"
description = "MySQL 5.7 and PostgreSQL 11 database instances running on Amazon Aurora and Amazon Relational Database Service (Amazon RDS) will be automatically enrolled into Amazon RDS Extended Support. This automatic enrollment may mean that you will experience higher charges when RDS Extended Support begins. You can avoid these charges by upgrading your database to a newer DB version."
severity = "low"

tags = merge(local.rds_common_tags, {
class = "deprecated"
})

sql = <<-EOQ
select
arn as resource,
engine_version,
engine,
case
when not engine ilike any (array ['%mysql%', '%postgres%']) then 'skip'
when
(engine like '%mysql' and engine_version like '5.7.%' )
or (engine like '%postgres%' and engine_version like '11.%') then 'alarm'
else 'ok'
end as status,
case
when not engine ilike any (array ['%mysql%', '%postgres%']) then title || ' is of ' || engine || ' engine type.'
when
(engine like '%mysql' and engine_version like '5.7.%' )
or (engine like '%postgres%' and engine_version like '11.%') then title || ' is using RDS Extended Support.'
else title || ' is not using RDS Extended Support.'
end as reason
${local.tag_dimensions_sql}
${local.common_dimensions_sql}
from
aws_rds_db_instance;
EOQ
}