Skip to content

Resource: awsDatasyncLocationS3

Manages an S3 Location within AWS DataSync.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.datasyncLocationS3.DatasyncLocationS3(this, "example", {
  s3BucketArn: "${aws_s3_bucket.example.arn}",
  s3Config: {
    bucketAccessRoleArn: "${aws_iam_role.example.arn}",
  },
  subdirectory: "/example/prefix",
});

Argument Reference

The following arguments are supported:

  • agentArns - (Optional) A list of DataSync Agent ARNs with which this location will be associated.
  • s3BucketArn - (Required) Amazon Resource Name (ARN) of the S3 Bucket.
  • s3Config - (Required) Configuration block containing information for connecting to S3.
  • s3StorageClass - (Optional) The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values
  • subdirectory - (Required) Prefix to perform actions as source or destination.
  • tags - (Optional) Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

s3_config Argument Reference

The following arguments are supported inside the s3Config configuration block:

  • bucketAccessRoleArn - (Required) ARN of the IAM Role used to connect to the S3 Bucket.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - Amazon Resource Name (ARN) of the DataSync Location.
  • arn - Amazon Resource Name (ARN) of the DataSync Location.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

awsDatasyncLocationS3 can be imported by using the DataSync Task Amazon Resource Name (ARN), e.g.,

$ terraform import aws_datasync_location_s3.example arn:aws:datasync:us-east-1:123456789012:location/loc-12345678901234567