Class: AWSCDK::Transfer::CfnUserProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Transfer::CfnUserProps
- Defined in:
- transfer/cfn_user_props.rb
Overview
Properties for defining a CfnUser.
Instance Attribute Summary collapse
-
#home_directory ⇒ String?
readonly
The landing directory (folder) for a user when they log in to the server using the client.
-
#home_directory_mappings ⇒ AWSCDK::IResolvable, ...
readonly
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.
-
#home_directory_type ⇒ String?
readonly
The type of landing directory (folder) that you want your users' home directory to be when they log in to the server.
-
#policy ⇒ String?
readonly
A session policy for your user so you can use the same IAM role across multiple users.
-
#posix_profile ⇒ AWSCDK::IResolvable, ...
readonly
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. -
#role ⇒ String
readonly
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.
-
#server_id ⇒ String
readonly
A system-assigned unique identifier for a server instance.
-
#ssh_public_keys ⇒ Array<String>?
readonly
Specifies the public key portion of the Secure Shell (SSH) keys stored for the described user.
-
#tags ⇒ Array<AWSCDK::CfnTag>?
readonly
Key-value pairs that can be used to group and search for users.
-
#user_name ⇒ String
readonly
A unique string that identifies a user and is associated with a
ServerId.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(role:, server_id:, user_name:, home_directory: nil, home_directory_mappings: nil, home_directory_type: nil, policy: nil, posix_profile: nil, ssh_public_keys: nil, tags: nil) ⇒ CfnUserProps
constructor
A new instance of CfnUserProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(role:, server_id:, user_name:, home_directory: nil, home_directory_mappings: nil, home_directory_type: nil, policy: nil, posix_profile: nil, ssh_public_keys: nil, tags: nil) ⇒ CfnUserProps
Returns a new instance of CfnUserProps.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'transfer/cfn_user_props.rb', line 19 def initialize(role:, server_id:, user_name:, home_directory: nil, home_directory_mappings: nil, home_directory_type: nil, policy: nil, posix_profile: nil, ssh_public_keys: nil, tags: nil) @role = role Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "role") @server_id = server_id Jsii::Type.check_type(@server_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "serverId") @user_name = user_name Jsii::Type.check_type(@user_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "userName") @home_directory = home_directory Jsii::Type.check_type(@home_directory, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "homeDirectory") unless @home_directory.nil? @home_directory_mappings = home_directory_mappings Jsii::Type.check_type(@home_directory_mappings, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfdHJhbnNmZXIuQ2ZuVXNlci5Ib21lRGlyZWN0b3J5TWFwRW50cnlQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "homeDirectoryMappings") unless @home_directory_mappings.nil? @home_directory_type = home_directory_type Jsii::Type.check_type(@home_directory_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "homeDirectoryType") unless @home_directory_type.nil? @policy = policy Jsii::Type.check_type(@policy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "policy") unless @policy.nil? @posix_profile = posix_profile.is_a?(Hash) ? ::AWSCDK::Transfer::CfnUser::PosixProfileProperty.new(**posix_profile.transform_keys(&:to_sym)) : posix_profile Jsii::Type.check_type(@posix_profile, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c190cmFuc2Zlci5DZm5Vc2VyLlBvc2l4UHJvZmlsZVByb3BlcnR5In1dfX0=")), "posixProfile") unless @posix_profile.nil? @ssh_public_keys = ssh_public_keys Jsii::Type.check_type(@ssh_public_keys, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "sshPublicKeys") unless @ssh_public_keys.nil? @tags = .is_a?(Array) ? .map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil? end |
Instance Attribute Details
#home_directory ⇒ String? (readonly)
The landing directory (folder) for a user when they log in to the server using the client.
A HomeDirectory example is /bucket_name/home/mydirectory .
You can use the
HomeDirectoryparameter forHomeDirectoryTypewhen it is set to eitherPATHorLOGICAL.
71 72 73 |
# File 'transfer/cfn_user_props.rb', line 71 def home_directory @home_directory end |
#home_directory_mappings ⇒ AWSCDK::IResolvable, ... (readonly)
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 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" } ]
88 89 90 |
# File 'transfer/cfn_user_props.rb', line 88 def home_directory_mappings @home_directory_mappings end |
#home_directory_type ⇒ String? (readonly)
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 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.
97 98 99 |
# File 'transfer/cfn_user_props.rb', line 97 def home_directory_type @home_directory_type end |
#policy ⇒ String? (readonly)
A session policy for your user so you can use the same IAM role across multiple users.
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 .
110 111 112 |
# File 'transfer/cfn_user_props.rb', line 110 def policy @policy end |
#posix_profile ⇒ AWSCDK::IResolvable, ... (readonly)
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.
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.
117 118 119 |
# File 'transfer/cfn_user_props.rb', line 117 def posix_profile @posix_profile end |
#role ⇒ String (readonly)
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.
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.
48 49 50 |
# File 'transfer/cfn_user_props.rb', line 48 def role @role end |
#server_id ⇒ String (readonly)
A system-assigned unique identifier for a server instance.
This is the specific server that you added your user to.
55 56 57 |
# File 'transfer/cfn_user_props.rb', line 55 def server_id @server_id end |
#ssh_public_keys ⇒ Array<String>? (readonly)
Specifies the public key portion of the Secure Shell (SSH) keys stored for the described user.
To delete the public key body, set its value to zero keys, as shown here:
SshPublicKeys: []
126 127 128 |
# File 'transfer/cfn_user_props.rb', line 126 def ssh_public_keys @ssh_public_keys end |
#tags ⇒ Array<AWSCDK::CfnTag>? (readonly)
Key-value pairs that can be used to group and search for users.
Tags are metadata attached to users for any purpose.
133 134 135 |
# File 'transfer/cfn_user_props.rb', line 133 def @tags end |
#user_name ⇒ String (readonly)
A unique string that identifies a user and is associated with a ServerId .
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.
62 63 64 |
# File 'transfer/cfn_user_props.rb', line 62 def user_name @user_name end |
Class Method Details
.jsii_properties ⇒ Object
135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'transfer/cfn_user_props.rb', line 135 def self.jsii_properties { :role => "role", :server_id => "serverId", :user_name => "userName", :home_directory => "homeDirectory", :home_directory_mappings => "homeDirectoryMappings", :home_directory_type => "homeDirectoryType", :policy => "policy", :posix_profile => "posixProfile", :ssh_public_keys => "sshPublicKeys", :tags => "tags", } end |
Instance Method Details
#to_jsii ⇒ Object
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'transfer/cfn_user_props.rb', line 150 def to_jsii result = {} result.merge!({ "role" => @role, "serverId" => @server_id, "userName" => @user_name, "homeDirectory" => @home_directory, "homeDirectoryMappings" => @home_directory_mappings, "homeDirectoryType" => @home_directory_type, "policy" => @policy, "posixProfile" => @posix_profile, "sshPublicKeys" => @ssh_public_keys, "tags" => @tags, }) result.compact end |