published on Friday, Feb 20, 2026 by stackitcloud
published on Friday, Feb 20, 2026 by stackitcloud
Service account key schema.
Example Usage
Automatically rotate service account keys
resource "stackit_service_account" "sa" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "sa01"
}
resource "time_rotating" "rotate" {
rotation_days = 80
}
resource "stackit_service_account_key" "sa_key" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
service_account_email = stackit_service_account.sa.email
ttl_days = 90
rotate_when_changed = {
rotation = time_rotating.rotate.id
}
}
Create ServiceAccountKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ServiceAccountKey(name: string, args: ServiceAccountKeyArgs, opts?: CustomResourceOptions);@overload
def ServiceAccountKey(resource_name: str,
args: ServiceAccountKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ServiceAccountKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_id: Optional[str] = None,
service_account_email: Optional[str] = None,
public_key: Optional[str] = None,
rotate_when_changed: Optional[Mapping[str, str]] = None,
ttl_days: Optional[int] = None)func NewServiceAccountKey(ctx *Context, name string, args ServiceAccountKeyArgs, opts ...ResourceOption) (*ServiceAccountKey, error)public ServiceAccountKey(string name, ServiceAccountKeyArgs args, CustomResourceOptions? opts = null)
public ServiceAccountKey(String name, ServiceAccountKeyArgs args)
public ServiceAccountKey(String name, ServiceAccountKeyArgs args, CustomResourceOptions options)
type: stackit:ServiceAccountKey
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 ServiceAccountKeyArgs
- 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 ServiceAccountKeyArgs
- 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 ServiceAccountKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServiceAccountKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServiceAccountKeyArgs
- 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 serviceAccountKeyResource = new Stackit.ServiceAccountKey("serviceAccountKeyResource", new()
{
ProjectId = "string",
ServiceAccountEmail = "string",
PublicKey = "string",
RotateWhenChanged =
{
{ "string", "string" },
},
TtlDays = 0,
});
example, err := stackit.NewServiceAccountKey(ctx, "serviceAccountKeyResource", &stackit.ServiceAccountKeyArgs{
ProjectId: pulumi.String("string"),
ServiceAccountEmail: pulumi.String("string"),
PublicKey: pulumi.String("string"),
RotateWhenChanged: pulumi.StringMap{
"string": pulumi.String("string"),
},
TtlDays: pulumi.Int(0),
})
var serviceAccountKeyResource = new ServiceAccountKey("serviceAccountKeyResource", ServiceAccountKeyArgs.builder()
.projectId("string")
.serviceAccountEmail("string")
.publicKey("string")
.rotateWhenChanged(Map.of("string", "string"))
.ttlDays(0)
.build());
service_account_key_resource = stackit.ServiceAccountKey("serviceAccountKeyResource",
project_id="string",
service_account_email="string",
public_key="string",
rotate_when_changed={
"string": "string",
},
ttl_days=0)
const serviceAccountKeyResource = new stackit.ServiceAccountKey("serviceAccountKeyResource", {
projectId: "string",
serviceAccountEmail: "string",
publicKey: "string",
rotateWhenChanged: {
string: "string",
},
ttlDays: 0,
});
type: stackit:ServiceAccountKey
properties:
projectId: string
publicKey: string
rotateWhenChanged:
string: string
serviceAccountEmail: string
ttlDays: 0
ServiceAccountKey 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 ServiceAccountKey resource accepts the following input properties:
- Project
Id string - The STACKIT project ID associated with the service account key.
- Service
Account stringEmail - The email address associated with the service account, used for account identification and communication.
- Public
Key string - Specifies the publickey (RSA2048 key-pair). If not provided, a certificate from STACKIT will be used to generate a privatekey.
- Rotate
When Dictionary<string, string>Changed - A map of arbitrary key/value pairs designed to force key recreation when they change, facilitating key rotation based on external factors such as a changing timestamp. Modifying this map triggers the creation of a new resource.
- Ttl
Days int - Specifies the key's validity duration in days. If left unspecified, the key is considered valid until it is deleted
- Project
Id string - The STACKIT project ID associated with the service account key.
- Service
Account stringEmail - The email address associated with the service account, used for account identification and communication.
- Public
Key string - Specifies the publickey (RSA2048 key-pair). If not provided, a certificate from STACKIT will be used to generate a privatekey.
- Rotate
When map[string]stringChanged - A map of arbitrary key/value pairs designed to force key recreation when they change, facilitating key rotation based on external factors such as a changing timestamp. Modifying this map triggers the creation of a new resource.
- Ttl
Days int - Specifies the key's validity duration in days. If left unspecified, the key is considered valid until it is deleted
- project
Id String - The STACKIT project ID associated with the service account key.
- service
Account StringEmail - The email address associated with the service account, used for account identification and communication.
- public
Key String - Specifies the publickey (RSA2048 key-pair). If not provided, a certificate from STACKIT will be used to generate a privatekey.
- rotate
When Map<String,String>Changed - A map of arbitrary key/value pairs designed to force key recreation when they change, facilitating key rotation based on external factors such as a changing timestamp. Modifying this map triggers the creation of a new resource.
- ttl
Days Integer - Specifies the key's validity duration in days. If left unspecified, the key is considered valid until it is deleted
- project
Id string - The STACKIT project ID associated with the service account key.
- service
Account stringEmail - The email address associated with the service account, used for account identification and communication.
- public
Key string - Specifies the publickey (RSA2048 key-pair). If not provided, a certificate from STACKIT will be used to generate a privatekey.
- rotate
When {[key: string]: string}Changed - A map of arbitrary key/value pairs designed to force key recreation when they change, facilitating key rotation based on external factors such as a changing timestamp. Modifying this map triggers the creation of a new resource.
- ttl
Days number - Specifies the key's validity duration in days. If left unspecified, the key is considered valid until it is deleted
- project_
id str - The STACKIT project ID associated with the service account key.
- service_
account_ stremail - The email address associated with the service account, used for account identification and communication.
- public_
key str - Specifies the publickey (RSA2048 key-pair). If not provided, a certificate from STACKIT will be used to generate a privatekey.
- rotate_
when_ Mapping[str, str]changed - A map of arbitrary key/value pairs designed to force key recreation when they change, facilitating key rotation based on external factors such as a changing timestamp. Modifying this map triggers the creation of a new resource.
- ttl_
days int - Specifies the key's validity duration in days. If left unspecified, the key is considered valid until it is deleted
- project
Id String - The STACKIT project ID associated with the service account key.
- service
Account StringEmail - The email address associated with the service account, used for account identification and communication.
- public
Key String - Specifies the publickey (RSA2048 key-pair). If not provided, a certificate from STACKIT will be used to generate a privatekey.
- rotate
When Map<String>Changed - A map of arbitrary key/value pairs designed to force key recreation when they change, facilitating key rotation based on external factors such as a changing timestamp. Modifying this map triggers the creation of a new resource.
- ttl
Days Number - Specifies the key's validity duration in days. If left unspecified, the key is considered valid until it is deleted
Outputs
All input properties are implicitly available as output properties. Additionally, the ServiceAccountKey resource produces the following output properties:
Look up Existing ServiceAccountKey Resource
Get an existing ServiceAccountKey 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?: ServiceAccountKeyState, opts?: CustomResourceOptions): ServiceAccountKey@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
json: Optional[str] = None,
key_id: Optional[str] = None,
project_id: Optional[str] = None,
public_key: Optional[str] = None,
rotate_when_changed: Optional[Mapping[str, str]] = None,
service_account_email: Optional[str] = None,
ttl_days: Optional[int] = None) -> ServiceAccountKeyfunc GetServiceAccountKey(ctx *Context, name string, id IDInput, state *ServiceAccountKeyState, opts ...ResourceOption) (*ServiceAccountKey, error)public static ServiceAccountKey Get(string name, Input<string> id, ServiceAccountKeyState? state, CustomResourceOptions? opts = null)public static ServiceAccountKey get(String name, Output<String> id, ServiceAccountKeyState state, CustomResourceOptions options)resources: _: type: stackit:ServiceAccountKey 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.
- Json string
- The raw JSON representation of the service account key json, available for direct use.
- Key
Id string - The unique identifier for the key associated with the service account.
- Project
Id string - The STACKIT project ID associated with the service account key.
- Public
Key string - Specifies the publickey (RSA2048 key-pair). If not provided, a certificate from STACKIT will be used to generate a privatekey.
- Rotate
When Dictionary<string, string>Changed - A map of arbitrary key/value pairs designed to force key recreation when they change, facilitating key rotation based on external factors such as a changing timestamp. Modifying this map triggers the creation of a new resource.
- Service
Account stringEmail - The email address associated with the service account, used for account identification and communication.
- Ttl
Days int - Specifies the key's validity duration in days. If left unspecified, the key is considered valid until it is deleted
- Json string
- The raw JSON representation of the service account key json, available for direct use.
- Key
Id string - The unique identifier for the key associated with the service account.
- Project
Id string - The STACKIT project ID associated with the service account key.
- Public
Key string - Specifies the publickey (RSA2048 key-pair). If not provided, a certificate from STACKIT will be used to generate a privatekey.
- Rotate
When map[string]stringChanged - A map of arbitrary key/value pairs designed to force key recreation when they change, facilitating key rotation based on external factors such as a changing timestamp. Modifying this map triggers the creation of a new resource.
- Service
Account stringEmail - The email address associated with the service account, used for account identification and communication.
- Ttl
Days int - Specifies the key's validity duration in days. If left unspecified, the key is considered valid until it is deleted
- json String
- The raw JSON representation of the service account key json, available for direct use.
- key
Id String - The unique identifier for the key associated with the service account.
- project
Id String - The STACKIT project ID associated with the service account key.
- public
Key String - Specifies the publickey (RSA2048 key-pair). If not provided, a certificate from STACKIT will be used to generate a privatekey.
- rotate
When Map<String,String>Changed - A map of arbitrary key/value pairs designed to force key recreation when they change, facilitating key rotation based on external factors such as a changing timestamp. Modifying this map triggers the creation of a new resource.
- service
Account StringEmail - The email address associated with the service account, used for account identification and communication.
- ttl
Days Integer - Specifies the key's validity duration in days. If left unspecified, the key is considered valid until it is deleted
- json string
- The raw JSON representation of the service account key json, available for direct use.
- key
Id string - The unique identifier for the key associated with the service account.
- project
Id string - The STACKIT project ID associated with the service account key.
- public
Key string - Specifies the publickey (RSA2048 key-pair). If not provided, a certificate from STACKIT will be used to generate a privatekey.
- rotate
When {[key: string]: string}Changed - A map of arbitrary key/value pairs designed to force key recreation when they change, facilitating key rotation based on external factors such as a changing timestamp. Modifying this map triggers the creation of a new resource.
- service
Account stringEmail - The email address associated with the service account, used for account identification and communication.
- ttl
Days number - Specifies the key's validity duration in days. If left unspecified, the key is considered valid until it is deleted
- json str
- The raw JSON representation of the service account key json, available for direct use.
- key_
id str - The unique identifier for the key associated with the service account.
- project_
id str - The STACKIT project ID associated with the service account key.
- public_
key str - Specifies the publickey (RSA2048 key-pair). If not provided, a certificate from STACKIT will be used to generate a privatekey.
- rotate_
when_ Mapping[str, str]changed - A map of arbitrary key/value pairs designed to force key recreation when they change, facilitating key rotation based on external factors such as a changing timestamp. Modifying this map triggers the creation of a new resource.
- service_
account_ stremail - The email address associated with the service account, used for account identification and communication.
- ttl_
days int - Specifies the key's validity duration in days. If left unspecified, the key is considered valid until it is deleted
- json String
- The raw JSON representation of the service account key json, available for direct use.
- key
Id String - The unique identifier for the key associated with the service account.
- project
Id String - The STACKIT project ID associated with the service account key.
- public
Key String - Specifies the publickey (RSA2048 key-pair). If not provided, a certificate from STACKIT will be used to generate a privatekey.
- rotate
When Map<String>Changed - A map of arbitrary key/value pairs designed to force key recreation when they change, facilitating key rotation based on external factors such as a changing timestamp. Modifying this map triggers the creation of a new resource.
- service
Account StringEmail - The email address associated with the service account, used for account identification and communication.
- ttl
Days Number - Specifies the key's validity duration in days. If left unspecified, the key is considered valid until it is deleted
Package Details
- Repository
- stackit stackitcloud/pulumi-stackit
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
stackitTerraform Provider.
published on Friday, Feb 20, 2026 by stackitcloud
