http://qs1969.pair.com?node_id=799385


in reply to Net::Amazon::EC2 loses pound-shebang when base64'd

Try passing in the user-data script without base-64 encoding it. It works for me.

I happen to maintain the user-data script running software and the Amazon EC2 Debian AMI you are running. I suppose I could enhance it to try to base-64 decode the user-data if it wasn't in the clear, but I'm not sure that there is any good reason to do so.

  • Comment on Re: Net::Amazon::EC2 loses pound-shebang when base64'd

Replies are listed 'Best First'.
Re^2: Net::Amazon::EC2 loses pound-shebang when base64'd
by esh (Pilgrim) on Oct 06, 2009 at 23:17 UTC
    I take back my comment about not base-64 encoding. I just looked at my code and it says:
    my $instances = $ec2->run_instances( ImageId => $ami_id, MinCount => 1, MaxCount => 1, KeyName => $key, (defined $user_data ? (UserData => MIME::Base64::encode_base64($user_data)) : ()), (defined $instance_type ? (InstanceType => $instance_type) : ()), #... ) or die "$ec2->{error}";