--- title: "Set-VBRAmazonEC2Container" description: "Modifies a scope of Amazon EC2 instances, EC2 tags or AWS datacenters for a protection group. Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License Modifies a scope of Amazon EC2 instances, EC2 tags or AWS datacenters for a " canonical: "https://helpcenter.veeam.com/docs/vbr/powershell/set-vbramazonec2container.html" breadcrumb: "Veeam PowerShell Reference > Veeam PowerShell Reference > Veeam Agent Management > Working with Protection Groups > Veeam Agent Management Protection Scope > Set-VBRAmazonEC2Container" dateModified: "2026-08-19" --- # Set-VBRAmazonEC2Container ## Short Description Modifies a scope of Amazon EC2 instances, EC2 tags or AWS datacenters for a protection group. **Product Edition**: Standard, Enterprise, Enterprise Plus, Veeam Universal License ## Syntax ``` Set-VBRAmazonEC2Container -Container [-Region ] [-Entity ] [-ExcludeEntities] [-ExcludedEntity ] [-AutoAssignIAMRole] [] ``` ## Detailed Description Modifies a scope of Amazon EC2 instances, EC2 tags or AWS datacenters for a protection group. ::: note To modify settings, specify new values for the necessary parameters. The cmdlet will overwrite the previous parameter values with new values. The parameters that you omit will remain unchanged. ::: ## Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

AutoAssignIAMRole

Defines that the cmdlet will automatically set the IAM role with the AmazonSSMManagedInstanceCore policy to the EC2 instances that you want to back up.

If you do not provide this parameter, you will have to set the IAM role manually.

SwitchParameter

False

Named

True (ByPropertyName, ByValue)

Container

Specifies a scope of the following entities that you want to modify:

  • EC2 instances.
  • EC2 tags.
  • AWS datacenters.

Accepts the VBRAmazonEC2Container object. To create this object, run the New-VBRAmazonEC2Container cmdlet.

VBRAmazonEC2Container

True

Named

True (ByPropertyName, ByValue)

Entity

Specifies an array of the following entities that the cmdlet till add to a scope of a protection group:

  • EC2 instances.
  • EC2 tags.
  • AWS datacenters.

Accepts the Object[] object. To get this object, run the following cmdlets:

Object[]

False

Named

True (ByPropertyName, ByValue)

ExcludedEntity

Specifies the following entities that you do not want to add to a protection group:

  • EC2 instances.
  • EC2 tags.
  • AWS datacenters.

Object[]

False

Named

True (ByPropertyName, ByValue)

ExcludeEntities

Defines that the cmdlet will exclude EC2 instances from a scope of a protection group.

SwitchParameter

False

Named

True (ByPropertyName, ByValue)

Region

Specifies AWS Regions in which you want to deploy Veeam Agent on cloud machines.

Accepts the VBRAmazonEC2Region object. To create this object, run the Get-VBRAmazonEC2Region cmdlet.

VBRAmazonEC2Region

False

Named

True (ByPropertyName, ByValue)

`` This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see [ Microsoft Docs](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_commonparameters?view=powershell-7). ## Output Object [`VBRAmazonEC2Container`](vbramazonec2container.md) ## Examples ::: example ### Modifying Scope of AWS Datacenters for Protection Group This example shows how to modify the scope of AWS datacenters. The cmdlet will change the datacenter from eu-central-1 to eu-north-1. ``` $AWSaccount = Get-VBRAmazonAccount -Id "936edf7c-7cf3-4dbd-9895-c7485ef4bb2c" $datacenter = Get-VBRAmazonEC2Region -Account $AWSaccount -RegionType Global -Name "eu-central-1" $container = New-VBRAmazonEC2Container -Region $AWSregion -Entity $datacenter $DCNew = Get-VBRAmazonEC2Region -Account $AWSaccount -RegionType Global -Name "eu-north-1" Set-VBRAmazonEC2Container -Container $container -Entity $DCNew ``` Perform the following steps: 1. Define the AWS datacenter protection scope: 1. Run the [`Get-VBRAmazonAccount`](get-vbramazonaccount.md) cmdlet. Specify the `Id` parameter value. Save the result to the `$AWSaccount` variable. 2. Run the [`Get-VBRAmazonEC2Region`](get-vbramazonec2region.md) cmdlet. Set the `$AWSaccount` variable as the `Account` parameter value. Set the `Global` value as the `RegionType` parameter value. Specify the `Name` parameter value. Save the result to the `$datacenter` variable. 3. Run the [`New-VBRAmazonEC2Container`](new-vbramazonec2container.md) cmdlet. Set the `$AWSregion` variable as the `Region` parameter value. Set the `$datacenter` variable as the `Entity` parameter value. Save the result to the `$container` variable. 2. Run the [`Get-VBRAmazonEC2Region`](get-vbramazonec2region.md) cmdlet. Set the `$AWSaccount` variable as the `Account` parameter value. Set the `Global` value as the `RegionType` parameter value. Specify the `Name` parameter value. Save the result to the `$DCNew` variable. 3. Run the `Set-VBRAmazonEC2Container` cmdlet. Set the `$container` variable as the `Container` parameter value. Set the `$DCNew` variable as the `Entity` parameter value. ::: ## Related Commands - [`Get-VBRAmazonAccount`](get-vbramazonaccount.md) - [`Get-VBRAmazonEC2Region`](get-vbramazonec2region.md) - [`New-VBRAmazonEC2Container`](new-vbramazonec2container.md)