ruby on rails - Get user_data of a aws instance using AWS::EC2::Instance class -


i want user_data of ec2 instance instance. looked @ documentation of class aws::ec2::instance @ link http://docs.aws.amazon.com/awsrubysdk/latest/aws/ec2/instance.html

and tried getting user_data this

require 'aws-sdk' puts aws::ec2::instance.instance.user_data

but think not right way works . can 1 let me know how user_data of instance.

try this:-

require 'aws-sdk'  ec2 = aws::ec2.new(  :access_key_id => 'access_key_id',  :secret_access_key => 'secret_access_key')  instance = ec2.instances['i-9e516a95'] puts instance.user_data 

note:- 'i-9e516a95' particular instance_id , make sure instance running.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -