concurrencylabs / aws-cost-analysis

Tools that make it easier to analyze AWS Cost and Usage reports. Initial version provides support for Athena and QuickSight.
GNU General Public License v3.0
173 stars 43 forks source link

[Question] Automated Deployment #12

Closed Xeroxxx closed 6 years ago

Xeroxxx commented 6 years ago

Hello, I was trying to use the automated deployment for aws-cost-analysis. Everything went well and all functions are created in lambda.

concurrencylabs commented 6 years ago

Thanks for using this solution. The Athena database is created when a new AWS Cost and Usage report is detected in the S3 bucket. This triggers the Step Function that eventually calls https://github.com/concurrencylabs/aws-cost-analysis/blob/master/functions/create-athena-resources.py Basically, you have to wait until a new report is placed in the S3 bucket. If after that, you still don't see a new Athena table created, please let us know.

Xeroxxx commented 6 years ago

Hello, actually the deployment went well. I specified the destinaton bucket (as report source) etc. Still no athena database created.

Where do I specifiy the source bucket of my aws reports that are being generated daily?

concurrencylabs commented 6 years ago

Just to double check, these should be the steps:

I hope this helps

Xeroxxx commented 6 years ago

Thanks for the follow up. So I cleaned everything up.

AWS_REGION=eu-central-1 BUCKET=billingstore BILLING_BUCKET_NAME=billingreport NAME=curprocessor-sam

ReportPathPrefix=aws/aws-reports/

billingstore contains nothing (after deployment it contains the curprocessor-sam folder for the package) billingreport contains the reports in folder aws/aws-reports/{period}/{csv-file} (gzip)

However do I need to run this in advance? This runs fine: python report_utils.py --action=prepare-athena --source-bucket=billingreport --source-prefix=aws/aws-reports/ --dest-bucket=billingstore --dest-prefix=reports/ --year=2018 --month=7

Thank you so much for support!

concurrencylabs commented 6 years ago

No, no need to run the report_utils.py script. The stack created by curprocessor-xacct-sam.yml is just a way to automate the steps to get CUR converted into an Athena table, so they're ready to be queried. The report_utils.py script is a way to manually trigger those steps.

Basically, they don't depend on each other. I hope this answers your question.