0

In a Linux ec2 machine has test.sh created.

echo "Hello World" > txt

i want to run this script by using aws command in command prompt. i tried below solution but nothing happen.

aws ec2 run-instances --image-id ami-16d4986e --user-data file:////home/ubuntu/test.sh

1 Answer 1

2

That command creates an entirely new instance, and runs that script at startup.

If you you want to run your script on an existing instance you should look into the EC2 Run Command service.

Sign up to request clarification or add additional context in comments.

2 Comments

first of all thanks for the reply. Can you give an example command? It's very easy to me to understand.
It's not just a command, you have to setup the service first. I suggest you read the documentation docs.aws.amazon.com/AWSEC2/latest/UserGuide/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.