CostAndUsage - Inadequate permission for linked account

0

Hey everyone!

I'm currently trying to poll for costs of the current account with the cost explorer service but I'm receiving following error:

Error: AccessDeniedException: Inadequate permission for linked account to see the cost with EDP discounts applied

While I'm aware, that I might have to grant or be granted permissions I don't know where even though I tried some variations like adding policies to the account user. Do I have to enable something at the payer account level or specify a linked account in the request parameters?

The code is the following:

          input := &costexplorer.GetCostAndUsageInput{  
		Metrics: aws.StringSlice(\[]string{  
			"NetUnblendedCost",  
		}),  
		TimePeriod: &costexplorer.DateInterval{  
			Start: aws.String(start),  
			End:   aws.String(end),  
		},  
		Granularity: aws.String("MONTHLY"),  
	}  

result, err := costService.GetCostAndUsage(input)

Edited by: DennisLeanix on Nov 2, 2020 2:12 AM

已提問 4 年前檢視次數 369 次
3 個答案
0

Nevermind. The input request doc required a metric value like "NetUnblendedCost" which does not work.
You have to do it like NET_UNBLENDED_COST

Cheers

已回答 4 年前
0

See reply

已回答 4 年前
0

Hi Dennis,

How did you fix that? I tried to change NetUnblendedCost metric into NET_UNBLENDED_COST one but nothing happens.

已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南