# Bootstapping

EC2 Bootstrapping is the process of configuring an EC2 instance to perform automated install & configuration steps 'post launch' before an instance is brought into service.

With EC2 this is accomplished by passing a script via the User Data part of the Meta-data service - which is then executed by the EC2 Instance OS

### **EC2 Command to view User-Data**

```
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"`

curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/

curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/user-data/


```

\
Another way is by doing cfn-int a cloud formation template&#x20;

<figure><img src="https://1856860631-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsNc001Xcz63mWjGXymkd%2Fuploads%2FcgxDM57XdTjJbSzrOxdh%2Fimage.png?alt=media&#x26;token=de71fba4-9c9e-401b-813f-be21e73edbcb" alt=""><figcaption></figcaption></figure>

CreationPolicy and signals are part of Cfn-int

<figure><img src="https://1856860631-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsNc001Xcz63mWjGXymkd%2Fuploads%2F6G8ZdZbofvqQvr7fxXBs%2Fimage.png?alt=media&#x26;token=6c618eb0-9f1a-4d8c-a6be-bccbae9d2641" alt=""><figcaption></figcaption></figure>
