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 官方已更新 6 个月前
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前