When an attachment is sued out in favor of a nonresident or a foreign corporation, security for the costs of the action may be taken and approved by the officer issuing the same or may be endorsed with his approval on the attachment.
Ala. Code § 6-6-50 (1975)