Skip to content

Instantly share code, notes, and snippets.

@rah003
Created November 22, 2019 14:50
Show Gist options
  • Save rah003/e616de713c2ba4bb8dbef5cf725af13e to your computer and use it in GitHub Desktop.
Save rah003/e616de713c2ba4bb8dbef5cf725af13e to your computer and use it in GitHub Desktop.
data = cd.get_cost_and_usage(TimePeriod={'Start': start, 'End': end},
Granularity='MONTHLY', Metrics=['UnblendedCost'],
Filter={ "And" : [
{"Dimensions": {
"Key": "LINKED_ACCOUNT",
"Values": [ "791540823040" ] }},
{"Tags": {
"Key": "Organization",
"Values": ["swissre-webpresence"] }}
]},
GroupBy=[{'Type': 'DIMENSION', 'Key': 'LINKED_ACCOUNT'}, {'Type': 'DIMENSION', 'Key': 'SERVICE'}], **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment