AWS DataSync Location S3
This page shows how to write Terraform and CloudFormation for DataSync Location S3 and write them securely.
aws_datasync_location_s3 (Terraform)
The Location S3 in DataSync can be configured in Terraform with the resource name aws_datasync_location_s3
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_datasync_location_s3" "source_location" {
s3_bucket_arn = aws_s3_bucket.datasync_bucket.arn
subdirectory = "/source"
s3_config {
bucket_access_role_arn = aws_iam_role.datasync_bucket_access_role.arn
resource "aws_datasync_location_s3" "this" {
s3_bucket_arn = var.s3_bucket_arn
subdirectory = var.subdirectory
tags = var.tags
dynamic "s3_config" {
resource "aws_datasync_location_s3" "example" {
s3_bucket_arn = aws_s3_bucket.example.arn
subdirectory = "/example/prefix"
s3_config {
bucket_access_role_arn = aws_iam_role.example.arn
resource "aws_datasync_location_s3" "wordpress_datasync_location_s3" {
s3_bucket_arn = aws_s3_bucket.wordpress_s3_bucket.arn
subdirectory = "/"
s3_config {
bucket_access_role_arn = aws_iam_role.wp_iam_role_s3_dc.arn
resource "aws_datasync_location_s3" "backup" {
s3_bucket_arn = aws_s3_bucket.backup.arn
subdirectory = "/minecraft"
s3_config {
bucket_access_role_arn = aws_iam_role.backup.arn
Parameters
-
arn
optional computed - string -
id
optional computed - string -
s3_bucket_arn
required - string -
subdirectory
required - string -
tags
optional - map from string to string -
uri
optional computed - string -
s3_config
list block-
bucket_access_role_arn
required - string
-
Explanation in Terraform Registry
Manages an S3 Location within AWS DataSync.
AWS::DataSync::LocationS3 (CloudFormation)
The LocationS3 in DataSync can be configured in CloudFormation with the resource name AWS::DataSync::LocationS3
. 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
-
S3Config
required - S3Config -
S3BucketArn
required - String -
Subdirectory
optional - String -
S3StorageClass
optional - String -
Tags
optional - List of Tag
Explanation in CloudFormation Registry
The
AWS::DataSync::LocationS3
resource specifies an endpoint for an Amazon S3 bucket.For more information, see Create an Amazon S3 location in the AWS DataSync User Guide.
Frequently asked questions
What is AWS DataSync Location S3?
AWS DataSync Location S3 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 Location S3?
For Terraform, the nhsconnect/prm-practice-migration-data-pipeline-prototype, niveklabs/aws and shaikis/terraform-aws-datasync source code examples are useful. See the Terraform Example section for further details.