Skip to content

update_access

update_access(
    server_id: ServerId,
    external_id: ExternalId,
    *,
    config_overrides: Optional[TransferClientConfig] = None,
    home_directory: Optional[HomeDirectory] = None,
    home_directory_type: Optional[HomeDirectoryType] = None,
    home_directory_mappings: Optional[HomeDirectoryMappings] = None,
    policy: Optional[Policy] = None,
    posix_profile: Optional[PosixProfile] = None,
    role: Optional[Role] = None,
) -> UpdateAccessResponse

Allows you to update parameters for the access specified in the ServerID and ExternalID parameters.

Parameters:

  • home_directory (Optional[HomeDirectory], default: None ) –

    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 HomeDirectory parameter for HomeDirectoryType when it is set to either PATH or LOGICAL.

  • home_directory_type (Optional[HomeDirectoryType], default: None ) –

    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 HomeDirectoryType is LOGICAL, you must provide mappings, using the HomeDirectoryMappings parameter. If, on the other hand, HomeDirectoryType is PATH, you provide an absolute path using the HomeDirectory parameter. You cannot have both HomeDirectory and HomeDirectoryMappings in your template.

  • home_directory_mappings (Optional[HomeDirectoryMappings], default: None ) –

    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 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 down your user to the designated home directory ("chroot"). To do this, you can set Entry to / and set Target to the HomeDirectory parameter value.

    The following is an Entry and Target pair example for chroot.

    [ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } ]

  • policy (Optional[Policy], default: None ) –

    A session policy for your user so that you can use the same Identity and Access Management (IAM) role across multiple users. This policy scopes down a user's access to portions of their Amazon S3 bucket. Variables that you can use inside this policy include ${Transfer:UserName}, ${Transfer:HomeDirectory}, and ${Transfer:HomeBucket}.

    This policy applies only when the domain of ServerId is Amazon S3. Amazon EFS does not use session policies.

    For session policies, 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 Amazon Web ServicesSecurity Token Service API Reference.

  • role (Optional[Role], default: None ) –

    The Amazon Resource Name (ARN) of the 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.

  • server_id (ServerId) –

    A system-assigned unique identifier for a server instance. This is the specific server that you added your user to.

  • external_id (ExternalId) –

    A unique identifier that is required to identify specific groups within your directory. The users of the group that you associate have access to your Amazon S3 or Amazon EFS resources over the enabled protocols using Transfer Family. If you know the group name, you can view the SID values by running the following command using Windows PowerShell.

    Get-ADGroup -Filter {samAccountName -like "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid

    In that command, replace YourGroupName with the name of your Active Directory group.

    The regular expression used to validate this parameter is a string of characters consisting of uppercase and lowercase alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/-

Raises:

Source code in docs_src/capo_transfer/_services/transfer.py
def update_access(
    self,
    server_id: "capo_transfer.types.server_id.ServerId",
    external_id: "capo_transfer.types.external_id.ExternalId",
    *,
    config_overrides: Optional[TransferClientConfig] = None,
    home_directory: Optional[
        "capo_transfer.types.home_directory.HomeDirectory"
    ] = None,
    home_directory_type: Optional[
        "capo_transfer.types.home_directory_type.HomeDirectoryType"
    ] = None,
    home_directory_mappings: Optional[
        "capo_transfer.types.home_directory_mappings.HomeDirectoryMappings"
    ] = None,
    policy: Optional["capo_transfer.types.policy.Policy"] = None,
    posix_profile: Optional[
        "capo_transfer.types.posix_profile.PosixProfile"
    ] = None,
    role: Optional["capo_transfer.types.role.Role"] = None,
) -> "capo_transfer.types.update_access_response.UpdateAccessResponse":
    """<p>Allows you to update parameters for the access specified in the <code>ServerID</code> and <code>ExternalID</code> parameters.</p>

    Args:
        home_directory: <p>The landing directory (folder) for a user when they log in to the server using the client.</p> <p>A <code>HomeDirectory</code> example is <code>/bucket_name/home/mydirectory</code>.</p> <note> <p>You can use the <code>HomeDirectory</code> parameter for <code>HomeDirectoryType</code> when it is set to either <code>PATH</code> or <code>LOGICAL</code>.</p> </note>
        home_directory_type: <p>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 <code>PATH</code>, 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 <code>LOGICAL</code>, you need to provide mappings in the <code>HomeDirectoryMappings</code> for how you want to make Amazon S3 or Amazon EFS paths visible to your users.</p> <note> <p>If <code>HomeDirectoryType</code> is <code>LOGICAL</code>, you must provide mappings, using the <code>HomeDirectoryMappings</code> parameter. If, on the other hand, <code>HomeDirectoryType</code> is <code>PATH</code>, you provide an absolute path using the <code>HomeDirectory</code> parameter. You cannot have both <code>HomeDirectory</code> and <code>HomeDirectoryMappings</code> in your template.</p> </note>
        home_directory_mappings: <p>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 <code>Entry</code> and <code>Target</code> pair, where <code>Entry</code> shows how the path is made visible and <code>Target</code> 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 Identity and Access Management (IAM) role provides access to paths in <code>Target</code>. This value can be set only when <code>HomeDirectoryType</code> is set to <i>LOGICAL</i>.</p> <p>The following is an <code>Entry</code> and <code>Target</code> pair example.</p> <p> <code>[ { "Entry": "/directory1", "Target": "/bucket_name/home/mydirectory" } ]</code> </p> <p>In most cases, you can use this value instead of the session policy to lock down your user to the designated home directory ("<code>chroot</code>"). To do this, you can set <code>Entry</code> to <code>/</code> and set <code>Target</code> to the <code>HomeDirectory</code> parameter value.</p> <p>The following is an <code>Entry</code> and <code>Target</code> pair example for <code>chroot</code>.</p> <p> <code>[ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } ]</code> </p>
        policy: <p>A session policy for your user so that you can use the same Identity and Access Management (IAM) role across multiple users. This policy scopes down a user's access to portions of their Amazon S3 bucket. Variables that you can use inside this policy include <code>${Transfer:UserName}</code>, <code>${Transfer:HomeDirectory}</code>, and <code>${Transfer:HomeBucket}</code>.</p> <note> <p>This policy applies only when the domain of <code>ServerId</code> is Amazon S3. Amazon EFS does not use session policies.</p> <p>For session policies, 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 <code>Policy</code> argument.</p> <p>For an example of a session policy, see <a href="https://docs.aws.amazon.com/transfer/latest/userguide/session-policy.html">Example session policy</a>.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html">AssumeRole</a> in the <i>Amazon Web ServicesSecurity Token Service API Reference</i>.</p> </note>
        role: <p>The Amazon Resource Name (ARN) of the 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.</p>
        server_id: <p>A system-assigned unique identifier for a server instance. This is the specific server that you added your user to.</p>
        external_id: <p>A unique identifier that is required to identify specific groups within your directory. The users of the group that you associate have access to your Amazon S3 or Amazon EFS resources over the enabled protocols using Transfer Family. If you know the group name, you can view the SID values by running the following command using Windows PowerShell.</p> <p> <code>Get-ADGroup -Filter {samAccountName -like "<i>YourGroupName</i>*"} -Properties * | Select SamAccountName,ObjectSid</code> </p> <p>In that command, replace <i>YourGroupName</i> with the name of your Active Directory group.</p> <p>The regular expression used to validate this parameter is a string of characters consisting of uppercase and lowercase alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/-</p>

    Raises:
        capo_transfer.errors.internal_service_error.InternalServiceError: <p>This exception is thrown when an error occurs in the Transfer Family service.</p>
        capo_transfer.errors.invalid_request_exception.InvalidRequestException: <p>This exception is thrown when the client submits a malformed request.</p>
        capo_transfer.errors.resource_exists_exception.ResourceExistsException: <p>The requested resource does not exist, or exists in a region other than the one specified for the command.</p>
        capo_transfer.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when a resource is not found by the Amazon Web ServicesTransfer Family service.</p>
        capo_transfer.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request has failed because the Amazon Web ServicesTransfer Family service is not available.</p>
        capo_transfer.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_transfer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_transfer.types.update_access_request.UpdateAccessRequest]",
    ) -> OperationResponse[
        "capo_transfer.types.update_access_response.UpdateAccessResponse"
    ]:
        import capo_transfer._operations.transfer_service.update_access

        output, http_response = (
            capo_transfer._operations.transfer_service.update_access.update_access(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateAccess")
    )
    input_: capo_transfer.types.update_access_request.UpdateAccessRequest = {
        "server_id": server_id,
        "external_id": external_id,
    }
    if home_directory is not None:
        input_["home_directory"] = home_directory
    if home_directory_type is not None:
        input_["home_directory_type"] = home_directory_type
    if home_directory_mappings is not None:
        input_["home_directory_mappings"] = home_directory_mappings
    if policy is not None:
        input_["policy"] = policy
    if posix_profile is not None:
        input_["posix_profile"] = posix_profile
    if role is not None:
        input_["role"] = role

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output