EC2 - gpawade/gpawade.github.io GitHub Wiki

Configure Instance

Retrive instance metadata

http://169.254.169.254/latest/meta-data/

Retrive user data

http://169.254.169.254/latest/user-data

User Data Script

We can pass the user data script at time of instance launch.

Run any command that we can run in command prompt window.

<script> </script>

Example

<script>
    dir > c:/test.log
<script>

Run powershell command

<powershell></powershell>

Example

<powershell>
    Read-S3Object -BucketName myS3Bucket -Key myFolder/myFile.zip -File c:\destinationFile.zip
</powershell>
⚠️ **GitHub.com Fallback** ⚠️