Begin by cooking the pasta according to the package directions. Once it's done, drain and rinse the pasta under cold water to cool it down completely.
In a large bowl, combine the cooled pasta with the pineapple, ham, red bell pepper, shredded carrot, red onion, and green onion.
For the dressing, whisk together the mayonnaise, pineapple juice, apple cider vinegar, sugar (if using), and a pinch of salt and pepper.
Pour the dressing over the pasta mixture, and gently toss everything together until well coated.
Serve immediately or refrigerate for a few hours to allow the flavors to meld before serving. Enjoy!