AWS DataSync Agent

This page shows how to write Terraform and CloudFormation for DataSync Agent and write them securely.

aws_datasync_agent (Terraform)

The Agent in DataSync can be configured in Terraform with the resource name aws_datasync_agent. The following sections describe 2 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L1
resource "aws_datasync_agent" "datasyncagent" {
  ip_address = aws_instance.datasync_agent.public_ip
  name       = var.data_sync_agent_name
main.tf#L7
resource "aws_datasync_agent" "this" {
  activation_key = var.activation_key
  ip_address     = var.ip_address
  name           = var.name
  tags           = var.tags

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages an AWS DataSync Agent deployed on premises.

NOTE: One of activation_key or ip_address must be provided for resource creation (agent activation). Neither is required for resource import. If using ip_address, Terraform must be able to make an HTTP (port 80) GET request to the specified IP address from where it is running. The agent will turn off that HTTP server after activation.

AWS::DataSync::Agent (CloudFormation)

The Agent in DataSync can be configured in CloudFormation with the resource name AWS::DataSync::Agent. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

Explanation in CloudFormation Registry

The AWS::DataSync::Agent resource specifies an AWS DataSync agent to be deployed and activated on your host. The activation process associates your agent with your account. In the activation process, you specify information such as the AWS Region that you want to activate the agent in. You activate the agent in the AWS Region where your target locations (in Amazon S3, Amazon EFS, or Amazon FSx for Windows) reside. Your tasks are created in this AWS Region.

You can activate the agent in a VPC (virtual private cloud) or provide the agent access to a VPC endpoint so you can run tasks without going over the public internet.

You can specify an agent to be used for more than one location. If a task uses multiple agents, all of them need to have status AVAILABLE for the task to run. If you use multiple agents for a source location, the status of all the agents must be AVAILABLE for the task to run. For more information, see Activating an Agent in the AWS DataSync User Guide.

Agents are automatically updated by AWS on a regular basis, using a mechanism that ensures minimal interruption to your tasks.

Frequently asked questions

What is AWS DataSync Agent?

AWS DataSync Agent is a resource for DataSync of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS DataSync Agent?

For Terraform, the shaikis/terraform-aws-datasync and niveklabs/aws source code examples are useful. See the Terraform Example section for further details.