(a) At any time after an action has been commenced the plaintiff may make application to the court to have the property of the defendant attached as security for the satisfaction of a judgment that may be recovered in the following cases:
(1) in an action upon an express or implied contract for the payment of money if the contract is neither secured by mortgage, lien, nor pledge upon real or personal property, or, if secured, the security is insufficient to satisfy a judgment that may be recovered by the plaintiff;
(2) in an action upon an express or implied contract against a defendant not residing in the state;
(3) in an action for the collection of a state tax or license fee.
(b) An attachment may not issue if the defendant gives security to pay a judgment that may be recovered as provided in AS 09.40.010 - 09.40.110.