AWS Config Rules for Sustainable Cloud Practices
Introduction
AWS Config Rules play a crucial role in ensuring sustainability in the cloud. At AWS, sustainability is a shared responsibility between AWS and its customers. AWS optimizes cloud infrastructure for efficiency, renewable energy sourcing, and water stewardship. Meanwhile, customers must focus on resource optimization, workload efficiency, and minimizing environmental impact.
To support sustainability goals, AWS offers several tools, including the AWS Customer Carbon Footprint Tool to measure emissions and the Well-Architected Framework Sustainability Pillar, which provides best practices. Additionally, services like AWS Graviton Instances and Amazon EC2 Spot Instances help improve efficiency and reduce carbon footprints.
This blog explores how AWS Config Rules can help assess, audit, and evaluate cloud resources against sustainability best practices from the AWS Well-Architected Framework Sustainability Pillar.
Understanding AWS Config
AWS Config is a service that continuously monitors, records, and evaluates AWS resource configurations. It provides:
– Managed rules that help enforce compliance with AWS best practices.
– Custom rules tailored to specific organizational needs.
– Conformance packs, which bundle multiple rules and remediation actions into a single package for scalable deployment.
With AWS Organizations integration, customers can apply conformance packs across multiple accounts, ensuring consistent governance and compliance.
Enforcing Sustainability Best Practices with AWS Config Rules
The Sustainability Pillar of the AWS Well-Architected Framework outlines best practices for optimizing cloud resources. AWS Config helps enforce these practices by continuously validating configurations and identifying areas for improvement. Below are three key sustainability practices and their corresponding AWS Config rules.
1. Managing Data Lifecycle with Automated Policies
Unused data increases storage costs and energy consumption. Implementing automated lifecycle policies helps manage data effectively. Amazon S3 Lifecycle configurations allow organizations to transition objects to lower-cost storage tiers or delete unnecessary data automatically.
Within AWS Config, a rule can be used to ensure lifecycle configurations are applied across Amazon S3 buckets.
“`
# Rule-intent: Rule checks that lifecycle policies are configured for Amazon S3 bucket
#
# Expectations:
# a) COMPLIANT when S3 bucket lifecycle is configured
# b) NONCOMPLIANT when S3 bucket lifecycle is not configured
# c) NOTAPPLICABLE when there is no S3 bucket
rule checkBucketVersioningEnabled {
supplementaryConfiguration.BucketLifecycleConfiguration exists
<>
}
“`
2. Optimizing Code for Performance and Efficiency
Efficient code execution reduces compute power and enhances performance. Amazon RDS Performance Insights helps identify inefficient queries that impact database performance. Enabling this feature allows organizations to analyze workloads and optimize database operations.
The AWS Config rule below checks that Performance Insights is enabled for RDS databases, so you can monitor your databases for continuous improvement.
“`
# Rule-intent: Rule checks that performance insights are enabled
#
# Expectations:
# a) COMPLIANT when performance insights is enabled for RDS DBCluster or RDS DBInstance
# b) NONCOMPLIANT when performance insights is not enabled for RDS DBCluster or RDS DBInstance
##Check whether performance Insights is enabled.
rule rds_cluster_iam_authentication_enabled {
configuration.performanceInsightsEnabled == true
<< Database cluster does not have performance insight enabled >>
}
“`
3. Reducing Data Movement for Efficient Networking
Optimizing data transfer reduces networking overhead and improves sustainability. Enabling API Gateway compression minimizes data movement by reducing payload size before transmission.
This example rule checks that compression is enabled for Amazon API Gateway Rest APIs.
“`
# Rule-intent: Rule checks compression is enabled for a Rest API
#
# Expectations:
# a) COMPLIANT when compression is enabled
# b) NONCOMPLIANT when compression is not enabled
rule rest_api_compression_exists {
configuration.minimumCompressionSize exists
}
“`
Scaling Sustainability Compliance with Conformance Packs
Organizations can streamline sustainability efforts by deploying AWS Config rules through Conformance Packs. These pre-packaged rule sets allow consistent governance across multiple accounts. Below is an example of a sustainability-focused conformance pack that includes key AWS Config rules:
Service Description of Config Rule Sustainability Pillar Best Practice
API Gateway Rule checks compression is enabled for a Rest API
CloudFront Rule checks that compression is enabled (Note this rule must be deployed in us-east-1)
EBS Rule checks that EBS delete on instance termination is enabled
EC2 Rule checks that EC2 security groups do not have port 22 open for SSH, so Session Manager is used instead
EFS Rule checks that EFS Lifecycle Management is enabled
Lambda Rule checks that Lambda functions are using AWS Graviton-based processors
RDS Rule checks that RDS instances are using AWS Graviton-based processors
RDS Rule check that performance insight is enabled
S3 Rule checks that lifecycle configuration exists for Amazon S3 buckets
The Config rules above are included in a conformance pack that can be found here along with instructions to implement.
Customers can expand on this set of example rules to evaluate their workloads against the additional sustainability best practices aligned with their improvement goals. Customers have the ability to adapt these rules and create custom Config rules for the resources within their environment. The conformance pack can then be used to apply the new rules across the organization.
Conclusion
AWS Config rules are a powerful tool for enforcing sustainable cloud practices. By implementing AWS Config rules, organizations can align with the AWS Well-Architected Sustainability Pillar, monitor workloads efficiently, and optimize resource usage. Deploying conformance packs enables scalable governance, ensuring compliance across multiple AWS accounts.
To achieve Optimizing Cloud Governance with AWS Config, businesses should continuously refine their cloud infrastructure using AWS Config’s automated monitoring capabilities. By leveraging these best practices, companies can enhance sustainability, reduce costs, and improve overall cloud efficiency.
Do you like to read more educational content? Read our blogs at Cloudastra Technologies or contact us for business enquiry at Cloudastra Contact Us.