How to access RDS running hours using boto3

0

Hi Team, I want to extract the running hours of RDS instances from past 6 months. I used the get_cost_and_usage API and filters as follows:

    Filter={
            'And':[{
            'Dimensions':{
                'Key':'SERVICE',
                'Values':['Amazon Relational Database Service']
            }},
            {
                'Dimensions':{
                'Key':'USAGE_TYPE_GROUP',
                'Values':['RDS: Running Hours']
            }
            }               
            ]       
        }

It does brings the RDS cost, but brings no output for 'DimensionValueAttributes': [].

Please assists.

Regards, Nikhil Shah

質問済み 2年前465ビュー
1回答
0
承認された回答

Hey Guys.. I found the answer... I was missing the Metrics type, I just included 'AmortizedCost' hence it was showing only cost and not the usage. So Added both 'UsageQuantity' & 'AmortizedCost', now get both usage and cost associated with RDS.

Filter={ 'And':[{ 'Dimensions':{ 'Key':'SERVICE', 'Values':['Amazon Relational Database Service'] }}, { 'Dimensions':{ 'Key':'USAGE_TYPE_GROUP', 'Values':['RDS: Running Hours'] } }
]
}

回答済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ