Web Server on Linode
Basic example of an Linode web server accessible over HTTP
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set linode-js-webservercd pulumi-examples/linode-js-webserverStarting point for building a Pulumi sample webserver on Linode.
Running the App#
-
Create a new stack:
$ pulumi stack init webserver-linode-testing -
Configure the project:
$ pulumi config set --secret linode:token YOURLINODETOKEN -
Restore NPM dependencies:
$ npm install -
Run
pulumi upto preview and deploy changes:$ pulumi upPreviewing update (webserver-linode-testing):...Updating (webserver-linode-testing):Type Name Status+ pulumi:pulumi:Stack webserver-linode-webserver-linode-testing created+ ├─ linode:index:StackScript simple-server created+ └─ linode:index:Instance instance createdOutputs:instanceIP : "69.164.221.90"instanceLabel: "linode13879908"Resources:+ 3 createdDuration: 55s -
Curl the HTTP server:
$ curl $(pulumi stack output instanceIP)Hello, World! -
SSH into the server:
$ linode-cli ssh root@$(pulumi stack output instanceLabel)Warning: Permanently added '69.164.221.90' (ECDSA) to the list of known hosts.Linux li136-90 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1 (2019-04-12) x86_64The programs included with the Debian GNU/Linux system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright.Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extentpermitted by applicable law.root@li136-90:~# -
Cleanup
$ pulumi destroy$ pulumi stack rm
Related
Blog PostJul 2018
AWS SQS to Lambda with Pulumi: Serverless Queue Example
Blog PostJun 2018