https://github.com/sam-martin/awstesthelper
Set of PowerShell cmdlets for safely spinning AWS VPCs up and down for testing purposes
https://github.com/sam-martin/awstesthelper
Last synced: about 1 year ago
JSON representation
Set of PowerShell cmdlets for safely spinning AWS VPCs up and down for testing purposes
- Host: GitHub
- URL: https://github.com/sam-martin/awstesthelper
- Owner: Sam-Martin
- Created: 2017-08-02T15:29:45.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-21T14:03:45.000Z (over 8 years ago)
- Last Synced: 2025-02-04T22:25:34.422Z (over 1 year ago)
- Language: PowerShell
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWSTestHelper [](https://ci.appveyor.com/project/Sam-Martin/awstesthelper) []()
Set of PowerShell cmdlets for safely spinning AWS VPCs up and down for testing purposes.
This module is useful when you want to quickly spin up an isolated, short-lived instance for testing purposes.
# Usage
Installation can be done from the [PowerShell Gallery](https://www.powershellgallery.com/packages/AWSTestHelper/) using the following command.
```
Install-Module -Name AWSTestHelper
```
## VPC Creation
This module handles the creation of an AWS VPC including:
* Internet Gateway
* 1 x Public Subnet
* EC2 Role with SSM rights
This is achieved using the `New-AWSTestEnvironmentStack` cmdlet.
### Example
```
New-AWSTestEnvironmentStack -Region eu-west-1 -ID Default
```
## Waiting for VPC Creation
The creation of a new VPC and resources listed above can take some time. In order to let your script wait for the VPC creation, you can use the `Wait-AWSTestEnvironmentStackCreation` cmdlet.
### Example
```
Wait-AWSTestEnvironmentStackCreation -Region eu-west-1 -ID Default
```
## VPC Discovery
Once the VPC has been created you can find the pertinent resource IDs using the `Get-AWSTestEnvironmentStackOutputs` cmdlet.
### Example
```
Get-AWSTestEnvironmentStackOutputs -Region eu-west-1 -ID Default
```
## VPC Deletion
Once you have finished with your test VPC, you can delete it using the `Remove-AWSTestEnvironmentStack` cmdlet.
### Example
```
Remove-AWSTestEnvironmentStack -Region eu-west-1 -ID Default -TerminateInstances -Confirm:$false
```
*Note:* using the `-TerminateInstances` switch will force the termination of instances launched in the VPC.
## Identity
You will note in the examples above that a parameter `-ID` is used in every cmdlet. This identifier is appended to the name of all resources to ensure that they are uniquely identifiable.
**Important:** The value you pass to `-ID` is case sensitive.
# Authors
- Sam Martin (samjackmartin@gmail.com)