Starting point for building a Pulumi sample architecture on DigitalOcean.
-
Create a new stack:
$ pulumi stack init digitalocean-ts-loadbalanced-droplets
-
Configure the project:
$ pulumi config set --secret digitalocean:token YOURDIGITALOCEANTOKEN
-
Create a Python virtualenv, activate it, and install dependencies:
This installs the dependent packages needed for our Pulumi program.
$ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt
-
Run
pulumi up
to preview and deploy changes:$ pulumi up Previewing update (digitalocean-ts-loadbalanced-droplets): ...
Updating (digitalocean-ts-loadbalanced-droplets):
Type Name Status
- pulumi:pulumi:Stack digitalocean-ts-loadbalanced-droplets-digitalocean-ts-loadbalanced-droplets created
- ├─ digitalocean:index:Tag demo-app created
- ├─ digitalocean:index:Tag web-2 created
- ├─ digitalocean:index:Tag web-0 created
- ├─ digitalocean:index:Tag web-1 created
- ├─ digitalocean:index:LoadBalancer public created
- ├─ digitalocean:index:Droplet web-0 created
- ├─ digitalocean:index:Droplet web-2 created
- └─ digitalocean:index:Droplet web-1 created
Outputs: endpoint: "138.197.62.183"
Resources: + 9 created
Duration: 3m2s ```
-
Curl the HTTP server:
curl "$(pulumi stack output endpoint)"
-
Cleanup
$ pulumi destroy $ pulumi stack rm