This is an archive version of the document. To get the most up-to-date information, see the current version.

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.

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
Pipeline
Input

Accept
Wildcard
Characters

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.

  1. Run Get-VBRAmazonAccount to get Amazon EC2 credentials records. Save the result to the $account variable.
  2. 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.
  3. Run Get-VBRAmazonEC2VPC with the $region variable to get the Amazon VPC. Save the result to the $vpc variable.
  4. 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

Get-VBRAmazonAccount

Get-VBRAmazonEC2Region

Get-VBRAmazonEC2VPC