Skip to content

Commit

Permalink
Update all examples to v0.12 SDK. Add an .mp4 example for video thumb…
Browse files Browse the repository at this point in the history
…nailer. (pulumi#48)
  • Loading branch information
lindydonna authored Apr 30, 2018
1 parent 4c795ce commit a876e35
Show file tree
Hide file tree
Showing 23 changed files with 333 additions and 446 deletions.
34 changes: 4 additions & 30 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"label": "voting app",
"type": "typescript",
"tsconfig": "voting-app/tsconfig.json",
"tsconfig": "cloud-ts-voting-app/tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
Expand All @@ -17,7 +17,7 @@
{
"label": "url shortener",
"type": "typescript",
"tsconfig": "url-shortener/tsconfig.json",
"tsconfig": "cloud-ts-url-shortener/tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
Expand All @@ -30,7 +30,7 @@
{
"label": "url shortener with cache",
"type": "typescript",
"tsconfig": "url-shortener-with-cache/tsconfig.json",
"tsconfig": "cloud-ts-url-shortener-cache/tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
Expand All @@ -39,32 +39,6 @@
"kind": "build",
"isDefault": true
}
},
{
"label": "webserver",
"type": "typescript",
"tsconfig": "webserver/tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "webserver-component",
"type": "typescript",
"tsconfig": "webserver-component/tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
],
"group": {
"kind": "build",
"isDefault": true
}
}
},
]
}
37 changes: 17 additions & 20 deletions aws-js-s3-folder-component/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@ The component version of [aws-js-s3-folder](../aws-js-s3-folder). For a detailed

## Deploying and running the program

1. Initialize a Pulumi repository with `pulumi init`, using your GitHub username. (Note: this step will be removed in the future.)

```bash
$ pulumi init --owner githubUsername
```

1. Create a new stack:

```bash
$ pulumi stack init website-testing
$ pulumi stack init website-component-testing
```

1. Set the AWS region:
Expand All @@ -24,26 +18,29 @@ The component version of [aws-js-s3-folder](../aws-js-s3-folder). For a detailed

1. Restore NPM modules via `npm install`.

1. Run `pulumi preview` to see what AWS resources will be created.

1. Now, provision resources via `pulumi update`:
1. Run `pulumi update` to preview and deploy changes.

```bash
$ pulumi update
Updating stack 's3foldercomponent-testing' in the Pulumi Cloud ☁️
Previewing stack 'website-component-testing'
Previewing changes:
...
Performing changes:
pulumi:Stack("aws-js-s3-folder-component-s3foldercomponent-testing"): Completed
examples:S3Folder("pulumi-static-site"): + Created
aws:Bucket("pulumi-static-site"): + Created
aws:BucketPolicy("bucketPolicy"): + Created
aws:BucketObject("favicon.png"): + Created
aws:BucketObject("index.html"): + Created
#: Resource Type Name
1: pulumi:pulumi:Stack aws-js-s3-folder-component-website-component-testing
2: examples:S3Folder pulumi-static-site
3: aws:s3:Bucket pulumi-static-site
4: aws:s3:BucketPolicy bucketPolicy
5: aws:s3:BucketObject favicon.png
6: aws:s3:BucketObject index.html
info: 6 changes performed:
+ 6 resources created
Update duration: 6.952010989s
Update duration: 6.159165618s
Permalink: https://pulumi.com/lindydonna/examples/aws-js-s3-folder-component/s3foldercomponent-testing/updates/3
Permalink: https://pulumi.com/lindydonna/examples/aws-js-s3-folder-component/website-component-testing/updates/1
```

1. To see the resources that were created, run `pulumi stack output`:
Expand Down Expand Up @@ -71,4 +68,4 @@ The component version of [aws-js-s3-folder](../aws-js-s3-folder). For a detailed
s3-website-bucket-8533d8b.s3-website-us-west-2.amazonaws.com
```


1. To clean up resources, run `pulumi destroy` and answer the confirmation question at the prompt.
4 changes: 2 additions & 2 deletions aws-js-s3-folder-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "aws-js-s3-folder-component",
"main": "index.js",
"dependencies": {
"@pulumi/aws": "^0.11.0",
"@pulumi/pulumi": "^0.11.0",
"@pulumi/aws": "^0.12.0",
"@pulumi/pulumi": "^0.12.0",
"mime": "^2.2.2"
}
}
46 changes: 14 additions & 32 deletions aws-js-s3-folder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ A static website that uses [S3's website support](https://docs.aws.amazon.com/Am

## Deploying and running the program

1. Initialize a Pulumi repository with `pulumi init`, using your GitHub username. (Note: this step will be removed in the future.)

```bash
$ pulumi init --owner githubUsername
```

1. Create a new stack:

```bash
Expand All @@ -24,39 +18,28 @@ A static website that uses [S3's website support](https://docs.aws.amazon.com/Am

1. Restore NPM modules via `npm install`.

1. Run `pulumi preview` to see what AWS resources will be created:
1. Run `pulumi update` to preview and deploy changes.

```bash
$ pulumi preview
Previewing stack 'testing' in the Pulumi Cloud ☁️
$ pulumi update
Previewing stack 'website-testing'
Previewing changes:
...
pulumi:Stack("aws-js-s3-folder-testing"): Completed
aws:Bucket("s3-website-bucket"): + Would create
aws:BucketPolicy("bucketPolicy"): + Would create
aws:BucketObject("favicon.png"): + Would create
aws:BucketObject("index.html"): + Would create
info: 5 changes previewed:
+ 5 resources to create
```

1. Now, provision resources via `pulumi update`:

```bash
$ pulumi update
Updating stack 'testing' in the Pulumi Cloud ☁️
Performing changes:
pulumi:Stack("aws-js-s3-folder-testing"): Completed
aws:Bucket("s3-website-bucket"): + Created
aws:BucketPolicy("bucketPolicy"): + Created
aws:BucketObject("favicon.png"): + Created
aws:BucketObject("index.html"): + Created
#: Resource Type Name Status Extra Inf
1: pulumi:pulumi:Stack aws-js-s3-folder-website-testing + created
2: aws:s3:Bucket s3-website-bucket + created
3: aws:s3:BucketPolicy bucketPolicy + created
4: aws:s3:BucketObject favicon.png + created
5: aws:s3:BucketObject index.html + created
info: 5 changes performed:
+ 5 resources created
Update duration: 7.083525991s
Update duration: 8.827698762s
Permalink: https://pulumi.com/lindydonna/examples/aws-js-s3-folder/testing/updates/9
Permalink: https://pulumi.com/lindydonna/examples/aws-js-s3-folder/website-testing/updates/1
```

1. To see the resources that were created, run `pulumi stack output`:
Expand Down Expand Up @@ -86,5 +69,4 @@ A static website that uses [S3's website support](https://docs.aws.amazon.com/Am

![Hello S3 example](images/part2-website.png)



1. To clean up resources, run `pulumi destroy` and answer the confirmation question at the prompt.
4 changes: 2 additions & 2 deletions aws-js-s3-folder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "aws-js-s3-folder",
"main": "index.js",
"dependencies": {
"@pulumi/aws": "^0.11.0",
"@pulumi/pulumi": "^0.11.0",
"@pulumi/aws": "^0.12.0",
"@pulumi/pulumi": "^0.12.0",
"mime": "^2.2.2"
}
}
4 changes: 2 additions & 2 deletions aws-js-webserver-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"main": "index.js",
"dependencies": {
"@pulumi/pulumi": "^0.11.0",
"@pulumi/aws": "^0.11.0"
"@pulumi/pulumi": "^0.12.0",
"@pulumi/aws": "^0.12.0"
}
}
4 changes: 2 additions & 2 deletions aws-js-webserver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"main": "index.js",
"dependencies": {
"@pulumi/pulumi": "^0.11.0",
"@pulumi/aws": "^0.11.0"
"@pulumi/pulumi": "^0.12.0",
"@pulumi/aws": "^0.12.0"
}
}
60 changes: 35 additions & 25 deletions aws-py-webserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,50 +13,60 @@ https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/deploying.applicat

1. Login to the Pulumi CLI via `pulumi login`.

1. Initialize a Pulumi repository with pulumi init, using your GitHub username. (Note: this step will be removed in the future.)
1. Create a new stack:

```bash
$ pulumi init --owner githubUsername
```
$ pulumi stack init python-webserver-testing
```

1. Create a new stack:
1. Since Pulumi is in private beta, run the following to install pip packages. For more information, see [Using Pulumi PyPI Packages](https://docs.pulumi.com/reference/python.html#pypi-packages).

```
$ pulumi stack init webserver-testing
Created stack 'webserver-testing'.
pip install \
--extra-index-url https://${PULUMI_ACCESS_TOKEN}@pypi.pulumi.com/simple \
-r requirements.txt
```

1. Run `pulumi preview`:
1. Set the AWS region:

```
$ pulumi preview
Previewing stack 'python-test' in the Pulumi Cloud ☁️
Previewing changes:

pulumi:Stack("webserver-py-python-test"): Completed
aws:SecurityGroup("web-secgrp"): + Would create
aws:Instance("web-server-www"): + Would create
info: 3 changes previewed:
+ 3 resources to create
$ pulumi config set aws:region us-west-2
```

1. Run `pulumi update`:
1. Run `pulumi update` to preview and deploy changes:

```
$ pulumi update
Updating stack 'python-test' in the Pulumi Cloud ☁️
Previewing stack 'python-webserver-testing'
Previewing changes:
...
Do you want to proceed? yes
Updating stack 'python-webserver-testing'
Performing changes:
pulumi:Stack("webserver-py-python-test"): Completed
aws:SecurityGroup("web-secgrp"): + Created
aws:Instance("web-server-www"): + Created
#: Resource Type Name Status Extra Info
1: pulumi:pulumi:Stack webserver-py-python-webserver-testing + created
2: aws:ec2:SecurityGroup web-secgrp + created
3: aws:ec2:Instance web-server-www + created
info: 3 changes performed:
+ 3 resources created
Update duration: 26.445180782s
Update duration: 26.470339302s
Permalink: https://pulumi.com/lindydonna/examples/webserver-py/python-webserver-testing/updates/1
```

1. Verify that the EC2 instance exists, by either using the AWS Console or running `aws ec2 describe-instances`.
1. View the host name and IP address of the instance via `stack output`:

1. Clean up resources by running `pulumi destroy`.
```
$ pulumi stack output
Current stack outputs (2):
OUTPUT VALUE
public_dns ec2-34-217-176-141.us-west-2.compute.amazonaws.com
public_ip 34.217.176.141
```


1. Verify that the EC2 instance exists, by either using the AWS Console or running `aws ec2 describe-instances`.

1. Clean up resources by running `pulumi destroy` and answering the confirmation question at the prompt.
2 changes: 1 addition & 1 deletion aws-py-webserver/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pulumi>=0.11.0
pulumi>=0.12.0
13 changes: 4 additions & 9 deletions aws-ts-serverless-raw/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,12 @@ $ cd ..
# Build the Pulumi program
$ npm run build

# Preview the deployment
$ pulumi preview
Previewing changes:
[snip...]
info: 9 changes previewed:
+ 9 resources to create

# Deploy the update
# Preview and run the deployment
$ pulumi update
Previewing changes:
...
Performing changes:
[snip...]
...
info: 9 changes performed:
+ 9 resources created
Update duration: 25.017340162s
Expand Down
4 changes: 2 additions & 2 deletions aws-ts-serverless-raw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"typescript": "^2.7.2"
},
"dependencies": {
"@pulumi/aws": "^0.11.0",
"@pulumi/pulumi": "^0.11.0"
"@pulumi/aws": "^0.12.0",
"@pulumi/pulumi": "^0.12.0"
}
}
Loading

0 comments on commit a876e35

Please sign in to comment.