published on Tuesday, Mar 31, 2026 by stackitcloud
published on Tuesday, Mar 31, 2026 by stackitcloud
Service-account Role Assignment resource schema.
Important: Use this resource to grant ‘Act-As’ permissions. This allows a service-account (the
subject) to impersonate the target Service Account. A common example is authorizing the SKE Service Account to act as a project-specific Service Account to access APIs.
This resource is part of the iam experiment and is likely going to undergo significant changes or be removed in the future. Use it at your own discretion.
Example Usage
data "stackit_service_accounts" "ske_sa_suffix" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
email_suffix = "@ske.sa.stackit.cloud"
}
resource "stackit_service_account" "iam" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "kms"
}
resource "stackit_authorization_project_role_assignment" "pr_sa" {
resource_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
role = "kms.admin"
subject = stackit_service_account.iam.email
}
// Assign the Act-As permissions to the previously created ServiceAccount.
// The SKE ServiceAccount is now authorized to access KMS upon the behalf of stackit_service_account.iam
resource "stackit_authorization_service_account_role_assignment" "sa" {
resource_id = stackit_service_account.iam.service_account_id
role = "user"
subject = data.stackit_service_accounts.ske_sa_suffix.items.0.email
}
# Only use the import statement, if you want to import an existing service account assignment
import {
to = stackit_authorization_service_account_assignment.sa
id = "${var.resource_id},${var.service_account_assignment_role},${var.service_account_assignment_subject}"
}
Create AuthorizationServiceAccountRoleAssignment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AuthorizationServiceAccountRoleAssignment(name: string, args: AuthorizationServiceAccountRoleAssignmentArgs, opts?: CustomResourceOptions);@overload
def AuthorizationServiceAccountRoleAssignment(resource_name: str,
args: AuthorizationServiceAccountRoleAssignmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AuthorizationServiceAccountRoleAssignment(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_id: Optional[str] = None,
role: Optional[str] = None,
subject: Optional[str] = None)func NewAuthorizationServiceAccountRoleAssignment(ctx *Context, name string, args AuthorizationServiceAccountRoleAssignmentArgs, opts ...ResourceOption) (*AuthorizationServiceAccountRoleAssignment, error)public AuthorizationServiceAccountRoleAssignment(string name, AuthorizationServiceAccountRoleAssignmentArgs args, CustomResourceOptions? opts = null)
public AuthorizationServiceAccountRoleAssignment(String name, AuthorizationServiceAccountRoleAssignmentArgs args)
public AuthorizationServiceAccountRoleAssignment(String name, AuthorizationServiceAccountRoleAssignmentArgs args, CustomResourceOptions options)
type: stackit:AuthorizationServiceAccountRoleAssignment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AuthorizationServiceAccountRoleAssignmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AuthorizationServiceAccountRoleAssignmentArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AuthorizationServiceAccountRoleAssignmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AuthorizationServiceAccountRoleAssignmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AuthorizationServiceAccountRoleAssignmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var authorizationServiceAccountRoleAssignmentResource = new Stackit.AuthorizationServiceAccountRoleAssignment("authorizationServiceAccountRoleAssignmentResource", new()
{
ResourceId = "string",
Role = "string",
Subject = "string",
});
example, err := stackit.NewAuthorizationServiceAccountRoleAssignment(ctx, "authorizationServiceAccountRoleAssignmentResource", &stackit.AuthorizationServiceAccountRoleAssignmentArgs{
ResourceId: pulumi.String("string"),
Role: pulumi.String("string"),
Subject: pulumi.String("string"),
})
var authorizationServiceAccountRoleAssignmentResource = new AuthorizationServiceAccountRoleAssignment("authorizationServiceAccountRoleAssignmentResource", AuthorizationServiceAccountRoleAssignmentArgs.builder()
.resourceId("string")
.role("string")
.subject("string")
.build());
authorization_service_account_role_assignment_resource = stackit.AuthorizationServiceAccountRoleAssignment("authorizationServiceAccountRoleAssignmentResource",
resource_id="string",
role="string",
subject="string")
const authorizationServiceAccountRoleAssignmentResource = new stackit.AuthorizationServiceAccountRoleAssignment("authorizationServiceAccountRoleAssignmentResource", {
resourceId: "string",
role: "string",
subject: "string",
});
type: stackit:AuthorizationServiceAccountRoleAssignment
properties:
resourceId: string
role: string
subject: string
AuthorizationServiceAccountRoleAssignment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AuthorizationServiceAccountRoleAssignment resource accepts the following input properties:
- Resource
Id string - Service-account Resource to assign the role to.
- Role string
- Role to be assigned. Available roles can be queried using stackit-cli:
stackit curl https://authorization.api.stackit.cloud/v2/permissions - Subject string
- Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
- Resource
Id string - Service-account Resource to assign the role to.
- Role string
- Role to be assigned. Available roles can be queried using stackit-cli:
stackit curl https://authorization.api.stackit.cloud/v2/permissions - Subject string
- Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
- resource
Id String - Service-account Resource to assign the role to.
- role String
- Role to be assigned. Available roles can be queried using stackit-cli:
stackit curl https://authorization.api.stackit.cloud/v2/permissions - subject String
- Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
- resource
Id string - Service-account Resource to assign the role to.
- role string
- Role to be assigned. Available roles can be queried using stackit-cli:
stackit curl https://authorization.api.stackit.cloud/v2/permissions - subject string
- Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
- resource_
id str - Service-account Resource to assign the role to.
- role str
- Role to be assigned. Available roles can be queried using stackit-cli:
stackit curl https://authorization.api.stackit.cloud/v2/permissions - subject str
- Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
- resource
Id String - Service-account Resource to assign the role to.
- role String
- Role to be assigned. Available roles can be queried using stackit-cli:
stackit curl https://authorization.api.stackit.cloud/v2/permissions - subject String
- Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
Outputs
All input properties are implicitly available as output properties. Additionally, the AuthorizationServiceAccountRoleAssignment resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing AuthorizationServiceAccountRoleAssignment Resource
Get an existing AuthorizationServiceAccountRoleAssignment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AuthorizationServiceAccountRoleAssignmentState, opts?: CustomResourceOptions): AuthorizationServiceAccountRoleAssignment@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
resource_id: Optional[str] = None,
role: Optional[str] = None,
subject: Optional[str] = None) -> AuthorizationServiceAccountRoleAssignmentfunc GetAuthorizationServiceAccountRoleAssignment(ctx *Context, name string, id IDInput, state *AuthorizationServiceAccountRoleAssignmentState, opts ...ResourceOption) (*AuthorizationServiceAccountRoleAssignment, error)public static AuthorizationServiceAccountRoleAssignment Get(string name, Input<string> id, AuthorizationServiceAccountRoleAssignmentState? state, CustomResourceOptions? opts = null)public static AuthorizationServiceAccountRoleAssignment get(String name, Output<String> id, AuthorizationServiceAccountRoleAssignmentState state, CustomResourceOptions options)resources: _: type: stackit:AuthorizationServiceAccountRoleAssignment get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Resource
Id string - Service-account Resource to assign the role to.
- Role string
- Role to be assigned. Available roles can be queried using stackit-cli:
stackit curl https://authorization.api.stackit.cloud/v2/permissions - Subject string
- Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
- Resource
Id string - Service-account Resource to assign the role to.
- Role string
- Role to be assigned. Available roles can be queried using stackit-cli:
stackit curl https://authorization.api.stackit.cloud/v2/permissions - Subject string
- Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
- resource
Id String - Service-account Resource to assign the role to.
- role String
- Role to be assigned. Available roles can be queried using stackit-cli:
stackit curl https://authorization.api.stackit.cloud/v2/permissions - subject String
- Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
- resource
Id string - Service-account Resource to assign the role to.
- role string
- Role to be assigned. Available roles can be queried using stackit-cli:
stackit curl https://authorization.api.stackit.cloud/v2/permissions - subject string
- Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
- resource_
id str - Service-account Resource to assign the role to.
- role str
- Role to be assigned. Available roles can be queried using stackit-cli:
stackit curl https://authorization.api.stackit.cloud/v2/permissions - subject str
- Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
- resource
Id String - Service-account Resource to assign the role to.
- role String
- Role to be assigned. Available roles can be queried using stackit-cli:
stackit curl https://authorization.api.stackit.cloud/v2/permissions - subject String
- Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
Package Details
- Repository
- stackit stackitcloud/pulumi-stackit
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
stackitTerraform Provider.
published on Tuesday, Mar 31, 2026 by stackitcloud
