Skip to main content

users

Creates, updates, deletes or gets a user resource or lists users in a region

Overview

Nameusers
TypeResource
DescriptionDefinition of AWS::Transfer::User Resource Type
Idawscc.transfer.users

Fields

NameDatatypeDescription
arnstring
home_directorystring
home_directory_mappingsarray
home_directory_typestring
policystring
posix_profileobject
rolestring
server_idstring
ssh_public_keysarrayThis represents the SSH User Public Keys for CloudFormation resource
tagsarray
user_namestring
regionstringAWS region.

For more information, see AWS::Transfer::User.

Methods

NameResourceAccessible byRequired Params
create_resourceusersINSERTRole, ServerId, UserName, region
delete_resourceusersDELETEIdentifier, region
update_resourceusersUPDATEIdentifier, PatchDocument, region
list_resourcesusers_list_onlySELECTregion
get_resourceusersSELECTIdentifier, region

SELECT examples

Gets all properties from an individual user.

SELECT
region,
arn,
home_directory,
home_directory_mappings,
home_directory_type,
policy,
posix_profile,
role,
server_id,
ssh_public_keys,
tags,
user_name
FROM awscc.transfer.users
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new user resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.transfer.users (
Role,
ServerId,
UserName,
region
)
SELECT
'{{ role }}',
'{{ server_id }}',
'{{ user_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a user resource, using stack-deploy.

/*+ update */
UPDATE awscc.transfer.users
SET PatchDocument = string('{{ {
"HomeDirectory": home_directory,
"HomeDirectoryMappings": home_directory_mappings,
"HomeDirectoryType": home_directory_type,
"Policy": policy,
"PosixProfile": posix_profile,
"Role": role,
"SshPublicKeys": ssh_public_keys,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.transfer.users
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the users resource, the following permissions are required:

iam:PassRole,
transfer:CreateUser,
transfer:DescribeUser,
transfer:ImportSshPublicKey,
transfer:TagResource