Exercises to learn how to use Pulumi (4th session)
This exercise starts where we finished the previous session (a Virtual Network and a VM) but dive deeper on Pulumi reusability patterns at scale. You'll learn how to create your own Component Resource and use stack references along the way.
For a better learning experience, you way want to start with your own code from the previous training session.
- Switch to the
exercise
folder, create a new stack and install the node modules (npm install
) - Create 2 folders named
network
andapp
- Switch to the
network/
folder, create a new stack and install the node modules (npm install
) - Deploy a fully functional virtual network as a component resource
- Ensure the component resource is easily portable
- Determine the necessary stack outputs for the
webserver
project to use
- Switch to the
app
folder, create a new stack and install the node modules (npm install
) - Use stack references to retrieve the necessary dependencies
- Use the
get*()
functions to retrieve existing resources - Deploy a VM you can SSH into in the previously created subnet
- Use stack references
- Use Ubuntu 20.04 LTS (latest version)
- ensure you can SSH into each VM
- Create stack outputs for:
- the VMs hostname
- the username
- the password
- Use Pulumi runtime functions to determine the current stack name
- Your component resource doesn't rely on pulumi.Config()
- Your component resource args use strong typing
- Pulumi examples
You will find all the answers here.