
Get-VBRAmazonEC2Subnet
Short Description
Returns an array of Amazon VPC subnets.
Applies to
Platform: VMware, Hyper-V
Product Edition: Community, Standard, Enterprise, Enterprise Plus
Syntax
This cmdlet provides the following parameter sets:
- To get an Amazon VPC subnet by the sunbnet IP range.
Get-VBRAmazonEC2Subnet -VPC <VBRAmazonEC2VPC> -Name <string> [<CommonParameters>] |
- To get an Amazon EC2 subnet by the Availability Zone in which the subnet resides.
Get-VBRAmazonEC2Subnet -VPC <VBRAmazonEC2VPC> [-AvailabilityZone <string>] [<CommonParameters>] |
Detailed Description
This cmdlet returns an array of subnets that are available in the selected Amazon VPC.
Parameters
Parameter | Description | Required | Position | Accept | Accept |
VPC | Specifies the Amazon VPC. Accepts the VBRAmazonEC2VPC type. | True | Named | False |
|
Name | Specifies the IP range. The cmdlet will return the Amazon VPC subnet with the this IP range. | True | Named | False |
|
AvailabilityZone | Specifies the Availability Zone. The cmdlet will return the Amazon VPC subnet that resides in the specified Availability Zone. | False | Named | False |
|
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information about common parameters, see http://go.microsoft.com/fwlink/p/?LinkID=113216.
Return Type
Example
This example shows how to get the Amazon VPC subnet by geographical location the associated Availability Zone.
- Run Get-VBRAmazonAccount to get Amazon EC2 credentials records. Save the result to the $account variable.
- Run Get-VBRAmazonEC2Region with the $account variable. Use the RegionType and Name parameters to specify the type and name of the AWS region. Save the result to the $region variable.
- Run Get-VBRAmazonEC2VPC with the $region variable to get the Amazon VPC. Save the result to the $vpc variable.
- Run Get-VBRAmazonEC2Subnet with the $vpc variable. Use the AvailabilityZone parameter to specify the Availability Zone in which the subnet resides.
$account = Get-VBRAmazonAccount -Name "EC2" $region = Get-VBRAmazonEC2Region -Account $account -RegionType Global -Name "ap-northeast-1" $vpc = Get-VBRAmazonEC2VPC -Region $region Get-VBRAmazonEC2Subnet -VPC $vpc -AvailabilityZone eu-west-1a |
Related Commands