Skip to content

describe_mount_target_security_groups async

describe_mount_target_security_groups(
    mount_target_id: MountTargetId,
    *,
    config_overrides: Optional[AsyncEFSClientConfig] = None,
) -> DescribeMountTargetSecurityGroupsResponse

Returns the security groups currently in effect for a mount target. This operation requires that the network interface of the mount target has been created and the lifecycle state of the mount target is not deleted.

This operation requires permissions for the following actions:

  • elasticfilesystem:DescribeMountTargetSecurityGroups action on the mount target's file system.

  • ec2:DescribeNetworkInterfaceAttribute action on the mount target's network interface.

Parameters:

  • mount_target_id (MountTargetId) –

    The ID of the mount target whose security groups you want to retrieve.

Raises:

  • BadRequest –

    Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter.

  • IncorrectMountTargetState –

    Returned if the mount target is not in the correct state for the operation.

  • InternalServerError –

    Returned if an error occurred on the server side.

  • MountTargetNotFound –

    Returned if there is no mount target with the specified ID found in the caller's Amazon Web Services account.

  • UnknownServiceError –

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

Examples:

To describe the security groups for a mount target This operation describes all of the security groups for a file system's mount target.

>>> await client.describe_mount_target_security_groups(mount_target_id='fsmt-12340abc')
Source code in docs_src/capo_efs/_services/async_efs.py
async def describe_mount_target_security_groups(
    self,
    mount_target_id: "capo_efs.types.mount_target_id.MountTargetId",
    *,
    config_overrides: Optional[AsyncEFSClientConfig] = None,
) -> "capo_efs.types.describe_mount_target_security_groups_response.DescribeMountTargetSecurityGroupsResponse":
    """<p>Returns the security groups currently in effect for a mount target. This operation requires that the network interface of the mount target has been created and the lifecycle state of the mount target is not <code>deleted</code>.</p> <p>This operation requires permissions for the following actions:</p> <ul> <li> <p> <code>elasticfilesystem:DescribeMountTargetSecurityGroups</code> action on the mount target's file system. </p> </li> <li> <p> <code>ec2:DescribeNetworkInterfaceAttribute</code> action on the mount target's network interface. </p> </li> </ul>

    Args:
        mount_target_id: <p>The ID of the mount target whose security groups you want to retrieve.</p>

    Raises:
        capo_efs.errors.bad_request.BadRequest: <p>Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter.</p>
        capo_efs.errors.incorrect_mount_target_state.IncorrectMountTargetState: <p>Returned if the mount target is not in the correct state for the operation.</p>
        capo_efs.errors.internal_server_error.InternalServerError: <p>Returned if an error occurred on the server side.</p>
        capo_efs.errors.mount_target_not_found.MountTargetNotFound: <p>Returned if there is no mount target with the specified ID found in the caller's Amazon Web Services account.</p>
        capo_efs.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe the security groups for a mount target
        This operation describes all of the security groups for a file system's mount target.

        >>> await client.describe_mount_target_security_groups(mount_target_id='fsmt-12340abc')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_efs.types.describe_mount_target_security_groups_request.DescribeMountTargetSecurityGroupsRequest]",
    ) -> AsyncOperationResponse[
        "capo_efs.types.describe_mount_target_security_groups_response.DescribeMountTargetSecurityGroupsResponse"
    ]:
        import capo_efs._operations.magnolio_api_service_v20150201.describe_mount_target_security_groups

        (
            output,
            http_response,
        ) = await capo_efs._operations.magnolio_api_service_v20150201.describe_mount_target_security_groups.async_describe_mount_target_security_groups(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeMountTargetSecurityGroups")
    )
    input_: capo_efs.types.describe_mount_target_security_groups_request.DescribeMountTargetSecurityGroupsRequest = {
        "mount_target_id": mount_target_id
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output