Programmatically get your AWS Account ID with .NET
Here is a quick way to get your AWS Account ID with .NET
First, add the
AWSSDK.SecurityToken package to your project.
Then it’s just a few lines of code -
using Amazon.SecurityToken; AmazonSecurityTokenServiceClient client = new AmazonSecurityTokenServiceClient(); var response = await client.GetCallerIdentityAsync(new Amazon.SecurityToken.Model.GetCallerIdentityRequest()); Console.WriteLine(response.Account);
Hope this saves someone a few hours!
- Using Step Functions to Orchestrate a Series of Lambda Functions
- Triggering a .NET Lambda Function from an Amazon SQS Queue
- Transcribing Two Speakers with Amazon Transcribe via Speaker Identification with .NET
- Lambda cold starts for .NET applications are not so bad
- Transcribing Two Speakers with Amazon Transcribe via Channel Identification