command
module
Version:
v0.0.0-...-2f3ac94
Opens a new window with list of versions in this module.
Published: Apr 8, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Web Server Using Amazon EC2 (in Go)
This example deploys a simple AWS EC2 virtual machine running a Python web server. It uses Go as its infrastructure as
code language.
Deploying the App
To deploy your infrastructure, follow the below steps.
Prerequisites
- Install Go
- Install Pulumi
- Configure AWS Credentials
Steps
After cloning this repo, from this working directory, run these commands:
-
Next, create a new Pulumi stack, which is an isolated deployment target for this example:
$ pulumi stack init
-
Set the required configuration variables for this program:
$ pulumi config set aws:region us-east-1
-
Stand up the VM, which will also boot up your Python web server on port 80:
$ pulumi up
-
After a couple minutes, your VM will be ready, and two stack outputs are printed:
$ pulumi stack output
Current stack outputs (2):
OUTPUT VALUE
publicIp 53.40.227.82
-
Thanks to the security group making port 80 accessible to the 0.0.0.0/0 CIDR block, we can curl it:
$ curl $(pulumi stack output publicIp)
Hello, World!
-
From there, feel free to experiment. Simply making edits and running pulumi up
will incrementally update your VM.
-
Afterwards, destroy your stack and remove it:
$ pulumi destroy --yes
$ pulumi stack rm --yes
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.