8000 GitHub - nurcahyopujo/pulumi-malang-cloud
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

nurcahyopujo/pulumi-malang-cloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Web Server Using Amazon EC2

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
  2. Configure AWS Credentials

Steps

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

  1. Pulumi login

    pulumi login file:///home/nurcahyo/Projects/Personal/pulumi-malang-cloud/states
  2. Initiate new pulumi projects

    $ pulumi new aws-typescript -g --dir webserver2
    $ cd webserver2
    $ npm i
  3. Create a new stack, which is an isolated deployment target for this example:

    $ pulumi stack init
  4. Set the required configuration variables for this program:

    $ pulumi config set aws:region us-east-1
  5. Stand up the VM, which will also boot up your Python web server on port 80:

    $ pulumi up
  6. After a couple minutes, your VM will be ready, and two stack outputs are printed:

    $ pulumi stack output
    Current stack outputs (2):
    OUTPUT          VALUE
    publicHostName  ec2-53-40-227-82.compute-1.amazonaws.com
    publicIp        53.40.227.82
  7. Thanks to the security group making port 80 accessible to the 0.0.0.0/0 CIDR block (all addresses), we can curl it:

    $ curl $(pulumi stack output publicIp)
    Hello, World!
  8. From there, feel free to experiment. Simply making edits and running pulumi up will incrementally update your VM.

  9. Afterwards, destroy your stack and remove it:

    $ pulumi destroy --yes
    $ pulumi stack rm --yes

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0