Skip to content

associate_file_system

associate_file_system(
    user_name: DomainUserName,
    password: DomainUserPassword,
    client_token: ClientToken,
    gateway_arn: GatewayARN,
    location_arn: FileSystemLocationARN,
    *,
    config_overrides: Optional[StorageGatewayClientConfig] = None,
    tags: Optional[Tags] = None,
    audit_destination_arn: Optional[AuditDestinationARN] = None,
    cache_attributes: Optional[CacheAttributes] = None,
    endpoint_network_configuration: Optional[EndpointNetworkConfiguration] = None,
) -> AssociateFileSystemOutput

Associate an Amazon FSx file system with the FSx File Gateway. After the association process is complete, the file shares on the Amazon FSx file system are available for access through the gateway. This operation only supports the FSx File Gateway type.

Parameters:

  • user_name (DomainUserName) –

    The user name of the user credential that has permission to access the root share D$ of the Amazon FSx file system. The user account must belong to the Amazon FSx delegated admin user group.

  • password (DomainUserPassword) –

    The password of the user credential.

  • client_token (ClientToken) –

    A unique string value that you supply that is used by the FSx File Gateway to ensure idempotent file system association creation.

  • location_arn (FileSystemLocationARN) –

    The Amazon Resource Name (ARN) of the Amazon FSx file system to associate with the FSx File Gateway.

  • tags (Optional[Tags], default: None ) –

    A list of up to 50 tags that can be assigned to the file system association. Each tag is a key-value pair.

  • audit_destination_arn (Optional[AuditDestinationARN], default: None ) –

    The Amazon Resource Name (ARN) of the storage used for the audit logs.

  • endpoint_network_configuration (Optional[EndpointNetworkConfiguration], default: None ) –

    Specifies the network configuration information for the gateway associated with the Amazon FSx file system.

    If multiple file systems are associated with this gateway, this parameter's IpAddresses field is required.

Raises:

  • InternalServerError –

    An internal server error has occurred during the request. For more information, see the error and message fields.

  • InvalidGatewayRequestException –

    An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_storage_gateway/_services/storage_gateway.py
def associate_file_system(
    self,
    user_name: "capo_storage_gateway.types.domain_user_name.DomainUserName",
    password: "capo_storage_gateway.types.domain_user_password.DomainUserPassword",
    client_token: "capo_storage_gateway.types.client_token.ClientToken",
    gateway_arn: "capo_storage_gateway.types.gateway_arn.GatewayARN",
    location_arn: "capo_storage_gateway.types.file_system_location_arn.FileSystemLocationARN",
    *,
    config_overrides: Optional[StorageGatewayClientConfig] = None,
    tags: Optional["capo_storage_gateway.types.tags.Tags"] = None,
    audit_destination_arn: Optional[
        "capo_storage_gateway.types.audit_destination_arn.AuditDestinationARN"
    ] = None,
    cache_attributes: Optional[
        "capo_storage_gateway.types.cache_attributes.CacheAttributes"
    ] = None,
    endpoint_network_configuration: Optional[
        "capo_storage_gateway.types.endpoint_network_configuration.EndpointNetworkConfiguration"
    ] = None,
) -> "capo_storage_gateway.types.associate_file_system_output.AssociateFileSystemOutput":
    """<p>Associate an Amazon FSx file system with the FSx File Gateway. After the association process is complete, the file shares on the Amazon FSx file system are available for access through the gateway. This operation only supports the FSx File Gateway type.</p>

    Args:
        user_name: <p>The user name of the user credential that has permission to access the root share D$ of the Amazon FSx file system. The user account must belong to the Amazon FSx delegated admin user group.</p>
        password: <p>The password of the user credential.</p>
        client_token: <p>A unique string value that you supply that is used by the FSx File Gateway to ensure idempotent file system association creation.</p>
        location_arn: <p>The Amazon Resource Name (ARN) of the Amazon FSx file system to associate with the FSx File Gateway.</p>
        tags: <p>A list of up to 50 tags that can be assigned to the file system association. Each tag is a key-value pair.</p>
        audit_destination_arn: <p>The Amazon Resource Name (ARN) of the storage used for the audit logs.</p>
        endpoint_network_configuration: <p>Specifies the network configuration information for the gateway associated with the Amazon FSx file system.</p> <note> <p>If multiple file systems are associated with this gateway, this parameter's <code>IpAddresses</code> field is required.</p> </note>

    Raises:
        capo_storage_gateway.errors.internal_server_error.InternalServerError: <p>An internal server error has occurred during the request. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.invalid_gateway_request_exception.InvalidGatewayRequestException: <p>An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_storage_gateway.types.associate_file_system_input.AssociateFileSystemInput]",
    ) -> OperationResponse[
        "capo_storage_gateway.types.associate_file_system_output.AssociateFileSystemOutput"
    ]:
        import capo_storage_gateway._operations.storage_gateway_20130630.associate_file_system

        output, http_response = (
            capo_storage_gateway._operations.storage_gateway_20130630.associate_file_system.associate_file_system(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_storage_gateway.types.associate_file_system_input.AssociateFileSystemInput",
    ) -> dict[str, Any]:
        import capo_storage_gateway.types.associate_file_system_input

        return (
            capo_storage_gateway.types.associate_file_system_input.redact_sensitive(
                input_
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("AssociateFileSystem", redact_input=_redact_input),
    )
    input_: capo_storage_gateway.types.associate_file_system_input.AssociateFileSystemInput = {
        "user_name": user_name,
        "password": password,
        "client_token": client_token,
        "gateway_arn": gateway_arn,
        "location_arn": location_arn,
    }
    if tags is not None:
        input_["tags"] = tags
    if audit_destination_arn is not None:
        input_["audit_destination_arn"] = audit_destination_arn
    if cache_attributes is not None:
        input_["cache_attributes"] = cache_attributes
    if endpoint_network_configuration is not None:
        input_["endpoint_network_configuration"] = endpoint_network_configuration

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