This example deploys a simple AWS EC2 virtual machine running a simple web server.
Follow the instructions to get started with Pulumi & AWS.
Note: some values in this example will be different from run to run.
These values are indicated with ***
.
-
Create a new stack, which is an isolated deployment target for this example:
pulumi stack init aws-webserver-dev
-
Set the AWS region:
pulumi config set aws:region us-west-2
-
Run
pulumi up
to preview and deploy changes. After the preview is shown you will be prompted if you want to continue or not.pulumi up
After a couple of minutes, your VM will be ready. Your web server will start on port
80
. -
To see the resources that were created, run
pulumi stack output
:pulumi stack output
-
Thanks to the security group making port
80
accessible to the0.0.0.0/0
CIDR block (all addresses), we cancurl
it:curl $(pulumi stack output publicIp)
Hello, World!
open http://$(pulumi stack output publicHostName)
-
From there, feel free to experiment. Simply making edits and running pulumi up will incrementally update your infrastructure.
-
To clean up resources, destroy your stack and remove it:
pulumi destroy
pulumi stack rm aws-webserver-dev