Exercises to learn how to use Pulumi (2nd session)
The series of tasks below will help you learn how to use Pulumi configuration and secrets. You will also learn how to do basic operations such as string concatenation on Output<T>
.
- Switch to the
exercise
folder, create a new stack and install the node modules (npm install
) - Create a new configuration entry named
ownerName
- Create a new configuration entry named
subscriptionId
- Create a new secret entry named
apiKey
- Generate a new password using the Random provider
- At least 20 charaters long
- Must contain special characters
- Generate a random pet name using the Random provider
- Concatenate the
ownerName
stack config value with the random pet name (format:owner-pet
) usingpulumi.interpolate
And display the result on the console. - Use pulumi.all() to create a welcome message "
Hello dear <ownerName>, this is your pet <petName>.
" - Create stack outputs for:
- the random password generated in 5
- the stack pet name from step 6
- the concatenated owner name and pet name from step 7
- the
apiKey
set in step 1 asapiKey
- the plain text value of
apiKey
set in step 1 asinsecureApiKey
- the welcome message
- In one command, set the stack tag
pet
as the randomly generated pet name
- Set a stack README for your stack
- Pulumi examples
You will find all the answers here.