Posted
Filed under 프로그래밍
현재 접속해 있는 서버의 AWS정보를 가지고 와야 하는 경우가 있다
아마존 메뉴얼이 잘되어있긴하지만 좀 복잡해서 찾아보기가 힘들다

여튼...

http://docs.amazonwebservices.com/AWSEC2/2007-03-01/DeveloperGuide/AESDG-chapter-instancedata.html


Request
http://169.254.169.254/latest/meta-data/

Response
ami-id
ami-launch-index
ami-manifest-path
instance-id
hostname
local-ipv4
public-keys/
reservation-id
security-groups

예) 현재 접속한 EC2의 instance id 가져오기
http://169.254.169.254/latest/meta-data/instance-id

2011/11/01 16:54 2011/11/01 16:54