Skip to content

create_mount_target

create_mount_target(
    file_system_id: FileSystemId,
    subnet_id: SubnetId,
    *,
    config_overrides: Optional[S3FilesClientConfig] = None,
    ipv4_address: Optional[Ipv4Address] = None,
    ipv6_address: Optional[Ipv6Address] = None,
    ip_address_type: Optional[IpAddressType] = None,
    security_groups: Optional[SecurityGroups] = None,
) -> CreateMountTargetResponse

Creates a mount target resource as an endpoint for mounting the S3 File System from compute resources in a specific Availability Zone and VPC. Mount targets provide network access to the file system.

Parameters:

  • file_system_id (FileSystemId) –

    The ID or Amazon Resource Name (ARN) of the S3 File System to create the mount target for.

  • subnet_id (SubnetId) –

    The ID of the subnet where the mount target will be created. The subnet must be in the same Amazon Web Services Region as the file system. For file systems with regional availability, you can create mount targets in any subnet within the Region. The subnet determines the Availability Zone where the mount target will be located.

  • ipv4_address (Optional[Ipv4Address], default: None ) –

    A specific IPv4 address to assign to the mount target. If not specified and the IP address type supports IPv4, an address is automatically assigned from the subnet's available IPv4 address range. The address must be within the subnet's CIDR block and not already in use.

  • ipv6_address (Optional[Ipv6Address], default: None ) –

    A specific IPv6 address to assign to the mount target. If not specified and the IP address type supports IPv6, an address is automatically assigned from the subnet's available IPv6 address range. The address must be within the subnet's IPv6 CIDR block and not already in use.

  • ip_address_type (Optional[IpAddressType], default: None ) –

    The IP address type for the mount target. If not specified, IPV4_ONLY is used. The IP address type must match the IP configuration of the specified subnet.

  • security_groups (Optional[SecurityGroups], default: None ) –

    An array of VPC security group IDs to associate with the mount target's network interface. These security groups control network access to the mount target. If not specified, the default security group for the subnet's VPC is used. All security groups must belong to the same VPC as the subnet.

Raises:

  • ThrottlingException –

    The request was throttled. Retry your request using exponential backoff.

  • ConflictException –

    The request conflicts with the current state of the resource. This can occur when trying to create a resource that already exists or delete a resource that is in use.

  • InternalServerException –

    An internal server error occurred. Retry your request.

  • ResourceNotFoundException –

    The specified resource was not found. Verify that the resource exists and that you have permission to access it.

  • ServiceQuotaExceededException –

    The request would exceed a service quota. Review your service quotas and either delete resources or request a quota increase.

  • ValidationException –

    The input parameters are not valid. Check the parameter values and try again.

  • UnknownServiceError –

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

Source code in docs_src/capo_s3files/_services/s3_files.py
def create_mount_target(
    self,
    file_system_id: "capo_s3files.types.file_system_id.FileSystemId",
    subnet_id: "capo_s3files.types.subnet_id.SubnetId",
    *,
    config_overrides: Optional[S3FilesClientConfig] = None,
    ipv4_address: Optional["capo_s3files.types.ipv4_address.Ipv4Address"] = None,
    ipv6_address: Optional["capo_s3files.types.ipv6_address.Ipv6Address"] = None,
    ip_address_type: Optional[
        "capo_s3files.types.ip_address_type.IpAddressType"
    ] = None,
    security_groups: Optional[
        "capo_s3files.types.security_groups.SecurityGroups"
    ] = None,
) -> "capo_s3files.types.create_mount_target_response.CreateMountTargetResponse":
    """<p>Creates a mount target resource as an endpoint for mounting the S3 File System from compute resources in a specific Availability Zone and VPC. Mount targets provide network access to the file system.</p>

    Args:
        file_system_id: <p>The ID or Amazon Resource Name (ARN) of the S3 File System to create the mount target for.</p>
        subnet_id: <p>The ID of the subnet where the mount target will be created. The subnet must be in the same Amazon Web Services Region as the file system. For file systems with regional availability, you can create mount targets in any subnet within the Region. The subnet determines the Availability Zone where the mount target will be located.</p>
        ipv4_address: <p>A specific IPv4 address to assign to the mount target. If not specified and the IP address type supports IPv4, an address is automatically assigned from the subnet's available IPv4 address range. The address must be within the subnet's CIDR block and not already in use.</p>
        ipv6_address: <p>A specific IPv6 address to assign to the mount target. If not specified and the IP address type supports IPv6, an address is automatically assigned from the subnet's available IPv6 address range. The address must be within the subnet's IPv6 CIDR block and not already in use.</p>
        ip_address_type: <p>The IP address type for the mount target. If not specified, <code>IPV4_ONLY</code> is used. The IP address type must match the IP configuration of the specified subnet.</p>
        security_groups: <p>An array of VPC security group IDs to associate with the mount target's network interface. These security groups control network access to the mount target. If not specified, the default security group for the subnet's VPC is used. All security groups must belong to the same VPC as the subnet.</p>

    Raises:
        capo_s3files.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Retry your request using exponential backoff.</p>
        capo_s3files.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource. This can occur when trying to create a resource that already exists or delete a resource that is in use.</p>
        capo_s3files.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_s3files.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify that the resource exists and that you have permission to access it.</p>
        capo_s3files.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed a service quota. Review your service quotas and either delete resources or request a quota increase.</p>
        capo_s3files.errors.validation_exception.ValidationException: <p>The input parameters are not valid. Check the parameter values and try again.</p>
        capo_s3files.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_s3files.types.create_mount_target_request.CreateMountTargetRequest]",
    ) -> OperationResponse[
        "capo_s3files.types.create_mount_target_response.CreateMountTargetResponse"
    ]:
        import capo_s3files._operations.s3_files.create_mount_target

        output, http_response = (
            capo_s3files._operations.s3_files.create_mount_target.create_mount_target(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateMountTarget")
    )
    input_: capo_s3files.types.create_mount_target_request.CreateMountTargetRequest = {
        "file_system_id": file_system_id,
        "subnet_id": subnet_id,
    }
    if ipv4_address is not None:
        input_["ipv4_address"] = ipv4_address
    if ipv6_address is not None:
        input_["ipv6_address"] = ipv6_address
    if ip_address_type is not None:
        input_["ip_address_type"] = ip_address_type
    if security_groups is not None:
        input_["security_groups"] = security_groups

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