AWS Athena  sandbox 

Athena

Region scope 3x Replication Performance? DocumentDB

Queries

Parameterized Queries

  1. Add a prepared statement
aws athena create-prepared-statement  
--statement-name SplitCostItem
--query-statement "SELECT 
  line_item_usage_start_date,
  line_item_usage_end_date,
  line_item_resource_id,
  line_item_blended_cost,
  split_line_item_net_split_cost,
  split_line_item_split_usage,
  split_line_item_net_unused_cost,
  line_item_line_item_type,
  line_item_usage_type,
  split_line_item_parent_resource_id
  FROM "athenacurcfn"."amazon_athena" 
  where line_item_line_item_type='Usage'
  and line_item_resource_id='?'
  and year='?' and month='?'"
--work-group athena-engine-v2
  1. Start query execution
aws athena start-query-execution 
--query-string "Execute SplitCostItem" 
--query-execution-context "Database"="default" 
--result-configuration "OutputLocation"="s3://query-result-bucket/"
--execution-parameters "resource-id" "2024" "1"