Get-VBRAmazonEC2Subnet
Short Description
Returns an array of Amazon VPC subnets.
Applies to
Platform: VMware, Hyper-V
Product Edition: Community, Standard, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
This cmdlet provides the following parameter sets:
- To get an Amazon VPC subnet by the sunbnet IP range.
- To get an Amazon EC2 subnet by the Availability Zone in which the subnet resides.
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 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 on common parameters, see the About CommonParameters section of Microsoft Docs.
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 -Id "936edf7c-7cf3-4dbd-9895-c7485ef4bb2c" $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