Now that you have a basic project, let’s configure AWS support for it.
Pulumi created a virtualenv for you when you created your iac-workshop project. We’ll need to activate it to install dependencies:
source venv/bin/activateRun the following command to install the AWS package:
pip install pulumi_awsThe package will be added to requirements.txt.
Now that the AWS package is installed, we need to import it as part of our project:
import pulumi_aws as aws✅ After this change, your
__main__.pyshould look like this:import pulumi import pulumi_aws as aws
Configure the AWS region you would like to deploy to:
pulumi config set aws:region us-west-2Feel free to choose any AWS region that supports the services used in these labs (see this table for a list of available regions).
If you’re using an alternative AWS profile, you can tell Pulumi which to use in one of two ways:
export AWS_PROFILE=<profile name>pulumi config set aws:profile <profile name>