Skip to content

Resource: awsTransferAccess

Provides a AWS Transfer Access resource.

Example Usage

Basic S3

/*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.transferAccess.TransferAccess(this, "example", {
  externalId: "S-1-1-12-1234567890-123456789-1234567890-1234",
  homeDirectory: "/${aws_s3_bucket.example.id}/",
  role: "${aws_iam_role.example.arn}",
  serverId: "${aws_transfer_server.example.id}",
});

Basic EFS

/*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.transferAccess.TransferAccess(this, "test", {
  externalId: "S-1-1-12-1234567890-123456789-1234567890-1234",
  homeDirectory: "/${aws_efs_file_system.test.id}/",
  posixProfile: {
    gid: 1000,
    uid: 1000,
  },
  role: "${aws_iam_role.test.arn}",
  serverId: "${aws_transfer_server.test.id}",
});

Argument Reference

The following arguments are supported:

  • externalId - (Required) The SID of a group in the directory connected to the Transfer Server (e.g., s1112123456789012345678912345678901234)
  • serverId - (Required) The Server ID of the Transfer Server (e.g., s12345678)
  • homeDirectory - (Optional) The landing directory (folder) for a user when they log in to the server using their SFTP client. It should begin with a /. The first item in the path is the name of the home bucket (accessible as ${transfer:homeBucket} in the policy) and the rest is the home directory (accessible as ${transfer:homeDirectory} in the policy). For example, /exampleBucket1234/username would set the home bucket to exampleBucket1234 and the home directory to username.
  • homeDirectoryMappings - (Optional) Logical directory mappings that specify what S3 paths and keys should be visible to your user and how you want to make them visible. See Home Directory Mappings below.
  • homeDirectoryType - (Optional) The type of landing directory (folder) you mapped for your users' home directory. Valid values are path and logical.
  • policy - (Optional) An IAM JSON policy document that scopes down user access to portions of their Amazon S3 bucket. IAM variables you can use inside this policy include ${transfer:userName}, ${transfer:homeDirectory}, and ${transfer:homeBucket}. Since the IAM variable syntax matches Terraform's interpolation syntax, they must be escaped inside Terraform configuration strings ($${transfer:userName}). These are evaluated on-the-fly when navigating the bucket.
  • posixProfile - (Optional) Specifies the full POSIX identity, including user ID (Uid), group ID (Gid), and any secondary groups IDs (SecondaryGids), that controls your users' access to your Amazon EFS file systems. See Posix Profile below.
  • role - (Required) Amazon Resource Name (ARN) of an IAM role that allows the service to controls your user’s access to your Amazon S3 bucket.

Home Directory Mappings

  • entry - (Required) Represents an entry and a target.
  • target - (Required) Represents the map target.

Posix Profile

  • gid - (Required) The POSIX group ID used for all EFS operations by this user.
  • uid - (Required) The POSIX user ID used for all EFS operations by this user.
  • secondaryGids - (Optional) The secondary POSIX group IDs used for all EFS operations by this user.

Attributes Reference

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

  • id - The ID of the resource

Import

Transfer Accesses can be imported using the serverId and externalId, e.g.,

$ terraform import aws_transfer_access.example s-12345678/S-1-1-12-1234567890-123456789-1234567890-1234