how to get aws account number id based on EC2 instance which is hosted in amazon

0 votes
how to get aws account number /id based on EC2 instance ip which is hosted in amazon i have a instance name CTI server it is hosted in one AWS account. I have the details of CTI server like private ip and hosts and able to do ssh this instance through putty .I want the AWS account number /aws account ID of where this instance is created . is their any command to find out account number without login into aws console
Feb 21, 2022 in AWS by Rahul
• 2,120 points
2,255 views

1 answer to this question.

0 votes

You can obtain account number from an EC2 instance by querying the instance metadata. If an IAM role is attached to the instance, you can retrieve it by using.

aws sts get-caller-identity
answered Feb 21, 2022 by Korak
• 5,820 points

Related Questions In AWS

0 votes
1 answer

How to Pass the VPC ID while creating the Ec2 instance in AWS using Python Boto3

import boto3 ec2 = boto3.resource('ec2') instance = ec2.create_instances( ...READ MORE

answered Jan 29, 2019 in AWS by Priyaj
• 58,020 points
3,596 views
0 votes
0 answers
+1 vote
1 answer

How to auto-scale MYSQL database in AWS EC2 instance?

You could always use the Amazon RDS ...READ MORE

answered Aug 24, 2018 in AWS by Archana
• 4,170 points
2,966 views
+2 votes
1 answer

How to Use Amazon AWS Credentials to Access/Query Tables in AWS RDS Instance through Mobile App

You should make your backend functions to ...READ MORE

answered Aug 28, 2018 in AWS by Priyaj
• 58,020 points
1,334 views
0 votes
1 answer

In Amazon Data Pipeline, how to make sure only once instance of a pipeline is running at any time?

On the CopyTablesActivity, you could set a lateAfterTimeout attribute ...READ MORE

answered Sep 19, 2018 in AWS by Priyaj
• 58,020 points
2,204 views
0 votes
2 answers
0 votes
1 answer

How to change instance type in aws

As your needs change, you might find ...READ MORE

answered Feb 4, 2022 in AWS by Korak
• 5,820 points
510 views
0 votes
1 answer

How can I find out why my storage space on Amazon EC2 is full?

One or more log files which have ...READ MORE

answered Feb 21, 2022 in AWS by Korak
• 5,820 points
1,487 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP