AWS user data cannot access to files that exist

Viewed 12

I installed a spring boot application through git in aws ec2 and build project and then made ami of it.

My launch template has user data like below and make ec2 with ami I made above.

#!/bin/bash
cd Kculter
./mvnw clean package
cd target
nohup java -jar springbootapp.jar --spring.profiles.active=prod &

But when I make ec2 with my launch template user data won't work properly It says that there are no such file or directory of Kculter, ./mvnw, target. And then it saids unable to access jar file

How can I make my jar file work when ec2 are made??

0 Answers
Related