Update Python examples to support Pulumi >= 0.16.4
Fixes
MODIFY
.gitignore
.gitignore
bin/
node_modules/
*.pyc
+.Python
+include/
+lib/
yarn.lock
package-lock.json
Pulumi.*.yaml

MODIFY
aws-py-stepfunctions/__main__.py
aws-py-stepfunctions/__main__.py
@@ -15,7 +15,7 @@ hello_world_fn = lambda_.Function('helloWorldFunction',
state_defn = state_machine = sfn.StateMachine('stateMachine',
role_arn=iam.sfn_role.arn,
- definition="""{
+ definition=hello_world_fn.arn.apply(lambda arn: """{
"Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
"StartAt": "HelloWorld",
"States": {
@@ -25,7 +25,7 @@ state_defn = state_machine = sfn.StateMachine('stateMachine',
"End": true
}
}
- }""" % hello_world_fn.arn
+ }""" % arn)
)
-pulumi.output('state_machine_arn', state_machine.id)
+pulumi.export('state_machine_arn', state_machine.id)

MODIFY
aws-py-stepfunctions/requirements.txt
aws-py-stepfunctions/requirements.txt
-pulumi>=0.15.0
-pulumi-aws>=0.15.0
+pulumi>=0.16.4
+pulumi-aws>=0.16.2

MODIFY
aws-py-webserver/README.md
aws-py-webserver/README.md
@@ -10,12 +10,16 @@ To get the correct Amazon Linux AMI for the instance size and region, a mapping
## Prerequisites
1. [Install Pulumi](https://pulumi.io/install/)
-1. [Configure Pulumi for AWS](https://pulumi.io/install/aws-config.html)
+1. [Configure Pulumi for AWS](https://pulumi.io/quickstart/aws/setup.html)
1. [Configure Pulumi for Python](https://pulumi.io/reference/python.html)
## Deploying and running the program
-1. Login to the Pulumi CLI via `pulumi login`.
+1. Install dependencies (a `virtualenv` is recommended - see [Pulumi Python docs](https://pulumi.io/reference/python.html)):
+
+ ```
+ $ pip install -r requirements.txt
+ ```
1. Create a new stack:

MODIFY
aws-py-webserver/__main__.py
aws-py-webserver/__main__.py
@@ -24,5 +24,5 @@ server = ec2.Instance('web-server-www',
user_data=user_data,
ami=get_linux_ami(size))
-pulumi.output('public_ip', server.public_ip)
-pulumi.output('public_dns', server.public_dns)
+pulumi.export('public_ip', server.public_ip)
+pulumi.export('public_dns', server.public_dns)

MODIFY
aws-py-webserver/requirements.txt
aws-py-webserver/requirements.txt
-pulumi>=0.15.0
-pulumi-aws>=0.15.0
+pulumi>=0.16.4
+pulumi-aws>=0.16.2

Update Python examples to support Pulumi >= 0.16.4 (#180)

Fixes #179.