D21 #100DaysOfCloud
- More practice labs on ALB path based routing.
- For one scenario , my EC2 instance has to pull some files from S3 bucket and I added those instructions in user-data.
- But I forgot to add the necessary IAM Role for EC2 to access the S3 bucket,
- More practice labs on ALB path based routing.
- For one scenario , my EC2 instance has to pull some files from S3 bucket and I added those instructions in user-data.
- But I forgot to add the necessary IAM Role for EC2 to access the S3 bucket,


- Of course, I could not run my lab and got into this situation where I needed to re-run the instructions under user-data.
- (Fun fact) User data bash scripts are only executed while EC2 instance is initialized for the first time
- (Fun fact) User data bash scripts are only executed while EC2 instance is initialized for the first time
- The content for user data is stored on the EC2 instance at /var/lib/cloud/instance/scripts/part-001
- so login to the EC2 instance and run
sudo bash /var/lib/cloud/instance/scripts/part-001 as fix
- /var/log/cloud-init-output.log can help to debug scripts.
- so login to the EC2 instance and run
sudo bash /var/lib/cloud/instance/scripts/part-001 as fix
- /var/log/cloud-init-output.log can help to debug scripts.