published on Thursday, Aug 20, 2026 by jschady
published on Thursday, Aug 20, 2026 by jschady
A KeyLifecycleRule represents a rule that applies to API keys, GPG keys, and SSH keys (also called User Public Keys) based on their inactivity or age.
Keys that have been unused for the specified number of days will be deleted. SSH keys can also be configured to expire after a specified number of days. SSH key expiration applies only to User Public Keys used for inbound SFTP/SSH login, not Remote Server outbound SSH keys.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as filescom from "pulumi-filescom";
const exampleKeyLifecycleRule = new filescom.KeyLifecycleRule("example_key_lifecycle_rule", {
applyToAllWorkspaces: true,
expirationDays: 365,
keyType: "gpg",
inactivityDays: 12,
name: "inactive gpg keys",
workspaceId: 12,
});
import pulumi
import pulumi_filescom as filescom
example_key_lifecycle_rule = filescom.KeyLifecycleRule("example_key_lifecycle_rule",
apply_to_all_workspaces=True,
expiration_days=365,
key_type="gpg",
inactivity_days=12,
name="inactive gpg keys",
workspace_id=12)
package main
import (
"github.com/jschady/pulumi-filescom/sdk/go/filescom"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := filescom.NewKeyLifecycleRule(ctx, "example_key_lifecycle_rule", &filescom.KeyLifecycleRuleArgs{
ApplyToAllWorkspaces: pulumi.Bool(true),
ExpirationDays: pulumi.Int(365),
KeyType: pulumi.String("gpg"),
InactivityDays: pulumi.Int(12),
Name: pulumi.String("inactive gpg keys"),
WorkspaceId: pulumi.Int(12),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Filescom = Jschady.Filescom;
return await Deployment.RunAsync(() =>
{
var exampleKeyLifecycleRule = new Filescom.KeyLifecycleRule("example_key_lifecycle_rule", new()
{
ApplyToAllWorkspaces = true,
ExpirationDays = 365,
KeyType = "gpg",
InactivityDays = 12,
Name = "inactive gpg keys",
WorkspaceId = 12,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.filescom.KeyLifecycleRule;
import com.pulumi.filescom.KeyLifecycleRuleArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleKeyLifecycleRule = new KeyLifecycleRule("exampleKeyLifecycleRule", KeyLifecycleRuleArgs.builder()
.applyToAllWorkspaces(true)
.expirationDays(365)
.keyType("gpg")
.inactivityDays(12)
.name("inactive gpg keys")
.workspaceId(12)
.build());
}
}
resources:
exampleKeyLifecycleRule:
type: filescom:KeyLifecycleRule
name: example_key_lifecycle_rule
properties:
applyToAllWorkspaces: true
expirationDays: 365
keyType: gpg
inactivityDays: 12
name: inactive gpg keys
workspaceId: 12
pulumi {
required_providers {
filescom = {
source = "pulumi/filescom"
}
}
}
resource "filescom_keylifecyclerule" "example_key_lifecycle_rule" {
apply_to_all_workspaces = true
expiration_days = 365
key_type = "gpg"
inactivity_days = 12
name = "inactive gpg keys"
workspace_id = 12
}
Create KeyLifecycleRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new KeyLifecycleRule(name: string, args?: KeyLifecycleRuleArgs, opts?: CustomResourceOptions);@overload
def KeyLifecycleRule(resource_name: str,
args: Optional[KeyLifecycleRuleArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def KeyLifecycleRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
apply_to_all_workspaces: Optional[bool] = None,
expiration_days: Optional[int] = None,
inactivity_days: Optional[int] = None,
key_type: Optional[str] = None,
name: Optional[str] = None,
workspace_id: Optional[int] = None)func NewKeyLifecycleRule(ctx *Context, name string, args *KeyLifecycleRuleArgs, opts ...ResourceOption) (*KeyLifecycleRule, error)public KeyLifecycleRule(string name, KeyLifecycleRuleArgs? args = null, CustomResourceOptions? opts = null)
public KeyLifecycleRule(String name, KeyLifecycleRuleArgs args)
public KeyLifecycleRule(String name, KeyLifecycleRuleArgs args, CustomResourceOptions options)
type: filescom:KeyLifecycleRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "filescom_key_lifecycle_rule" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args KeyLifecycleRuleArgs
- 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 KeyLifecycleRuleArgs
- 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 KeyLifecycleRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KeyLifecycleRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args KeyLifecycleRuleArgs
- 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 keyLifecycleRuleResource = new Filescom.KeyLifecycleRule("keyLifecycleRuleResource", new()
{
ApplyToAllWorkspaces = false,
ExpirationDays = 0,
InactivityDays = 0,
KeyType = "string",
Name = "string",
WorkspaceId = 0,
});
example, err := filescom.NewKeyLifecycleRule(ctx, "keyLifecycleRuleResource", &filescom.KeyLifecycleRuleArgs{
ApplyToAllWorkspaces: pulumi.Bool(false),
ExpirationDays: pulumi.Int(0),
InactivityDays: pulumi.Int(0),
KeyType: pulumi.String("string"),
Name: pulumi.String("string"),
WorkspaceId: pulumi.Int(0),
})
resource "filescom_key_lifecycle_rule" "keyLifecycleRuleResource" {
lifecycle {
create_before_destroy = true
}
apply_to_all_workspaces = false
expiration_days = 0
inactivity_days = 0
key_type = "string"
name = "string"
workspace_id = 0
}
var keyLifecycleRuleResource = new KeyLifecycleRule("keyLifecycleRuleResource", KeyLifecycleRuleArgs.builder()
.applyToAllWorkspaces(false)
.expirationDays(0)
.inactivityDays(0)
.keyType("string")
.name("string")
.workspaceId(0)
.build());
key_lifecycle_rule_resource = filescom.KeyLifecycleRule("keyLifecycleRuleResource",
apply_to_all_workspaces=False,
expiration_days=0,
inactivity_days=0,
key_type="string",
name="string",
workspace_id=0)
const keyLifecycleRuleResource = new filescom.KeyLifecycleRule("keyLifecycleRuleResource", {
applyToAllWorkspaces: false,
expirationDays: 0,
inactivityDays: 0,
keyType: "string",
name: "string",
workspaceId: 0,
});
type: filescom:KeyLifecycleRule
properties:
applyToAllWorkspaces: false
expirationDays: 0
inactivityDays: 0
keyType: string
name: string
workspaceId: 0
KeyLifecycleRule 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 KeyLifecycleRule resource accepts the following input properties:
- Apply
To boolAll Workspaces - If true, a default-workspace rule also applies to keys in all workspaces.
- Expiration
Days int - Number of days after creation before an SSH key expires. Applies only to SSH keys.
- Inactivity
Days int - Number of days of inactivity before the rule applies.
- Key
Type string - Key type for which the rule will apply (gpg, ssh, or api).
- Name string
- Key Lifecycle Rule name
- Workspace
Id int - Workspace ID.
0means the default workspace.
- Apply
To boolAll Workspaces - If true, a default-workspace rule also applies to keys in all workspaces.
- Expiration
Days int - Number of days after creation before an SSH key expires. Applies only to SSH keys.
- Inactivity
Days int - Number of days of inactivity before the rule applies.
- Key
Type string - Key type for which the rule will apply (gpg, ssh, or api).
- Name string
- Key Lifecycle Rule name
- Workspace
Id int - Workspace ID.
0means the default workspace.
- apply_
to_ boolall_ workspaces - If true, a default-workspace rule also applies to keys in all workspaces.
- expiration_
days number - Number of days after creation before an SSH key expires. Applies only to SSH keys.
- inactivity_
days number - Number of days of inactivity before the rule applies.
- key_
type string - Key type for which the rule will apply (gpg, ssh, or api).
- name string
- Key Lifecycle Rule name
- workspace_
id number - Workspace ID.
0means the default workspace.
- apply
To BooleanAll Workspaces - If true, a default-workspace rule also applies to keys in all workspaces.
- expiration
Days Integer - Number of days after creation before an SSH key expires. Applies only to SSH keys.
- inactivity
Days Integer - Number of days of inactivity before the rule applies.
- key
Type String - Key type for which the rule will apply (gpg, ssh, or api).
- name String
- Key Lifecycle Rule name
- workspace
Id Integer - Workspace ID.
0means the default workspace.
- apply
To booleanAll Workspaces - If true, a default-workspace rule also applies to keys in all workspaces.
- expiration
Days number - Number of days after creation before an SSH key expires. Applies only to SSH keys.
- inactivity
Days number - Number of days of inactivity before the rule applies.
- key
Type string - Key type for which the rule will apply (gpg, ssh, or api).
- name string
- Key Lifecycle Rule name
- workspace
Id number - Workspace ID.
0means the default workspace.
- apply_
to_ boolall_ workspaces - If true, a default-workspace rule also applies to keys in all workspaces.
- expiration_
days int - Number of days after creation before an SSH key expires. Applies only to SSH keys.
- inactivity_
days int - Number of days of inactivity before the rule applies.
- key_
type str - Key type for which the rule will apply (gpg, ssh, or api).
- name str
- Key Lifecycle Rule name
- workspace_
id int - Workspace ID.
0means the default workspace.
- apply
To BooleanAll Workspaces - If true, a default-workspace rule also applies to keys in all workspaces.
- expiration
Days Number - Number of days after creation before an SSH key expires. Applies only to SSH keys.
- inactivity
Days Number - Number of days of inactivity before the rule applies.
- key
Type String - Key type for which the rule will apply (gpg, ssh, or api).
- name String
- Key Lifecycle Rule name
- workspace
Id Number - Workspace ID.
0means the default workspace.
Outputs
All input properties are implicitly available as output properties. Additionally, the KeyLifecycleRule 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 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 KeyLifecycleRule Resource
Get an existing KeyLifecycleRule 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?: KeyLifecycleRuleState, opts?: CustomResourceOptions): KeyLifecycleRule@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
apply_to_all_workspaces: Optional[bool] = None,
expiration_days: Optional[int] = None,
inactivity_days: Optional[int] = None,
key_type: Optional[str] = None,
name: Optional[str] = None,
workspace_id: Optional[int] = None) -> KeyLifecycleRulefunc GetKeyLifecycleRule(ctx *Context, name string, id IDInput, state *KeyLifecycleRuleState, opts ...ResourceOption) (*KeyLifecycleRule, error)public static KeyLifecycleRule Get(string name, Input<string> id, KeyLifecycleRuleState? state, CustomResourceOptions? opts = null)public static KeyLifecycleRule get(String name, Output<String> id, KeyLifecycleRuleState state, CustomResourceOptions options)resources: _: type: filescom:KeyLifecycleRule get: id: ${id}import {
to = filescom_key_lifecycle_rule.example
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.
- Apply
To boolAll Workspaces - If true, a default-workspace rule also applies to keys in all workspaces.
- Expiration
Days int - Number of days after creation before an SSH key expires. Applies only to SSH keys.
- Inactivity
Days int - Number of days of inactivity before the rule applies.
- Key
Type string - Key type for which the rule will apply (gpg, ssh, or api).
- Name string
- Key Lifecycle Rule name
- Workspace
Id int - Workspace ID.
0means the default workspace.
- Apply
To boolAll Workspaces - If true, a default-workspace rule also applies to keys in all workspaces.
- Expiration
Days int - Number of days after creation before an SSH key expires. Applies only to SSH keys.
- Inactivity
Days int - Number of days of inactivity before the rule applies.
- Key
Type string - Key type for which the rule will apply (gpg, ssh, or api).
- Name string
- Key Lifecycle Rule name
- Workspace
Id int - Workspace ID.
0means the default workspace.
- apply_
to_ boolall_ workspaces - If true, a default-workspace rule also applies to keys in all workspaces.
- expiration_
days number - Number of days after creation before an SSH key expires. Applies only to SSH keys.
- inactivity_
days number - Number of days of inactivity before the rule applies.
- key_
type string - Key type for which the rule will apply (gpg, ssh, or api).
- name string
- Key Lifecycle Rule name
- workspace_
id number - Workspace ID.
0means the default workspace.
- apply
To BooleanAll Workspaces - If true, a default-workspace rule also applies to keys in all workspaces.
- expiration
Days Integer - Number of days after creation before an SSH key expires. Applies only to SSH keys.
- inactivity
Days Integer - Number of days of inactivity before the rule applies.
- key
Type String - Key type for which the rule will apply (gpg, ssh, or api).
- name String
- Key Lifecycle Rule name
- workspace
Id Integer - Workspace ID.
0means the default workspace.
- apply
To booleanAll Workspaces - If true, a default-workspace rule also applies to keys in all workspaces.
- expiration
Days number - Number of days after creation before an SSH key expires. Applies only to SSH keys.
- inactivity
Days number - Number of days of inactivity before the rule applies.
- key
Type string - Key type for which the rule will apply (gpg, ssh, or api).
- name string
- Key Lifecycle Rule name
- workspace
Id number - Workspace ID.
0means the default workspace.
- apply_
to_ boolall_ workspaces - If true, a default-workspace rule also applies to keys in all workspaces.
- expiration_
days int - Number of days after creation before an SSH key expires. Applies only to SSH keys.
- inactivity_
days int - Number of days of inactivity before the rule applies.
- key_
type str - Key type for which the rule will apply (gpg, ssh, or api).
- name str
- Key Lifecycle Rule name
- workspace_
id int - Workspace ID.
0means the default workspace.
- apply
To BooleanAll Workspaces - If true, a default-workspace rule also applies to keys in all workspaces.
- expiration
Days Number - Number of days after creation before an SSH key expires. Applies only to SSH keys.
- inactivity
Days Number - Number of days of inactivity before the rule applies.
- key
Type String - Key type for which the rule will apply (gpg, ssh, or api).
- name String
- Key Lifecycle Rule name
- workspace
Id Number - Workspace ID.
0means the default workspace.
Import
The pulumi import command can be used, for example:
Key Lifecycle Rules can be imported by specifying the id.
$ pulumi import filescom:index/keyLifecycleRule:KeyLifecycleRule example_key_lifecycle_rule 1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- filescom jschady/pulumi-filescom
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
filescomTerraform Provider.
published on Thursday, Aug 20, 2026 by jschady