Skip to content

Commit

Permalink
Update Python examples to support Pulumi >= 0.16.4 (pulumi#180)
Browse files Browse the repository at this point in the history
Fixes pulumi#179.
  • Loading branch information
lukehoban committed Nov 15, 2018
1 parent 4925505 commit c7cf24b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
bin/
node_modules/
*.pyc
.Python
include/
lib/
yarn.lock
package-lock.json
Pulumi.*.yaml
Expand Down
6 changes: 3 additions & 3 deletions aws-py-stepfunctions/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

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": {
Expand All @@ -25,7 +25,7 @@
"End": true
}
}
}""" % hello_world_fn.arn
}""" % arn)
)

pulumi.output('state_machine_arn', state_machine.id)
pulumi.export('state_machine_arn', state_machine.id)
4 changes: 2 additions & 2 deletions aws-py-stepfunctions/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pulumi>=0.15.0
pulumi-aws>=0.15.0
pulumi>=0.16.4
pulumi-aws>=0.16.2
8 changes: 6 additions & 2 deletions aws-py-webserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions aws-py-webserver/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
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)
4 changes: 2 additions & 2 deletions aws-py-webserver/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pulumi>=0.15.0
pulumi-aws>=0.15.0
pulumi>=0.16.4
pulumi-aws>=0.16.2

0 comments on commit c7cf24b

Please sign in to comment.