This project provisions and configures the Cloud Carbon Footprint.
Global greenhouse gas emissions from the technology sector are equal to or greater than those from the aviation industry, standing at about 3% for ICT and 2% for aviation, respectively. Within ICT, data centers account for about 1% of greenhouse gas emissions and global electricity use. Currently, most cloud providers do not disclose energy or carbon emissions from cloud usage to their customers (at an aggregate or individual level), which can be a challenge for organizations wishing to establish a baseline and reduce their carbon footprint. This application is a starting point to enable organizations to have greater visibility into their emissions across various cloud providers.
To provide visibility and tools to measure, monitor, and reduce carbon emissions in the cloud. Cloud usage in estimated energy consumption and carbon emissions, producing metrics and carbon savings estimates that can be shared with employees, investors, and other stakeholders.
tofu inittofu plantofu apply- Created user
svc-cloud-carbon-footprintwith the policies in the folder./policies/and access key for application access to billing resources. - In Billing and Cost Management >> Cost and Usage Reports, a report was created with the name
export-cloud-carbon-footprintwith the option of report data integration >> Amazon Athena, this report was directed to the S3 bucketbilling-cloud-carbon-footprint. - After generating the first report, which takes around 24 hours, in the bucket
billing-cloud-carbon-footprint, a template file.yamlwith the configurations for Amazon Athena via CloudFormation is generated. A stack namedstack-athena-cloud-carbon-footprintwas created for the AWS Athena settings, which generates its queries and sends them to the S3 bucketquery-cloud-carbon-footprint.
- Create a user with reading and writing in the CCF database.
- In the secret MONGODB_URI use the model: mongodb+srv://user:password@cluster-name.
All variables are configured as EKS secrets of type Opaque
| Name | Description |
|---|---|
| AWS_DEFAULT_REGION | Region definition |
| AWS_ACCESS_KEY_ID | Billing account access key |
| AWS_SECRET_ACCESS_KEY | Billing account access secret |
| AWS_BILLING_ACCOUNT_ID | Billing account ID |
| AWS_BILLING_ACCOUNT_NAME | Billing account name |
| AWS_USE_BILLING_DATA | True or False |
| AWS_ATHENA_DB_NAME | Database name |
| AWS_ATHENA_DB_TABLE | Table name |
| AWS_ATHENA_QUERY_RESULT_LOCATION | Query destination S3 |
| AWS_ATHENA_REGION | Athena region definition |
| CACHE_MODE | cache mode (MONGODB) |
| MONGODB_URI | URI mondodb access |
Billing report generated once daily after midnight.
opentofu
1.6.1
Name: Diego Alves Dias
E-mail: [email protected]
Date: 25/04/2024
Name:
E-mail:
Date: