Class CfnUser
A CloudFormation AWS::Transfer::User
.
Inherited Members
Namespace: Amazon.CDK.AWS.Transfer
Assembly: Amazon.CDK.AWS.Transfer.dll
Syntax (csharp)
public class CfnUser : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnUser
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
The AWS::Transfer::User
resource creates a user and associates them with an existing 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 AWS 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.
CloudformationResource: AWS::Transfer::User
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-transfer-user.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Transfer;
var cfnUser = new CfnUser(this, "MyCfnUser", new CfnUserProps {
Role = "role",
ServerId = "serverId",
UserName = "userName",
// the properties below are optional
HomeDirectory = "homeDirectory",
HomeDirectoryMappings = new [] { new HomeDirectoryMapEntryProperty {
Entry = "entry",
Target = "target"
} },
HomeDirectoryType = "homeDirectoryType",
Policy = "policy",
PosixProfile = new PosixProfileProperty {
Gid = 123,
Uid = 123,
// the properties below are optional
SecondaryGids = new [] { 123 }
},
SshPublicKeys = new [] { "sshPublicKeys" },
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
});
Synopsis
Constructors
CfnUser(Construct, String, ICfnUserProps) | Create a new |
CfnUser(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnUser(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AttrArn | The Amazon Resource Name associated with the user, in the form |
AttrServerId | The ID of the server to which the user is attached. |
AttrUserName | A unique string that identifies a Transfer Family user account associated with a server. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
HomeDirectory | The landing directory (folder) for a user when they log in to the server using the client. |
HomeDirectoryMappings | Logical directory mappings that specify what Amazon S3 paths and keys should be visible to your user and how you want to make them visible. |
HomeDirectoryType | The type of landing directory (folder) that you want your users' home directory to be when they log in to the server. |
Policy | A session policy for your user so you can use the same IAM role across multiple users. |
PosixProfile | Specifies the full POSIX identity, including user ID ( |
Role | The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that controls your users' access to your Amazon S3 bucket or Amazon EFS file system. |
ServerId | A system-assigned unique identifier for a server instance. |
SshPublicKeys | Specifies the public key portion of the Secure Shell (SSH) keys stored for the described user. |
Tags | Key-value pairs that can be used to group and search for users. |
UserName | A unique string that identifies a user and is associated with a |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnUser(Construct, String, ICfnUserProps)
Create a new AWS::Transfer::User
.
public CfnUser(Construct scope, string id, ICfnUserProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnUserProps
- resource properties.
CfnUser(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnUser(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnUser(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnUser(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AttrArn
The Amazon Resource Name associated with the user, in the form arn:aws:transfer:region: *account-id* :user/ *server-id* / *username*
.
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
An example of a user ARN is: arn:aws:transfer:us-east-1:123456789012:user/user1
.
CloudformationAttribute: Arn
AttrServerId
The ID of the server to which the user is attached.
public virtual string AttrServerId { get; }
Property Value
System.String
Remarks
An example ServerId
is s-01234567890abcdef
.
CloudformationAttribute: ServerId
AttrUserName
A unique string that identifies a Transfer Family user account associated with a server.
public virtual string AttrUserName { get; }
Property Value
System.String
Remarks
An example UserName
is transfer-user-1
.
CloudformationAttribute: UserName
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
HomeDirectory
The landing directory (folder) for a user when they log in to the server using the client.
public virtual string HomeDirectory { get; set; }
Property Value
System.String
Remarks
A HomeDirectory
example is /bucket_name/home/mydirectory
.
HomeDirectoryMappings
Logical directory mappings that specify what Amazon S3 paths and keys should be visible to your user and how you want to make them visible.
public virtual object HomeDirectoryMappings { get; set; }
Property Value
System.Object
Remarks
You will need to specify the " Entry
" and " Target
" pair, where Entry
shows how the path is made visible and Target
is the actual Amazon S3 path. If you only specify a target, it will be displayed as is. You will need to also make sure that your IAM role provides access to paths in Target
. The following is an example.
'[ { "Entry": "/", "Target": "/bucket3/customized-reports/" } ]'
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 HomeDirectory parameter value.
If the target of a logical directory entry does not exist in Amazon S3, the entry will be ignored. As a workaround, you can use the Amazon S3 API to create 0 byte objects as place holders for your directory. If using the CLI, use the <code>s3api</code> call instead of <code>s3</code> so you can use the put-object operation. For example, you use the following: <code>AWS s3api put-object --bucket bucketname --key path/to/folder/</code> . Make sure that the end of the key name ends in a '/' for it to be considered a folder.
HomeDirectoryType
The type of landing directory (folder) that you want your users' home directory to be when they log in to the server.
public virtual string HomeDirectoryType { get; set; }
Property Value
System.String
Remarks
If you set it to PATH
, the user will see the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol clients. If you set it 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.
Policy
A session policy for your user so you can use the same IAM role across multiple users.
public virtual string Policy { get; set; }
Property Value
System.String
Remarks
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 Policy
argument.
For an example of a session policy, see Example session policy .
For more information, see AssumeRole in the AWS Security Token Service API Reference .
PosixProfile
Specifies the full POSIX identity, including user ID ( Uid
), group ID ( Gid
), and any secondary groups IDs ( SecondaryGids
), that controls your users' access to your Amazon Elastic File System (Amazon EFS) file systems.
public virtual object PosixProfile { get; set; }
Property Value
System.Object
Remarks
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.
Role
The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that controls your users' access to your Amazon S3 bucket or Amazon EFS file system.
public virtual string Role { get; set; }
Property Value
System.String
Remarks
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.
ServerId
A system-assigned unique identifier for a server instance.
public virtual string ServerId { get; set; }
Property Value
System.String
Remarks
This is the specific server that you added your user to.
SshPublicKeys
Specifies the public key portion of the Secure Shell (SSH) keys stored for the described user.
public virtual string[] SshPublicKeys { get; set; }
Property Value
System.String[]
Remarks
Tags
Key-value pairs that can be used to group and search for users.
public virtual TagManager Tags { get; }
Property Value
Remarks
Tags are metadata attached to users for any purpose.
UserName
A unique string that identifies a user and is associated with a ServerId
.
public virtual string UserName { get; set; }
Property Value
System.String
Remarks
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.
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>