aws_sdk_transfer/client/
create_user.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
    /// Constructs a fluent builder for the [`CreateUser`](crate::operation::create_user::builders::CreateUserFluentBuilder) operation.
    ///
    /// - The fluent builder is configurable:
    ///   - [`home_directory(impl Into<String>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::home_directory) / [`set_home_directory(Option<String>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_home_directory):<br>required: **false**<br><p>The landing directory (folder) for a user when they log in to the server using the client.</p> <p>A <code>HomeDirectory</code> example is <code>/bucket_name/home/mydirectory</code>.</p><note>  <p>The <code>HomeDirectory</code> parameter is only used if <code>HomeDirectoryType</code> is set to <code>PATH</code>.</p> </note><br>
    ///   - [`home_directory_type(HomeDirectoryType)`](crate::operation::create_user::builders::CreateUserFluentBuilder::home_directory_type) / [`set_home_directory_type(Option<HomeDirectoryType>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_home_directory_type):<br>required: **false**<br><p>The type of landing directory (folder) that you want your users' home directory to be when they log in to the server. If you set it to <code>PATH</code>, the user will see the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer protocol clients. If you set it to <code>LOGICAL</code>, you need to provide mappings in the <code>HomeDirectoryMappings</code> for how you want to make Amazon S3 or Amazon EFS paths visible to your users.</p><note>  <p>If <code>HomeDirectoryType</code> is <code>LOGICAL</code>, you must provide mappings, using the <code>HomeDirectoryMappings</code> parameter. If, on the other hand, <code>HomeDirectoryType</code> is <code>PATH</code>, you provide an absolute path using the <code>HomeDirectory</code> parameter. You cannot have both <code>HomeDirectory</code> and <code>HomeDirectoryMappings</code> in your template.</p> </note><br>
    ///   - [`home_directory_mappings(HomeDirectoryMapEntry)`](crate::operation::create_user::builders::CreateUserFluentBuilder::home_directory_mappings) / [`set_home_directory_mappings(Option<Vec::<HomeDirectoryMapEntry>>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_home_directory_mappings):<br>required: **false**<br><p>Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should be visible to your user and how you want to make them visible. You must specify the <code>Entry</code> and <code>Target</code> pair, where <code>Entry</code> shows how the path is made visible and <code>Target</code> is the actual Amazon S3 or Amazon EFS path. If you only specify a target, it is displayed as is. You also must ensure that your Identity and Access Management (IAM) role provides access to paths in <code>Target</code>. This value can be set only when <code>HomeDirectoryType</code> is set to <i>LOGICAL</i>.</p> <p>The following is an <code>Entry</code> and <code>Target</code> pair example.</p> <p><code>\[ { "Entry": "/directory1", "Target": "/bucket_name/home/mydirectory" } \]</code></p> <p>In most cases, you can use this value instead of the session policy to lock your user down to the designated home directory ("<code>chroot</code>"). To do this, you can set <code>Entry</code> to <code>/</code> and set <code>Target</code> to the value the user should see for their home directory when they log in.</p> <p>The following is an <code>Entry</code> and <code>Target</code> pair example for <code>chroot</code>.</p> <p><code>\[ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } \]</code></p><br>
    ///   - [`policy(impl Into<String>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::policy) / [`set_policy(Option<String>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_policy):<br>required: **false**<br><p>A session policy for your user so that you can use the same Identity and Access Management (IAM) role across multiple users. This policy scopes down a user's access to portions of their Amazon S3 bucket. Variables that you can use inside this policy include <code>${Transfer:UserName}</code>, <code>${Transfer:HomeDirectory}</code>, and <code>${Transfer:HomeBucket}</code>.</p><note>  <p>This policy applies only when the domain of <code>ServerId</code> is Amazon S3. Amazon EFS does not use session policies.</p>  <p>For session policies, Transfer Family stores the policy as a JSON blob, instead of the Amazon Resource Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the <code>Policy</code> argument.</p>  <p>For an example of a session policy, see <a href="https://docs.aws.amazon.com/transfer/latest/userguide/session-policy.html">Example session policy</a>.</p>  <p>For more information, see <a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html">AssumeRole</a> in the <i>Amazon Web Services Security Token Service API Reference</i>.</p> </note><br>
    ///   - [`posix_profile(PosixProfile)`](crate::operation::create_user::builders::CreateUserFluentBuilder::posix_profile) / [`set_posix_profile(Option<PosixProfile>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_posix_profile):<br>required: **false**<br><p>Specifies the full POSIX identity, including user ID (<code>Uid</code>), group ID (<code>Gid</code>), and any secondary groups IDs (<code>SecondaryGids</code>), that controls your users' access to your Amazon EFS file systems. The POSIX permissions that are set on files and directories in Amazon EFS determine the level of access your users get when transferring files into and out of your Amazon EFS file systems.</p><br>
    ///   - [`role(impl Into<String>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::role) / [`set_role(Option<String>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_role):<br>required: **true**<br><p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that controls your users' access to your Amazon S3 bucket or Amazon EFS file system. The policies attached to this role determine the level of access that you want to provide your users when transferring files into and out of your Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a trust relationship that allows the server to access your resources when servicing your users' transfer requests.</p><br>
    ///   - [`server_id(impl Into<String>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::server_id) / [`set_server_id(Option<String>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_server_id):<br>required: **true**<br><p>A system-assigned unique identifier for a server instance. This is the specific server that you added your user to.</p><br>
    ///   - [`ssh_public_key_body(impl Into<String>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::ssh_public_key_body) / [`set_ssh_public_key_body(Option<String>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_ssh_public_key_body):<br>required: **false**<br><p>The public portion of the Secure Shell (SSH) key used to authenticate the user to the server.</p> <p>The three standard SSH public key format elements are <code>&lt;key type&gt;</code>, <code>&lt;body base64&gt;</code>, and an optional <code>&lt;comment&gt;</code>, with spaces between each element.</p> <p>Transfer Family accepts RSA, ECDSA, and ED25519 keys.</p> <ul>  <li>   <p>For RSA keys, the key type is <code>ssh-rsa</code>.</p></li>  <li>   <p>For ED25519 keys, the key type is <code>ssh-ed25519</code>.</p></li>  <li>   <p>For ECDSA keys, the key type is either <code>ecdsa-sha2-nistp256</code>, <code>ecdsa-sha2-nistp384</code>, or <code>ecdsa-sha2-nistp521</code>, depending on the size of the key you generated.</p></li> </ul><br>
    ///   - [`tags(Tag)`](crate::operation::create_user::builders::CreateUserFluentBuilder::tags) / [`set_tags(Option<Vec::<Tag>>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_tags):<br>required: **false**<br><p>Key-value pairs that can be used to group and search for users. Tags are metadata attached to users for any purpose.</p><br>
    ///   - [`user_name(impl Into<String>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::user_name) / [`set_user_name(Option<String>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_user_name):<br>required: **true**<br><p>A unique string that identifies a user and is associated with a <code>ServerId</code>. This user name must be a minimum of 3 and a maximum of 100 characters long. The following are valid characters: a-z, A-Z, 0-9, underscore '_', hyphen '-', period '.', and at sign '@'. The user name can't start with a hyphen, period, or at sign.</p><br>
    /// - On success, responds with [`CreateUserOutput`](crate::operation::create_user::CreateUserOutput) with field(s):
    ///   - [`server_id(String)`](crate::operation::create_user::CreateUserOutput::server_id): <p>The identifier of the server that the user is attached to.</p>
    ///   - [`user_name(String)`](crate::operation::create_user::CreateUserOutput::user_name): <p>A unique string that identifies a Transfer Family user.</p>
    /// - On failure, responds with [`SdkError<CreateUserError>`](crate::operation::create_user::CreateUserError)
    pub fn create_user(&self) -> crate::operation::create_user::builders::CreateUserFluentBuilder {
        crate::operation::create_user::builders::CreateUserFluentBuilder::new(self.handle.clone())
    }
}