1回答
- 新しい順
- 投票が多い順
- コメントが多い順
0
I finally found it. The example will only work inside an AWS task as the endpoint is not publicly available.
var getSessionTokenRequest = new GetSessionTokenRequest
{
DurationSeconds = 7200 // seconds
};
var stsClient = hostContext.Configuration.GetAWSOptions().CreateServiceClient<IAmazonSecurityTokenService>();
var iden = stsClient.GetCallerIdentityAsync(new GetCallerIdentityRequest { }).Result;
System.Console.WriteLine($"A={iden.Account} ARN={iden.Arn} U={iden.UserId}");
回答済み 5年前
関連するコンテンツ
- AWS公式更新しました 2年前
- AWS公式更新しました 1年前