Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Commit

Permalink
[skip ci] Updated README and Install-VaporShell.ps1 (#17)
Browse files Browse the repository at this point in the history
* huge update to version 2.0!

* corrected manifest and psake.ps1 to show v2.0.0

* resolved conflict files

* updates to vsl

* updating documentation on functions

* updating documentation on functions

* fixed tests

* fixed tests

* fixed tests

* fixed tests pt 3

* fixed error type in New-VSError

* v 2.0.0 module done, finalizing README

* [skip ci] Updating README

* [skip ci] Updating README

* [skip ci] updated README

* updated README

* updated README

* updated README

* [skip ci]

* [skip ci]

* [skip ci]

* ready for release

* Updated README

* [skip ci] added mailto

* [skip ci] fixing remote dev

* [skip ci] updated README

* [skip ci] updated README

* [skip ci] updated README

* [skip ci] updated README
  • Loading branch information
scrthq authored Sep 16, 2017
1 parent b37a047 commit 19dce8c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 20 deletions.
Binary file added GitHub/Watch-Stacks.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions Install-VaporShell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ Write-Host "Uncompressing the Zip file to $($targetondisk)" -ForegroundColor Cya
$destination = $shell_app.namespace($targetondisk)
$destination.Copyhere($zip_file.items(), 0x10)
# Rename and import
Write-Host "Renaming folder" -ForegroundColor Cyan
Rename-Item -Path ($targetondisk+"\VaporShell-master") -NewName "VaporShell" -Force
Write-Host "Moving module folder to direct module path" -ForegroundColor Cyan
Move-Item -Path "$targetondisk\VaporShell-master\VaporShell" -Destination $targetondisk -Force
Write-Host -ForegroundColor Cyan "Cleaning up extra files"
Remove-Item -Path "$targetondisk\VaporShell-master" -Force -Recurse -Confirm:$false
Remove-Item -Path $file -Force -Confirm:$false
Write-Host "Module has been installed" -ForegroundColor Green
Import-Module -Name VaporShell
58 changes: 40 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,34 +78,44 @@
- [Features](#features)
- [Example](#example)
- [In Action](#in-action)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [License](#license)

## Features
- __100% coverage:__ if CloudFormation can, VaporShell can too
- __built from AWS's CFN spec sheet:__ 100% coverage of all available CloudFormation resource and property types
- __runs on any OS:__ developed and tested in Windows, Ubuntu, and macOS on PowerShell v3-6
- __validates everything:__ built to make resultant templates reliable
- __goes turbo:__ package and deploy your templates **fast** with one command, `vsl vaporize`
- __validates everything:__ built to make resulting templates reliable by leveraging parameter validation built into PowerShell
- __goes turbo:__ package and deploy your templates **fast** with one command; `vsl vaporize`

## Example
This example...
1. Initializes a VaporShell object
2. Adds a Serverless function with local code as the CodeUri and a schedule of 5 minutes
3. Saves the template as YAML
4. Resolves dependancies and uploads them to an S3 bucket named the same as the stack name "sched-func"
5. Creates a change set with the resolved template
6. Executes the change set
7. Follows with `Watch-Stack` to show colorized Stack Events as they happen

```powershell
$vsl = Initialize-VaporShell -Description "An even more updated function triggered on a timer."
$vsl.AddResource(
( New-SAMFunction -LogicalId "ScheduledFunction" -Handler "index.handler" -Runtime "nodejs6.10" -CodeUri ".\code" -Events (Add-SAMScheduleEventSource -LogicalId Timer -Schedule "rate(5 minutes)"))
)
#1 Initialize a VaporShell object
$vsl = Initialize-VaporShell -Description "A function triggered on a timer."
#2 Add a Serverless function with local code as the CodeUri and a schedule of 5 minutes
$samFunction = New-SAMFunction `
-LogicalId "ScheduledFunction" `
-Handler "index.handler" `
-Runtime "nodejs6.10" `
-CodeUri ".\code" `
-Events (Add-SAMScheduleEventSource -LogicalId Timer -Schedule "rate(5 minutes)")
$vsl.AddResource($samFunction)
$TemplateFile = ".\sched-func.yaml"
#3 Save the template as YAML using the VaporShell object's ToYAML() method (uses cfn-flip to convert to/from YAML)
$vsl.ToYAML($TemplateFile)
vsl vaporize --tf $TemplateFile --sn sched-func --capabilities iam --v --f --w
<#4 Package and deploy the template file (--tf $TemplateFile) as a change set with parameters:
- stack name (--sn) 'sched-func'
- S3 bucket also named 'sched-func' (defaults to the stack name if --s3 is not passed)
- capabilities: CAPABILITY_IAM (--caps iam)
- Verbose (--v) enabled
- Force (--f) enabled (make sure that the bucket is created and objects are uploaded)
- Watch (--w) the stack events in colorized output after executing the change
#>
vsl vaporize --tf $TemplateFile --sn sched-func --caps iam --v --f --w
```
Want to see more examples? Check out the [Examples page](http://vaporshell.io/docs/examples).
Expand All @@ -116,6 +126,18 @@ Want to see more examples? Check out the [Examples page](http://vaporshell.io/do
![Watch-Stack in action](http://vaporshell.io/images/Watch-Stacks.gif)


## Prerequisites

- PowerShell v3+
- .NET 4.5.0+ OR .netstandard 1.3+
- if you have PowerShell 4+, you're covered!


### Recommended

If you are working with YAML templates, you will need to install AWS Labs' [`cfn-flip`](https://github.com/awslabs/aws-cfn-template-flip). VaporShell uses `cfn-flip` under the hood to work with YAML templates, as PowerShell does not natively support YAML at this time. If you are fine working in JSON, then `cfn-flip` is not needed.


## Installation

On PowerShell 5+ or [have PowerShellGet installed](https://www.microsoft.com/en-us/download/details.aspx?id=51451)? Install directly from the PowerShell Gallery:
Expand All @@ -124,12 +146,12 @@ On PowerShell 5+ or [have PowerShellGet installed](https://www.microsoft.com/en-
Install-Module VaporShell -Scope CurrentUser
```

Not on PowerShell 5+? Got you covered too.
Not on PowerShell 5+ and can't install PowerShellGet? Got you covered too.

```powershell
Invoke-Expression (New-Object Net.WebClient).DownloadString("https://raw.githubusercontent.com/scrthq/VaporShell/master/Install-VaporShell.ps1")
```
**Please inspect code before you run it. Here's a handy link to that raw content for you to review: [Install-VaporShell.ps1](https://raw.githubusercontent.com/scrthq/VaporShell/master/Install-VaporShell.ps1)**

## License
[Apache 2.0](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0))
[Apache 2.0](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0))

0 comments on commit 19dce8c

Please sign in to comment.