Skip to content

Commit

Permalink
Add missing README file
Browse files Browse the repository at this point in the history
  • Loading branch information
joeduffy committed Aug 7, 2018
1 parent aee3232 commit 0b057e1
Showing 1 changed file with 58 additions and 2 deletions.
60 changes: 58 additions & 2 deletions aws-js-webserver/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
# AWS Web Server example in JavaScript
# AWS EC2 Web Server

Deploy an EC2 instance using `@pulumi/aws`. This example shows how to use multiple infrastructure resources in one program. For a detailed walkthrough, see the tutorial [Infrastructure on AWS](https://pulumi.io/quickstart/aws-ec2.html).
This example deploys a simple AWS EC2 virtual machine running a Python web server.

## Deploying the App

To deploy your infrastructure, follow the below steps.

### Prerequisites

1. [Install Pulumi](https://pulumi.io/install)
2. [Configure AWS Credentials](https://pulumi.io/install/aws.html)

### Steps

After cloning this repo, from this working directory, run these commands:

1. Create a new stack, which is an isolated deployment target for this example:

```bash
$ pulumi stack init
```

2. Set the required configuration variables for this program:

```bash
$ pulumi config set aws:region us-east-1
```

3. Stand up the VM, which will also boot up your Python web server on port 80:

```bash
$ pulumi up
```

4. After a couple minutes, your VM will be ready, and two stack outputs are printed:

```bash
$ pulumi stack output
Current stack outputs (2):
OUTPUT VALUE
publicIp 53.40.227.82
```

5. Thanks to the security group making port 80 accessible to the 0.0.0.0/0 CIDR block, we can curl it:

```bash
$ curl $(pulumi stack output publicIp)
Hello, World!
```

6. From there, feel free to experiment. Simply making edits and running `pulumi up` will incrementally update your VM.

7. Afterwards, destroy your stack and remove it:

```bash
$ pulumi destroy --yes
$ pulumi stack rm --yes
```

0 comments on commit 0b057e1

Please sign in to comment.