How do I find available actions for Spacelift roles in the Terraform provider?
Last updated: September 9, 2025
Context
When using Spacelift's Advanced Access Control with the Terraform provider, specifically when configuring the `spacelift_role` resource, users need to know what actions can be specified in the actions attribute. This information is not directly listed in the provider documentation.
Answer
To get a list of all available actions for Spacelift roles, you can use the `spacelift_role_actions` data source in your Terraform configuration. Here's how to do it:
1. Add the following configuration to your Terraform code:
data "spacelift_role_actions" "all" {}
output "all_role_actions" {
value = data.spacelift_role_actions.all.actions
}
2. After applying this configuration, you'll get a complete list of all available actions that can be used in your role definitions. These actions include permissions for spaces, runs, tasks, stacks, modules, contexts, Terraform providers, and worker pools.
Sources:
Spacelift RBAC System Documentation: https://docs.spacelift.io/concepts/authorization/rbac-system
Spacelift Role Resource Documentation: https://registry.terraform.io/providers/spacelift-io/spacelift/latest/docs/resources/role
Spacelift Role Attachment Documentation: https://registry.terraform.io/providers/spacelift-io/spacelift/latest/docs/resources/role_attachment