User Args
data class UserArgs(val homeDirectory: Output<String>? = null, val homeDirectoryMappings: Output<List<UserHomeDirectoryMappingArgs>>? = null, val homeDirectoryType: Output<String>? = null, val policy: Output<String>? = null, val posixProfile: Output<UserPosixProfileArgs>? = null, val role: Output<String>? = null, val serverId: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val userName: Output<String>? = null) : ConvertibleToJava<UserArgs>
Provides a AWS Transfer User resource. Managing SSH keys can be accomplished with the aws.transfer.SshKey
resource.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.transfer.Server;
import com.pulumi.aws.transfer.ServerArgs;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.iam.RolePolicy;
import com.pulumi.aws.iam.RolePolicyArgs;
import com.pulumi.aws.transfer.User;
import com.pulumi.aws.transfer.UserArgs;
import com.pulumi.aws.transfer.inputs.UserHomeDirectoryMappingArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var fooServer = new Server("fooServer", ServerArgs.builder()
.identityProviderType("SERVICE_MANAGED")
.tags(Map.of("NAME", "tf-acc-test-transfer-server"))
.build());
final var assumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.effect("Allow")
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.type("Service")
.identifiers("transfer.amazonaws.com")
.build())
.actions("sts:AssumeRole")
.build())
.build());
var fooRole = new Role("fooRole", RoleArgs.builder()
.assumeRolePolicy(assumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
.build());
final var fooPolicyDocument = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.sid("AllowFullAccesstoS3")
.effect("Allow")
.actions("s3:*")
.resources("*")
.build())
.build());
var fooRolePolicy = new RolePolicy("fooRolePolicy", RolePolicyArgs.builder()
.role(fooRole.id())
.policy(fooPolicyDocument.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
.build());
var fooUser = new User("fooUser", UserArgs.builder()
.serverId(fooServer.id())
.userName("tftestuser")
.role(fooRole.arn())
.homeDirectoryType("LOGICAL")
.homeDirectoryMappings(UserHomeDirectoryMappingArgs.builder()
.entry("/test.pdf")
.target("/bucket3/test-path/tftestuser.pdf")
.build())
.build());
}
}
Content copied to clipboard
Import
Using pulumi import
, import Transfer Users using the server_id
and user_name
separated by /
. For example:
$ pulumi import aws:transfer/user:User bar s-12345678/test-username
Content copied to clipboard
Constructors
Link copied to clipboard
fun UserArgs(homeDirectory: Output<String>? = null, homeDirectoryMappings: Output<List<UserHomeDirectoryMappingArgs>>? = null, homeDirectoryType: Output<String>? = null, policy: Output<String>? = null, posixProfile: Output<UserPosixProfileArgs>? = null, role: Output<String>? = null, serverId: Output<String>? = null, tags: Output<Map<String, String>>? = null, userName: Output<String>? = null)
Functions
Properties
Link copied to clipboard
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, /example-bucket-1234/username
would set the home bucket to example-bucket-1234
and the home directory to username
.