Cleaning up your Amazon DataSync resources - Amazon DataSync
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Cleaning up your Amazon DataSync resources

If you used Amazon DataSync for a test or don't need the Amazon resources that you created, delete them so that you aren't charged for resources you don't plan to use.

Deleting a DataSync agent

When you delete an agent from Amazon DataSync, the agent resource is no longer associated with your Amazon Web Services account and can't be undone.

Keep in mind that deleting an agent from DataSync doesn't remove its virtual machine (VM) or Amazon EC2 instance from your storage environment. You can delete the VM or instance or reuse it to activate a new agent.

Prerequisites

Don't delete an agent until you update or remove the DataSync resources that depend on it. If you're replacing an agent, update your transfer locations with the new agent. If you aren't replacing an agent, delete transfer tasks and locations using that agent first.

Deleting the agent

  1. Open the Amazon DataSync console at https://console.amazonaws.cn/datasync/.

  2. In the left navigation pane, choose Agents.

  3. Choose the agent that you want to delete.

  4. Choose Delete, enter delete in the text box that appears, and then choose Delete.

  5. If you aren't planning to reuse the agent's infrastructure for other DataSync activities, delete the agent's VM or Amazon EC2 instance to remove it from your storage environment.

Deleting a DataSync location

As a best practice, remove the Amazon DataSync locations that you no longer need.

To remove a location by using the DataSync console
  1. Open the Amazon DataSync console at https://console.amazonaws.cn/datasync/.

  2. In the left navigation pane, expand Data transfer, then choose Locations.

  3. Choose the location that you want to remove.

  4. Choose Delete. Confirm the deletion by entering delete, and then choose Delete.

Deleting a DataSync task

If you no longer need an Amazon DataSync task, you can delete it and its related Amazon resources.

Prerequisites

When you run a task, DataSync automatically creates and manages network interfaces for data transfer traffic. When you delete a task, you also delete its related network interfaces as long as you have the following permissions:

  • ec2:DeleteNetworkInterface

  • ec2:DescribeNetworkInterfaces

  • ec2:ModifyNetworkInterfaceAttribute

These permissions are available in the Amazon managed policy AWSDataSyncFullAccess. For more information, see Amazon managed policies for Amazon DataSync.

Deleting the task

Once you delete a task, you can't restore it.

  1. Open the Amazon DataSync console at https://console.amazonaws.cn/datasync/.

  2. In the left navigation pane, expand Data transfer, then choose Tasks.

  3. Select the task that you want to delete.

  4. Choose Actions, then choose Delete.

  5. In the dialog box, choose Delete.

  1. Copy the following delete-task command:

    aws datasync delete-task \ --task-arn "task-to-delete"
  2. For the --task-arn parameter, specify the Amazon Resource Name (ARN) of the task you're deleting (for example, arn:aws-cn:datasync:us-east-2:123456789012:task/task-012345678abcd0123).

  3. Run the delete-task command.