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 in AWS by Rahul
• 2,080 points
208 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 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,080 points
1,919 views
+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,150 points
1,716 views
+2 votes
1 answer
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,080 points
1,514 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 in AWS by Korak
• 5,820 points
23 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 in AWS by Korak
• 5,820 points
117 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP