Skip to main content

Add read/write integration affinity to auto-attach labels

It is not currently possible to associate auto-attached integrations specifically with read or write roles for a stack. If I auto-attach a read integration and a write integration, Spacelift gets confused and tries to write with the read integration sometimes.

Workaround
No
Problem
Status: ✅ Completed1 comment

Log in to comment and vote

Comments1

  • Aleksandra Cieslak

    Team•

    Jun 25

    Hi!

    Thank you for raising this. We're glad you shared the details.

    The good news is that this is now supported in Spacelift. You can use the autoattach_read: and autoattach_write: labels instead of the standard autoattach: label to restrict an AWS or Azure integration to read-only or write-only permissions respectively when auto-attaching it to a stack. spacelift

    So in your case, instead of using a generic autoattach:XYZ label on both integrations, you would:

    • Add autoattach_read:XYZ to your read integration

    • Add autoattach_write:XYZ to your write integration

    This gives Spacelift the explicit signal it needs to use the correct integration for each phase, eliminating the ambiguity you experienced.

    Note that if autoattach_read: or autoattach_write: is combined with autoattach: on the same integration, both read and write permissions will be granted — so make sure to use them independently if you want strict separation. spacelift

    You can find the full details in our documentation: https://docs.spacelift.io/concepts/configuration/context#read-and-write-permission-for-aws-and-azure-integrations

    Please let us know if you have any questions or run into issues setting this up — happy to help!