Skip to content

Latest commit

 

History

History

datasync-locations

AWS DataSync Locations Terraform sub-module

Creates a Datasync source or destination Location. DataSync Location defines where the data is copied from or to.

DataSync Locations supported in this module

  • Amazon S3
  • Amazon EFS

S3 Locations

To configure one or more S3 Locations use the s3_locations variable. It is a list that supports objects with the following attributes.

  • name - (Required) A name for the location for reference only. Should be unique.
  • agent_arns - (Optional) A list of DataSync Agent ARNs with which this location will be associated.
  • s3_bucket_arn - (Required) Amazon Resource Name (ARN) of the S3 Bucket.
  • s3_config_bucket_access_role_arn - (Optional) ARN of the IAM Role used to connect to the S3 Bucket. Must be provided if create_role is set to false.
  • s3_storage_class - (Optional) The Amazon S3 storage class that you want to store your files in when this location is used as a task destination.
  • 3_source_bucket_kms_arn - (Optional) ARN of the KMS Customer Managed Key to encrypt the source S3 Objects.
  • 3_source_bucket_kms_arn - (Optional) ARN of the KMS Customer Managed Key to encrypt the destination S3 Objects.
  • subdirectory - (Optional) Prefix to perform actions as source or destination.
  • tags - (Optional) Key-value pairs of resource tags to assign to the DataSync Location.
  • create_role - (Optional) Whether to create the IAM role for accessing the S3 bucket (true) or provide it directly (false). Default is true. If this is set to false, specify an existing IAM role for: s3_config_bucket_access_role_arn.

EFS Locations

To configure one or more EFS Locations use the efs_locations variable. It is a list that supports objects with the following attributes.

  • name - (Required) A name for the location for reference only. Should be unique.
  • access_point_arn - (Optional) Specifies the Amazon Resource Name (ARN) of the access point that DataSync uses to access the Amazon EFS file system.
  • ec2_config_security_group_arns - (Required) List of Amazon Resource Names (ARNs) of the EC2 Security Groups that are associated with the EFS Mount Target.
  • ec2_config_subnet_arn - (Required) Amazon Resource Name (ARN) of the EC2 Subnet that is associated with the EFS Mount Target.
  • efs_file_system_arn - (Required) Amazon Resource Name (ARN) of EFS File System.
  • file_system_access_role_arn - (Optional) Specifies an Identity and Access Management (IAM) role that DataSync assumes when mounting the Amazon EFS file system.
  • in_transit_encryption - (Optional) Specifies whether you want DataSync to use TLS encryption when transferring data to or from your Amazon EFS file system. Valid values are NONE and TLS1_2.
  • subdirectory - (Optional) Subdirectory to perform actions as source or destination. Default /.
  • tags - (Optional) Key-value pairs of resource tags to assign to the DataSync Location.

Requirements

No requirements.

Providers

Name Version
aws n/a

Modules

No modules.

Resources

Name Type
aws_datasync_location_efs.efs_location resource
aws_datasync_location_s3.s3_location resource
aws_iam_role.datasync_role_s3 resource

Inputs

Name Description Type Default Required
efs_locations A list of EFS locations and associated configuration
list(object({
name = string
access_point_arn = optional(string)
ec2_config_security_group_arns = list(string)
ec2_config_subnet_arn = string
efs_file_system_arn = string
file_system_access_role_arn = optional(string)
in_transit_encryption = optional(string)
subdirectory = optional(string)
tags = optional(map(string))
}))
[] no
s3_locations A list of S3 locations and associated configuration
list(object({
name = string
agent_arns = optional(list(string))
s3_bucket_arn = string
s3_config_bucket_access_role_arn = optional(string)
s3_storage_class = optional(string)
subdirectory = optional(string)
tags = optional(map(string))
create_role = optional(bool)
}))
[] no

Outputs

Name Description
datasync_role_arn DataSync IAM Role
efs_locations DataSync Location ARN for EFS
s3_locations DataSync Location ARN for S3