Pass User Data to AWS client

Posted by bearrito on Server Fault See other posts from Server Fault or by bearrito
Published on 2013-10-31T19:11:56Z Indexed on 2013/10/31 21:58 UTC
Read the original article Hit count: 178

Has anyone successful passed user data to the AWS CLI ?

I have tried various incantations of the following but it does not work.

Docs say string must be base64 encoded : http://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html

The instance logs never indicate the script is executed and chef is installed.

aws ec2 run-instances --image-id ami-a73264ce --count 1 --instance-type t1.micro       --key-name scrubbed --iam-instance-profile Arn=arn:aws:iam::scrubbed:instance-profile/scrubbed --user-data $(base64 chef_user_data.sh --wrap=0)

chef_user_data.sh

#!/bin/bash
curl -L https://www.opscode.com/chef/install.sh | sudo bash

© Server Fault or respective owner

Related posts about amazon-ec2

Related posts about amazon-web-services