Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:19:03 +08:00
commit 86b29444ff
12 changed files with 455 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
# Assets
Bundled resources for cloud-cost-optimizer skill
- [ ] cost_report_template.csv: A CSV template for generating cost reports.
- [ ] cost_report_template.pdf: A PDF template for generating cost reports.
- [ ] optimization_recommendation_template.json: A JSON template for optimization recommendations.
- [ ] example_cost_report.csv: An example cost report for demonstration purposes.

View File

@@ -0,0 +1,23 @@
# Cloud Cost Report Template
# This CSV file provides a template for generating cost reports.
# Each row represents a cost item.
#
# Columns:
# - Date: The date of the cost (YYYY-MM-DD).
# - Account: The account or project associated with the cost.
# - Service: The cloud service used (e.g., EC2, S3, RDS).
# - Region: The AWS region (e.g., us-east-1, eu-west-1). Use 'Global' if applicable.
# - Item: A descriptive name for the cost item.
# - Cost: The cost in USD.
# - Unit: The unit of measurement for the item (e.g., hours, GB, requests). Leave blank if not applicable.
# - Quantity: The quantity consumed. Leave blank if not applicable.
# - Notes: Any additional notes or descriptions.
#
# Example usage:
# 2023-10-26,ProjectA,EC2,us-east-1,Instance m5.large,1.20,hours,10,Compute costs for web server
# 2023-10-26,ProjectB,S3,us-west-2,Storage,0.50,GB,100,Storage costs for backups
# 2023-10-26,ProjectA,RDS,us-east-1,Database instance,2.50,hours,5,Database costs
# 2023-10-26,ProjectC,Lambda,Global,Function invocations,0.10,requests,10000,Lambda function costs
Date,Account,Service,Region,Item,Cost,Unit,Quantity,Notes
#YYYY-MM-DD,AccountName,ServiceName,RegionName,ItemDescription,CostInUSD,UnitOfMeasure,QuantityConsumed,AdditionalNotes
1 # Cloud Cost Report Template
2 # This CSV file provides a template for generating cost reports.
3 # Each row represents a cost item.
4 #
5 # Columns:
6 # - Date: The date of the cost (YYYY-MM-DD).
7 # - Account: The account or project associated with the cost.
8 # - Service: The cloud service used (e.g., EC2, S3, RDS).
9 # - Region: The AWS region (e.g., us-east-1, eu-west-1). Use 'Global' if applicable.
10 # - Item: A descriptive name for the cost item.
11 # - Cost: The cost in USD.
12 # - Unit: The unit of measurement for the item (e.g., hours, GB, requests). Leave blank if not applicable.
13 # - Quantity: The quantity consumed. Leave blank if not applicable.
14 # - Notes: Any additional notes or descriptions.
15 #
16 # Example usage:
17 # 2023-10-26,ProjectA,EC2,us-east-1,Instance m5.large,1.20,hours,10,Compute costs for web server
18 # 2023-10-26,ProjectB,S3,us-west-2,Storage,0.50,GB,100,Storage costs for backups
19 # 2023-10-26,ProjectA,RDS,us-east-1,Database instance,2.50,hours,5,Database costs
20 # 2023-10-26,ProjectC,Lambda,Global,Function invocations,0.10,requests,10000,Lambda function costs
21 Date,Account,Service,Region,Item,Cost,Unit,Quantity,Notes
22 #YYYY-MM-DD,AccountName,ServiceName,RegionName,ItemDescription,CostInUSD,UnitOfMeasure,QuantityConsumed,AdditionalNotes

View File

@@ -0,0 +1,145 @@
%PDF-1.7
%âãÏÓ
1 0 obj
<< /Type /Catalog
/Pages 2 0 R
>>
endobj
2 0 obj
<< /Type /Pages
/Kids [ 3 0 R ]
/Count 1
>>
endobj
3 0 obj
<< /Type /Page
/Parent 2 0 R
/MediaBox [0 0 612 792]
/Contents 4 0 R
/Resources << /ProcSet [/PDF /Text]
/Font << /F1 5 0 R >>
>>
>>
endobj
4 0 obj
<< /Length 673 >>
stream
BT
/F1 24 Tf % Set font and size
72 720 Td % Set starting position
(Cloud Cost Optimization Report) Tj
ET
BT
/F1 12 Tf % Smaller font for details
72 680 Td
(Report Date: [REPORT_DATE]) Tj
ET
BT
72 660 Td
(Generated by: Cloud Cost Optimizer Plugin) Tj
ET
BT
72 620 Td
(Summary:) Tj
ET
BT
72 600 Td
(Total Estimated Savings: [TOTAL_ESTIMATED_SAVINGS]) Tj
ET
BT
72 580 Td
(Number of Recommendations: [NUMBER_OF_RECOMMENDATIONS]) Tj
ET
BT
72 540 Td
(Detailed Recommendations:) Tj
ET
BT
/F1 10 Tf % Even smaller for the table
72 520 Td
(Resource ID | Recommendation | Estimated Savings | Priority) Tj
ET
BT
72 500 Td
(----------------------------------------------------------------------------------) Tj
ET
BT
72 480 Td
([RESOURCE_ID_1] | [RECOMMENDATION_1] | [ESTIMATED_SAVINGS_1] | [PRIORITY_1]) Tj
ET
BT
72 460 Td
([RESOURCE_ID_2] | [RECOMMENDATION_2] | [ESTIMATED_SAVINGS_2] | [PRIORITY_2]) Tj
ET
BT
72 440 Td
([RESOURCE_ID_3] | [RECOMMENDATION_3] | [ESTIMATED_SAVINGS_3] | [PRIORITY_3]) Tj
ET
BT
72 400 Td
(Disclaimer: These are estimates and actual savings may vary.) Tj
ET
BT
72 380 Td
(For further details, please consult the plugin documentation.) Tj
ET
BT
72 340 Td
(End of Report) Tj
ET
endstream
endobj
5 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F1
/BaseFont /Helvetica
/Encoding /MacRomanEncoding
>>
endobj
6 0 obj
<< /Producer (PDFSharp 1.50.5147 (www.pdfsharp.com))
/CreationDate (D:20241027120000) % Replace with actual date
>>
endobj
xref
0 7
0000000000 65535 f
0000000009 00000 n
0000000058 00000 n
0000000110 00000 n
0000000283 00000 n
0000000965 00000 n
0000001046 00000 n
trailer
<< /Size 7
/Root 1 0 R
/Info 6 0 R
>>
startxref
1142
%%EOF

View File

@@ -0,0 +1,23 @@
# Example Cost Report - Cloud Cost Optimizer Plugin
# This file demonstrates the format of cost reports generated by the plugin.
# Replace the placeholders with actual data from your cloud provider.
# Fields: Date, Account ID, Resource ID, Resource Type, Region, Service, Cost, Currency, Usage Unit, Usage Amount
Date,Account ID,Resource ID,Resource Type,Region,Service,Cost,Currency,Usage Unit,Usage Amount
2024-01-01,123456789012,i-0abcdef1234567890,EC2 Instance,us-east-1,Compute,10.50,USD,Instance Hour,168
2024-01-01,123456789012,arn:aws:s3:::my-bucket,S3 Bucket,us-east-1,Storage,2.75,USD,GB-Month,100
2024-01-02,123456789012,i-0abcdef1234567890,EC2 Instance,us-east-1,Compute,10.50,USD,Instance Hour,168
2024-01-02,123456789012,arn:aws:s3:::my-bucket,S3 Bucket,us-east-1,Storage,2.75,USD,GB-Month,100
2024-01-03,123456789012,i-0abcdef1234567890,EC2 Instance,us-east-1,Compute,10.50,USD,Instance Hour,168
2024-01-03,123456789012,arn:aws:s3:::my-bucket,S3 Bucket,us-east-1,Storage,2.75,USD,GB-Month,100
2024-01-04,123456789012,i-0abcdef1234567890,EC2 Instance,us-east-1,Compute,10.50,USD,Instance Hour,168
2024-01-04,123456789012,arn:aws:s3:::my-bucket,S3 Bucket,us-east-1,Storage,2.75,USD,GB-Month,100
2024-01-05,123456789012,i-0abcdef1234567890,EC2 Instance,us-east-1,Compute,10.50,USD,Instance Hour,168
2024-01-05,123456789012,arn:aws:s3:::my-bucket,S3 Bucket,us-east-1,Storage,2.75,USD,GB-Month,100
2024-01-06,123456789012,i-0abcdef1234567890,EC2 Instance,us-east-1,Compute,10.50,USD,Instance Hour,168
2024-01-06,123456789012,arn:aws:s3:::my-bucket,S3 Bucket,us-east-1,Storage,2.75,USD,GB-Month,100
2024-01-07,123456789012,i-0abcdef1234567890,EC2 Instance,us-east-1,Compute,10.50,USD,Instance Hour,168
2024-01-07,123456789012,arn:aws:s3:::my-bucket,S3 Bucket,us-east-1,Storage,2.75,USD,GB-Month,100
# Add more rows as needed. Make sure the data types match the column headers.
# Consider adding columns for tags or other relevant metadata.
1 # Example Cost Report - Cloud Cost Optimizer Plugin
2 # This file demonstrates the format of cost reports generated by the plugin.
3 # Replace the placeholders with actual data from your cloud provider.
4 # Fields: Date, Account ID, Resource ID, Resource Type, Region, Service, Cost, Currency, Usage Unit, Usage Amount
5 Date,Account ID,Resource ID,Resource Type,Region,Service,Cost,Currency,Usage Unit,Usage Amount
6 2024-01-01,123456789012,i-0abcdef1234567890,EC2 Instance,us-east-1,Compute,10.50,USD,Instance Hour,168
7 2024-01-01,123456789012,arn:aws:s3:::my-bucket,S3 Bucket,us-east-1,Storage,2.75,USD,GB-Month,100
8 2024-01-02,123456789012,i-0abcdef1234567890,EC2 Instance,us-east-1,Compute,10.50,USD,Instance Hour,168
9 2024-01-02,123456789012,arn:aws:s3:::my-bucket,S3 Bucket,us-east-1,Storage,2.75,USD,GB-Month,100
10 2024-01-03,123456789012,i-0abcdef1234567890,EC2 Instance,us-east-1,Compute,10.50,USD,Instance Hour,168
11 2024-01-03,123456789012,arn:aws:s3:::my-bucket,S3 Bucket,us-east-1,Storage,2.75,USD,GB-Month,100
12 2024-01-04,123456789012,i-0abcdef1234567890,EC2 Instance,us-east-1,Compute,10.50,USD,Instance Hour,168
13 2024-01-04,123456789012,arn:aws:s3:::my-bucket,S3 Bucket,us-east-1,Storage,2.75,USD,GB-Month,100
14 2024-01-05,123456789012,i-0abcdef1234567890,EC2 Instance,us-east-1,Compute,10.50,USD,Instance Hour,168
15 2024-01-05,123456789012,arn:aws:s3:::my-bucket,S3 Bucket,us-east-1,Storage,2.75,USD,GB-Month,100
16 2024-01-06,123456789012,i-0abcdef1234567890,EC2 Instance,us-east-1,Compute,10.50,USD,Instance Hour,168
17 2024-01-06,123456789012,arn:aws:s3:::my-bucket,S3 Bucket,us-east-1,Storage,2.75,USD,GB-Month,100
18 2024-01-07,123456789012,i-0abcdef1234567890,EC2 Instance,us-east-1,Compute,10.50,USD,Instance Hour,168
19 2024-01-07,123456789012,arn:aws:s3:::my-bucket,S3 Bucket,us-east-1,Storage,2.75,USD,GB-Month,100
20 # Add more rows as needed. Make sure the data types match the column headers.
21 # Consider adding columns for tags or other relevant metadata.

View File

@@ -0,0 +1,66 @@
{
"_comment": "Template for a cloud cost optimization recommendation",
"recommendationId": "OPT-AWS-EC2-001",
"resourceId": "i-0abcdef1234567890",
"resourceType": "EC2 Instance",
"region": "us-east-1",
"accountId": "123456789012",
"description": "This EC2 instance is underutilized and can be resized to a smaller instance type.",
"currentConfiguration": {
"instanceType": "m5.large",
"cpuUtilization": "10%",
"memoryUtilization": "5%",
"networkUtilization": "2%"
},
"recommendedAction": "Resize instance to t3.medium",
"estimatedSavings": {
"monthlyCost": 25.00,
"currency": "USD",
"_comment": "Estimated monthly savings in USD"
},
"reasoning": "Based on historical CPU and memory utilization, the instance is consistently underutilized. Resizing to a t3.medium instance will provide sufficient resources while reducing costs.",
"riskAssessment": {
"impact": "Low",
"likelihood": "High",
"mitigation": "Monitor the instance after resizing to ensure performance is not negatively impacted. Consider setting up CloudWatch alarms to track CPU and memory utilization.",
"_comment": "Assessment of risks associated with the recommendation"
},
"implementationSteps": [
"1. Stop the EC2 instance.",
"2. Change the instance type to t3.medium in the AWS console or using the AWS CLI.",
"3. Start the EC2 instance.",
"4. Monitor performance for 24-48 hours to ensure stability."
],
"status": "Open",
"createdTimestamp": "2024-01-01T00:00:00Z",
"lastUpdatedTimestamp": "2024-01-01T00:00:00Z",
"tags": [
"cost",
"optimization",
"ec2",
"aws"
],
"additionalInformation": {
"links": [
{
"title": "AWS EC2 Instance Types",
"url": "https://aws.amazon.com/ec2/instance-types/"
},
{
"title": "AWS CloudWatch",
"url": "https://aws.amazon.com/cloudwatch/"
}
],
"_comment": "Links to relevant documentation or resources"
},
"affectedServices": [
"EC2"
],
"confidenceLevel": "High",
"costImpactDetails": {
"currentMonthlyCost": 50.00,
"recommendedMonthlyCost": 25.00,
"costDifference": -25.00,
"currency": "USD"
}
}