Skip to main content

users

Creates, updates, deletes, gets or lists a users resource.

Overview

Nameusers
TypeResource
Idaws.transfer.users

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
server_idstringA system-assigned unique identifier for a server that has this user assigned. (pattern: <code>s-([0-9a-f]{17})</code>)
userobjectAn array containing the properties of the Transfer Family user for the ServerID value that you specified.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_userselectregionDescribes the user assigned to the specific file transfer protocol-enabled server, as identified by its ServerId property. The response from this call returns the properties of the user associated with the ServerId value that was specified.
list_usersselectregionLists the users for a file transfer protocol-enabled server that you specify by passing the ServerId parameter.
create_userinsertregion, ServerId, UserNameCreates a user and associates them with an existing file transfer protocol-enabled server. You can only create and associate users with servers that have the IdentityProviderType set to SERVICE_MANAGED. Using parameters for CreateUser, you can specify the user name, set the home directory, store the user's public key, and assign the user's Identity and Access Management (IAM) role. You can also optionally add a session policy, and assign metadata with tags that can be used to group and search for users.
update_userupdateregion, ServerId, UserNameAssigns new properties to a user. Parameters you pass modify any or all of the following: the home directory, role, and policy for the UserName and ServerId you specify. The response returns the ServerId and the UserName for the updated user. In the console, you can select Restricted when you create or update a user. This ensures that the user can't access anything outside of their home directory. The programmatic way to configure this behavior is to update the user. Set their HomeDirectoryType to LOGICAL, and specify HomeDirectoryMappings with Entry as root (/) and Target as their home directory. For example, if the user's home directory is /test/admin-user, the following command updates the user so that their configuration in the console shows the Restricted flag as selected. aws transfer update-user --server-id <server-id> --user-name admin-user --home-directory-type LOGICAL --home-directory-mappings "[{"Entry":"/", "Target":"/test/admin-user"}]"
delete_userdeleteregionDeletes the user belonging to a file transfer protocol-enabled server you specify. No response returns from this operation. When you delete a user from a server, the user's information is lost.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Describes the user assigned to the specific file transfer protocol-enabled server, as identified by its ServerId property. The response from this call returns the properties of the user associated with the ServerId value that was specified.

SELECT
server_id,
user
FROM aws.transfer.users
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a user and associates them with an existing file transfer protocol-enabled server. You can only create and associate users with servers that have the IdentityProviderType set to SERVICE_MANAGED. Using parameters for CreateUser, you can specify the user name, set the home directory, store the user's public key, and assign the user's Identity and Access Management (IAM) role. You can also optionally add a session policy, and assign metadata with tags that can be used to group and search for users.

INSERT INTO aws.transfer.users (
HomeDirectory,
HomeDirectoryType,
HomeDirectoryMappings,
Policy,
PosixProfile,
Role,
ServerId,
SshPublicKeyBody,
Tags,
UserName,
region
)
SELECT
'{{ HomeDirectory }}',
'{{ HomeDirectoryType }}',
'{{ HomeDirectoryMappings }}',
'{{ Policy }}',
'{{ PosixProfile }}',
'{{ Role }}',
'{{ ServerId }}' /* required */,
'{{ SshPublicKeyBody }}',
'{{ Tags }}',
'{{ UserName }}' /* required */,
'{{ region }}'
RETURNING
server_id,
user_name
;

UPDATE examples

Assigns new properties to a user. Parameters you pass modify any or all of the following: the home directory, role, and policy for the UserName and ServerId you specify. The response returns the ServerId and the UserName for the updated user. In the console, you can select Restricted when you create or update a user. This ensures that the user can't access anything outside of their home directory. The programmatic way to configure this behavior is to update the user. Set their HomeDirectoryType to LOGICAL, and specify HomeDirectoryMappings with Entry as root (/) and Target as their home directory. For example, if the user's home directory is /test/admin-user, the following command updates the user so that their configuration in the console shows the Restricted flag as selected. aws transfer update-user --server-id <server-id> --user-name admin-user --home-directory-type LOGICAL --home-directory-mappings "[{"Entry":"/", "Target":"/test/admin-user"}]"

UPDATE aws.transfer.users
SET
HomeDirectory = '{{ HomeDirectory }}',
HomeDirectoryType = '{{ HomeDirectoryType }}',
HomeDirectoryMappings = '{{ HomeDirectoryMappings }}',
Policy = '{{ Policy }}',
PosixProfile = '{{ PosixProfile }}',
Role = '{{ Role }}',
ServerId = '{{ ServerId }}',
UserName = '{{ UserName }}'
WHERE
region = '{{ region }}' --required
AND ServerId = '{{ ServerId }}' --required
AND UserName = '{{ UserName }}' --required
RETURNING
server_id,
user_name;

DELETE examples

Deletes the user belonging to a file transfer protocol-enabled server you specify. No response returns from this operation. When you delete a user from a server, the user's information is lost.

DELETE FROM aws.transfer.users
WHERE region = '{{ region }}' --required
;