Resource: aws_datasync_agent

Manages an AWS DataSync Agent deployed on premises.

Example Usage

resource "aws_datasync_agent" "example" {
  ip_address = "1.2.3.4"
  name       = "example"
}

Example Usage with VPC Endpoints

resource "aws_datasync_agent" "example" {
  ip_address            = "1.2.3.4"
  security_group_arns   = [aws_security_group.example.arn]
  subnet_arns           = [aws_subnet.example.arn]
  vpc_endpoint_id       = aws_vpc_endpoint.example.id
  private_link_endpoint = data.aws_network_interface.example.private_ip
  name                  = "example"
}

data "aws_region" "current" {}

resource "aws_vpc_endpoint" "example" {
  service_name       = "com.amazonaws.${data.aws_region.current.name}.datasync"
  vpc_id             = aws_vpc.example.id
  security_group_ids = [aws_security_group.example.id]
  subnet_ids         = [aws_subnet.example.id]
  vpc_endpoint_type  = "Interface"
}

data "aws_network_interface" "example" {
  id = tolist(aws_vpc_endpoint.example.network_interface_ids)[0]
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Timeouts

Configuration options:

Import

In Terraform v1.5.0 and later, use an import block to import aws_datasync_agent using the DataSync Agent Amazon Resource Name (ARN). For example:

import {
  to = aws_datasync_agent.example
  id = "arn:aws:datasync:us-east-1:123456789012:agent/agent-12345678901234567"
}

Using terraform import, import aws_datasync_agent using the DataSync Agent Amazon Resource Name (ARN). For example:

% terraform import aws_datasync_agent.example arn:aws:datasync:us-east-1:123456789012:agent/agent-12345678901234567