CfnUserProps Struct
Properties for defining a CfnUser.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_transfer as transfer } from 'aws-cdk-lib';
const cfnUserProps: transfer.CfnUserProps = {
role: 'role',
serverId: 'serverId',
userName: 'userName',
// the properties below are optional
homeDirectory: 'homeDirectory',
homeDirectoryMappings: [{
entry: 'entry',
target: 'target',
// the properties below are optional
type: 'type',
}],
homeDirectoryType: 'homeDirectoryType',
policy: 'policy',
posixProfile: {
gid: 123,
uid: 123,
// the properties below are optional
secondaryGids: [123],
},
sshPublicKeys: ['sshPublicKeys'],
tags: [{
key: 'key',
value: 'value',
}],
};
Properties
A HomeDirectory example is /bucket_name/home/mydirectory .
You can use the
HomeDirectoryparameter forHomeDirectoryTypewhen it is set to eitherPATHorLOGICAL.
homeDirectoryMappingsIResolvable | IResolvable | CfnUser.HomeDirectoryMapEntryProperty[]home_directory_mappingstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, HomeDirectoryMapEntryProperty]]]homeDirectoryMappingsIResolvableHomeDirectoryMappingsIResolvableHomeDirectoryMappingsinterface{}#notes
You must specify the Entry and Target pair, where Entry shows how the path is made visible and Target 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 AWS Identity and Access Management (IAM) role provides access to paths in Target . This value can be set only when HomeDirectoryType is set to LOGICAL .
The following is an Entry and Target pair example.
[ { "Entry": "/directory1", "Target": "/bucket_name/home/mydirectory" } ]
In most cases, you can use this value instead of the session policy to lock your user down to the designated home directory (" chroot "). To do this, you can set Entry to / and set Target to the value the user should see for their home directory when they log in.
The following is an Entry and Target pair example for chroot .
[ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } ]
homeDirectoryTypestringhome_directory_typestrhomeDirectoryTypeStringHomeDirectoryTypestringHomeDirectoryType*string#notes
If you set it to PATH , 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 LOGICAL , you need to provide mappings in the HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths visible to your users.
If
HomeDirectoryTypeisLOGICAL, you must provide mappings, using theHomeDirectoryMappingsparameter. If, on the other hand,HomeDirectoryTypeisPATH, you provide an absolute path using theHomeDirectoryparameter. You cannot have bothHomeDirectoryandHomeDirectoryMappingsin your template.
notes
This policy restricts user access to portions of their Amazon S3 bucket. Variables that you can use inside this policy include ${Transfer:UserName} , ${Transfer:HomeDirectory} , and ${Transfer:HomeBucket} .
For session policies, AWS 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
Policyargument.For an example of a session policy, see Example session policy .
For more information, see AssumeRole in the AWS Security Token Service API Reference .
posixProfileIResolvable | CfnUser.PosixProfilePropertyposix_profiletyping.Union[IResolvable, PosixProfileProperty]posixProfileIResolvablePosixProfileIResolvablePosixProfileinterface{}#The POSIX permissions that are set on files and directories in your file system determine the level of access your users get when transferring files into and out of your Amazon EFS file systems.
notes
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.
This is the specific server that you added your user to.
sshPublicKeysstring[]ssh_public_keystyping.List[str]sshPublicKeysList<String>SshPublicKeysstring[]SshPublicKeys*[]*string#To delete the public key body, set its value to zero keys, as shown here:
SshPublicKeys: []
Tags are metadata attached to users for any purpose.
notes
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.