{"id":6948,"date":"2022-11-23T11:56:36","date_gmt":"2022-11-23T06:26:36","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=6948"},"modified":"2022-11-23T11:59:09","modified_gmt":"2022-11-23T06:29:09","slug":"how-to-get-details-from-the-aws-instance","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-get-details-from-the-aws-instance\/","title":{"rendered":"How to get details from the AWS instance?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Introduction<\/strong>:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, We have to learn, how to get instance-id, instance-type, Public key, and Security groups name on an AWS server without AWS console login credentials.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Prerequisite<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>AWS ubuntu Instance<\/li>\n\n\n\n<li>Sudo access (or) root access for the  instance<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step1<\/strong>:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Login to the Instance with Sudo or root access<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step2:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Update and install curl on the instance\/server with the below command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt update\n$ sudo apt install curl<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step3:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To view the AWS instance id on Server\/instance. Run the below command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ curl http:\/\/169.254.169.254\/latest\/meta-data\/instance-id<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image.png\"><img decoding=\"async\" width=\"776\" height=\"61\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image.png\" alt=\"\" class=\"wp-image-6949\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image.png 776w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-300x24.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-768x60.png 768w\" sizes=\"(max-width: 776px) 100vw, 776px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step4:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To view the AWS instance type on server\/instance. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ curl http:\/\/169.254.169.254\/latest\/meta-data\/instance-type<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-1.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"744\" height=\"68\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-1.png\" alt=\"\" class=\"wp-image-6950\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-1.png 744w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-1-300x27.png 300w\" sizes=\"(max-width: 744px) 100vw, 744px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step5:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To view the AWS public keys which are using instance.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ curl http:\/\/169.254.169.254\/latest\/meta-data\/public-keys<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-2.png\"><img decoding=\"async\" width=\"766\" height=\"53\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-2.png\" alt=\"\" class=\"wp-image-6951\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-2.png 766w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-2-300x21.png 300w\" sizes=\"(max-width: 766px) 100vw, 766px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step6:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To view the AWS security group name which is using instance.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ curl http:\/\/169.254.169.254\/latest\/meta-data\/security-groups<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"783\" height=\"55\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-3.png\" alt=\"\" class=\"wp-image-6952\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-3.png 783w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-3-300x21.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/11\/image-3-768x54.png 768w\" sizes=\"(max-width: 783px) 100vw, 783px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Note:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">169.254.169.254 IP is unique for all ubuntu servers.<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: In this article, We have to learn, how to get instance-id, instance-type, Public key, and Security groups name on [&hellip;]<\/p>\n","protected":false},"author":496,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1019],"tags":[],"class_list":["post-6948","post","type-post","status-publish","format-standard","hentry","category-cloud-aws","psol-cat-cloud-aws"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phns3A-1O4","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6948","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/496"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=6948"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6948\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=6948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=6948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=6948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}