Use this recipe for both the Salted-Caramel Whoopie Pies and the Powdered-Sugar Coconut Layer Cake.
Beat butter on medium-high speed until pale and creamy, about 2 minutes. Reduce speed to medium and add sugar 1/2 cup at a time, beating after each addition, until combined, 1 to 2 minutes. Beat in vanilla. Use immediately, or store in an airtight container in refrigerator up to 3 days. Before using, bring to room temperature and beat on low speed until smooth.