forked from pulumi/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
virtualenv
option to Python examples (pulumi#885)
Use the automatically managed `virtualenv: venv` support in all Python examples. See https://www.pulumi.com/docs/intro/languages/python/#virtual-environments. Also update the READMEs to no longer mention needing to manually create the virtual environment. The Pulumi CLI, as of v2.15.1, will automatically create & install dependencies in a virtual environment if the `virtualenv` runtime option is set in `Pulumi.yaml` and the configured directory is empty or doesn't exist.
- Loading branch information
Luke Hoban
authored
Feb 16, 2021
1 parent
327afe3
commit 4343550
Showing
95 changed files
with
237 additions
and
579 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,19 +23,10 @@ resources. | |
You'll need to set the `create-role:unprivilegedUsername` configuration variable to the name of the unprivilged user, as | ||
well as the AWS region in which to operate. | ||
|
||
First, you need install dependencies. In this example we will install them in | ||
a virtual environment named `venv`. | ||
First, you need to create a new stack: | ||
|
||
```bash | ||
$ cd create-role | ||
$ python3 -m venv venv | ||
$ source venv/bin/activate | ||
$ pip install -r requirements.txt | ||
``` | ||
|
||
Now create a new stack: | ||
|
||
```bash | ||
$ pulumi stack init assume-role-create | ||
$ pulumi config set create-role:unprivilegedUsername [email protected] | ||
$ pulumi config set aws:region us-east-1 | ||
|
@@ -70,8 +61,7 @@ with the unprivileged user credentials created in Part 1. This can be configured | |
directory, replacing `{YOUR_STACK_PATH/assume-role-create}` with the full name of your stack from Part 1. Full name of your stack is available at [`app.pulumi.com`][app] | ||
|
||
```bash | ||
$ cd assume-role | ||
$ npm install | ||
$ cd ../assume-role | ||
$ export AWS_ACCESS_KEY_ID="$(pulumi stack output --stack {YOUR_STACK_PATH/assume-role-create} accessKeyId)" | ||
$ export AWS_SECRET_ACCESS_KEY="$(pulumi stack output --stack {YOUR_STACK_PATH/assume-role-create} --show-secrets secretAccessKey)" | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
name: assume-role | ||
runtime: python | ||
runtime: | ||
name: python | ||
options: | ||
virtualenv: venv | ||
description: Demonstrate use of AWS AssumeRole Functionality |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
name: create-role | ||
runtime: python | ||
runtime: | ||
name: python | ||
options: | ||
virtualenv: venv | ||
description: Demonstrate use of AWS AssumeRole Functionality |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
name: aws-py-ec2-provisioners | ||
runtime: python | ||
runtime: | ||
name: python | ||
options: | ||
virtualenv: venv | ||
description: An example of manually configuring an AWS EC2 virtual machine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
name: aws-py-fargate | ||
description: A container running in AWS ECS Fargate, using Python infrastructure as code | ||
runtime: python | ||
runtime: | ||
name: python | ||
options: | ||
virtualenv: venv | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
name: aws-py-s3-folder | ||
runtime: python | ||
runtime: | ||
name: python | ||
options: | ||
virtualenv: venv | ||
description: A minimal AWS Python Pulumi program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.