You can use the AWS CLI command for STS service to get your AWS account id details as shown below –
1 2 |
## Get your AWS Account ID using AWS CLI aws sts get-caller-identity --query Account --output text |
You can use the below links to install and configure AWS CLI
https://cloudaffaire.com/how-to-install-aws-cli/
https://cloudaffaire.com/how-to-configure-aws-cli/