We use machine learning technology to do auto-translation. Click "English" on top navigation bar to check Chinese version.
Estimating Amazon Web Services Config recorder costs and usage using Amazon Web Services CloudTrail
In this post, we will show how you can use
Step 1: Querying Amazon Web Services CloudTrail
Prerequisites
The sample CloudTrail queries in this blog require customers have either of the following setup options:
- CloudTrail Lake
event data store setup to receive CloudTrail Events. -
Amazon Athena setup to query your CloudTrail logs .
The option you choose will depend upon which of these options you have configured in your environment
Option 1: Running the query in Amazon Web Services CloudTrail Lake
The following sample CloudTrail Lake query will return the total captured API events related to a list of Amazon Web Services services within a given time period. You can optionally add or remove additional Amazon Web Services services to the query by updating the eventSource
section of the query. The API events queried are events that could trigger a resource change in Amazon Web Services Config. There are some resource types that are not captured by the sample query that Amazon Web Services Config records such as the Amazon Web Services::Config::ResourceCompliance. This query will give you a starting point as to how many configuration items could get recorded if the Amazon Web Services Config recorder was turned on. The
- Navigate to the
CloudTrail console . - In the left-hand navigation menu, choose Lake .
- Choose the Editor
- Copy the below query and paste it into your editor window. (Note: you must replace $EDS_ID with the id of your event data store. Also, you can add additional eventSource you would like to track)
- Next, you must replace the time range that will be searched with the time range you want to use. This will help to reduce the amount of data scanned within the query to only search the time and date specified. The date string specified after eventTime > is the earliest event timestamp that will be included, while the date string specified after eventTime < is the latest event timestamp that will be included.
- Click Run and then your results will show under Query Results . Please note the value of the TotalPossibleCI column will be used when estimating the Amazon Web Services Config cost for the total amount of configuration items recorded within a month.
- You can then save the query run again at future time, by clicking the Save
- Give it the name Estimate Amount of Amazon Web Services Config Configuration Items .
- Enter a description of Estimate of Amount of Amazon Web Services Config Configuration Items .
- Click Save query .
Option 2: Amazon Web Services CloudTrail query for Amazon Athena
To run a similar query if you have trails for CloudTrail setup to use
eventSource
section of the query. The results of the query will give you a starting point that can be used with the
(Note: you must replace ${tableName} with the Athena table name for CloudTrail and adjust the eventTime fields with the date range you would like to query. Also, you can add additional eventSource you would like to track)
Step 2: Create Estimate with Amazon Web Services Pricing Calculator
We can use Amazon Web Services Pricing Calculator to create an estimate of the monthly Amazon Web Services Config cost for the amount of possible configuration items recorded if the Amazon Web Services Config recorder was turned on. Please note, that configurations items recorded are just one part of the Amazon Web Services Config pricing, you would also need to estimate the amount of Amazon Web Services Config rules and conformance pack evaluation that will be ran in your account.
- Navigate to Amazon Web Services Pricing Calculator page and choose Create an Estimate .
- In the Find Service search box under Select Service , search for “Amazon Web Services Config” and under Amazon Web Services Config, choose Configure .
- In the Configure Amazon Web Services Config section, type a description and choose the region you would like to create the pricing estimate for.
- In the Configuration items recorded section, under the Number of Configuration items recorded, enter in the total value of “TotalPossibleCI” from the query you ran earlier in CloudTrail.
- This will then give you an estimate of the Amazon Web Services Config cost for the total amount of configuration items recorded within a month.
Cleanup
If you like to remove the query saved in CloudTrail Lake, you can do the following steps:
- Navigate to the
CloudTrail console . - In the left-hand navigation menu, choose Lake .
- Choose the Saved queries
- Select the Estimate Amount of Amazon Web Services Config Configuration Items
- Click Delete .
Conclusion
This post demonstrates how to use CloudTrail Lake to help gather statistic related to the amount of API related events that could trigger a creation of a configuration items by Amazon Web Services Config. With CloudTrail Lake you can further use additional queries to gather deeper insight to activity being captured within your account. To learn more about CloudTrail Lake see the blog article
About the authors:
The mentioned AWS GenAI Services service names relating to generative AI are only available or previewed in the Global Regions. Amazon Web Services China promotes AWS GenAI Services relating to generative AI solely for China-to-global business purposes and/or advanced technology introduction.