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
Log in to comment and vote
Comments1
Aleksandra Cieslak
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:andautoattach_write:labels instead of the standardautoattach:label to restrict an AWS or Azure integration to read-only or write-only permissions respectively when auto-attaching it to a stack. spaceliftSo in your case, instead of using a generic
autoattach:XYZlabel on both integrations, you would:Add
autoattach_read:XYZto your read integrationAdd
autoattach_write:XYZto your write integrationThis 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:orautoattach_write:is combined withautoattach:on the same integration, both read and write permissions will be granted — so make sure to use them independently if you want strict separation. spaceliftYou 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!