Download 220
Last updated Feb 21, 2024


Retrieves AWS cost and usage metrics using AWS Cost Explorer service.

aws-cost [from=yyyyMMdd] [to=yyyyMMdd] [days=DAYS] [unit=t|f] METRIC [by GROUP]
Start date (inclusive). format: yyyyMMdd
End date (exclusive). format: yyyyMMdd
Number of days for AWS cost report
Add unit field for each cost
blended_cost, amortized_cost, net_amortized_cost, net_unblended_cost, normalized_usage_amount, unblended_cost, or unblended_cost
az, instance_type, linked_account, operation, purchase_type, service, usage_type, platform, tenancy, record_type, legal_entity_name, deployment_option, database_engine, cache_engine, instance_type_family, region, billing_entity, or reservation_id

AWS IAM Policy

To use this command, you must allow the below permissions in your AWS IAM policy:

  • ce:GetCostAndUsage

Output Fields

aws_profileStringConnect profileIdentifier of the AWS connect profile
startString시작 날짜범위에 포함
endString끝 날짜범위에 포함하지 않음
unblended_costDouble일반 비용
amortized_costDouble분할 납부 비용
blended_costDouble혼합 비용
net_unblended_costDouble순 일반 비용세금 및 할인 반영
net_amortized_costDouble순 분할납부 비용세금 및 할인 반영
usage_quantityDouble사용량서비스별 컴퓨팅 리소스 사용량
normalized_usage_amountDouble표준화된 사용량사용량 x 표준화 계수
azString가용 영역
serviceString서비스예: EC2 - Other, AmazonCloudWatch
instance_type_familyString인스턴스 패밀리예: m5, NoInstanceTypeFamily
instance_typeString인스턴스 유형예: m5.xlarge, NoInstanceType
billing_entityString결제 주체예: AWS
reservation_idString예약 ID
linked_accountString결제 계정
purchase_typeString구매 유형예: On Demand Instances
operationString작업예: CreateVolume-St1
usage_typeStringUsage type예: APN2-EBS:VolumeUsage.st1
platformString플랫폼예: Linux/UNIX, NoOperatingSystem
tenancyString테넌시예: Shared, NoTenancy
record_typeString레코드 유형예: Usage, DiscountedUsage
legal_entity_nameString법적 주체예: Amazon Web Services Korea LLC
deployment_optionString배포 옵션예: Single-AZ, NoDeploymentOption
database_engineString데이터베이스 엔진예: Aurora MySQL, Any, NoDatabaseEngine
cache_engineString캐시 엔진예: NoCacheEngine