1. Packages
  2. Packages
  3. Harness Provider
  4. API Docs
  5. platform
  6. HarLifecycleRule
Viewing docs for Harness v0.15.2
published on Saturday, Jul 18, 2026 by Pulumi
harness logo
Viewing docs for Harness v0.15.2
published on Saturday, Jul 18, 2026 by Pulumi

    Resource for creating and managing Harness Artifact Registry Lifecycle Rules.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    // Account-scoped DELETE rule — keep last 10 versions, runs nightly
    const nightlyCleanup = new harness.platform.HarLifecycleRule("nightly_cleanup", {
        accountId: "your-account-id",
        name: "nightly-cleanup",
        action: "DELETE",
        description: "Keep last 10 versions of all artifacts",
        applyTo: {
            mode: "ALL_IN_SCOPE",
        },
        criteria: {
            match: "ALL",
            rules: [{
                type: "KEEP_LAST_N",
                value: 10,
            }],
        },
        schedule: {
            expression: "0 2 * * *",
            timezone: "UTC",
        },
    });
    // Project-scoped DELETE rule — delete artifacts older than 30 days
    const ageBasedCleanup = new harness.platform.HarLifecycleRule("age_based_cleanup", {
        accountId: "your-account-id",
        orgId: "your-org-id",
        projectId: "your-project-id",
        name: "age-based-cleanup",
        action: "DELETE",
        applyTo: {
            mode: "ALL_IN_SCOPE",
        },
        criteria: {
            match: "ALL",
            rules: [{
                type: "AGE_BASED",
                value: 30,
                unit: "DAYS",
            }],
        },
    });
    // Org-scoped PROTECT rule — protect images in specific registries matching a tag pattern
    const protectProd = new harness.platform.HarLifecycleRule("protect_prod", {
        accountId: "your-account-id",
        orgId: "your-org-id",
        name: "protect-prod-images",
        action: "PROTECT",
        packageType: "DOCKER",
        applyTo: {
            mode: "EXPLICIT",
            registries: [
                "prod-registry",
                "release-registry",
            ],
        },
        filterConfig: {
            packageType: "DOCKER",
            tagNameAllowedPatterns: [
                "v*",
                "release-*",
            ],
        },
    });
    // Account-scoped DELETE rule with multiple criteria (ANY match)
    const multiCriteriaCleanup = new harness.platform.HarLifecycleRule("multi_criteria_cleanup", {
        accountId: "your-account-id",
        name: "multi-criteria-cleanup",
        action: "DELETE",
        applyTo: {
            mode: "ALL_IN_SCOPE",
        },
        criteria: {
            match: "ANY",
            rules: [
                {
                    type: "KEEP_LAST_N",
                    value: 5,
                },
                {
                    type: "AGE_BASED",
                    value: 90,
                    unit: "DAYS",
                },
            ],
        },
    });
    
    import pulumi
    import pulumi_harness as harness
    
    # Account-scoped DELETE rule — keep last 10 versions, runs nightly
    nightly_cleanup = harness.platform.HarLifecycleRule("nightly_cleanup",
        account_id="your-account-id",
        name="nightly-cleanup",
        action="DELETE",
        description="Keep last 10 versions of all artifacts",
        apply_to={
            "mode": "ALL_IN_SCOPE",
        },
        criteria={
            "match": "ALL",
            "rules": [{
                "type": "KEEP_LAST_N",
                "value": 10,
            }],
        },
        schedule={
            "expression": "0 2 * * *",
            "timezone": "UTC",
        })
    # Project-scoped DELETE rule — delete artifacts older than 30 days
    age_based_cleanup = harness.platform.HarLifecycleRule("age_based_cleanup",
        account_id="your-account-id",
        org_id="your-org-id",
        project_id="your-project-id",
        name="age-based-cleanup",
        action="DELETE",
        apply_to={
            "mode": "ALL_IN_SCOPE",
        },
        criteria={
            "match": "ALL",
            "rules": [{
                "type": "AGE_BASED",
                "value": 30,
                "unit": "DAYS",
            }],
        })
    # Org-scoped PROTECT rule — protect images in specific registries matching a tag pattern
    protect_prod = harness.platform.HarLifecycleRule("protect_prod",
        account_id="your-account-id",
        org_id="your-org-id",
        name="protect-prod-images",
        action="PROTECT",
        package_type="DOCKER",
        apply_to={
            "mode": "EXPLICIT",
            "registries": [
                "prod-registry",
                "release-registry",
            ],
        },
        filter_config={
            "package_type": "DOCKER",
            "tag_name_allowed_patterns": [
                "v*",
                "release-*",
            ],
        })
    # Account-scoped DELETE rule with multiple criteria (ANY match)
    multi_criteria_cleanup = harness.platform.HarLifecycleRule("multi_criteria_cleanup",
        account_id="your-account-id",
        name="multi-criteria-cleanup",
        action="DELETE",
        apply_to={
            "mode": "ALL_IN_SCOPE",
        },
        criteria={
            "match": "ANY",
            "rules": [
                {
                    "type": "KEEP_LAST_N",
                    "value": 5,
                },
                {
                    "type": "AGE_BASED",
                    "value": 90,
                    "unit": "DAYS",
                },
            ],
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-harness/sdk/go/harness/platform"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Account-scoped DELETE rule — keep last 10 versions, runs nightly
    		_, err := platform.NewHarLifecycleRule(ctx, "nightly_cleanup", &platform.HarLifecycleRuleArgs{
    			AccountId:   pulumi.String("your-account-id"),
    			Name:        pulumi.String("nightly-cleanup"),
    			Action:      pulumi.String("DELETE"),
    			Description: pulumi.String("Keep last 10 versions of all artifacts"),
    			ApplyTo: &platform.HarLifecycleRuleApplyToArgs{
    				Mode: pulumi.String("ALL_IN_SCOPE"),
    			},
    			Criteria: &platform.HarLifecycleRuleCriteriaArgs{
    				Match: pulumi.String("ALL"),
    				Rules: platform.HarLifecycleRuleCriteriaRuleArray{
    					&platform.HarLifecycleRuleCriteriaRuleArgs{
    						Type:  pulumi.String("KEEP_LAST_N"),
    						Value: pulumi.Int(10),
    					},
    				},
    			},
    			Schedule: &platform.HarLifecycleRuleScheduleArgs{
    				Expression: pulumi.String("0 2 * * *"),
    				Timezone:   pulumi.String("UTC"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Project-scoped DELETE rule — delete artifacts older than 30 days
    		_, err = platform.NewHarLifecycleRule(ctx, "age_based_cleanup", &platform.HarLifecycleRuleArgs{
    			AccountId: pulumi.String("your-account-id"),
    			OrgId:     pulumi.String("your-org-id"),
    			ProjectId: pulumi.String("your-project-id"),
    			Name:      pulumi.String("age-based-cleanup"),
    			Action:    pulumi.String("DELETE"),
    			ApplyTo: &platform.HarLifecycleRuleApplyToArgs{
    				Mode: pulumi.String("ALL_IN_SCOPE"),
    			},
    			Criteria: &platform.HarLifecycleRuleCriteriaArgs{
    				Match: pulumi.String("ALL"),
    				Rules: platform.HarLifecycleRuleCriteriaRuleArray{
    					&platform.HarLifecycleRuleCriteriaRuleArgs{
    						Type:  pulumi.String("AGE_BASED"),
    						Value: pulumi.Int(30),
    						Unit:  pulumi.String("DAYS"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Org-scoped PROTECT rule — protect images in specific registries matching a tag pattern
    		_, err = platform.NewHarLifecycleRule(ctx, "protect_prod", &platform.HarLifecycleRuleArgs{
    			AccountId:   pulumi.String("your-account-id"),
    			OrgId:       pulumi.String("your-org-id"),
    			Name:        pulumi.String("protect-prod-images"),
    			Action:      pulumi.String("PROTECT"),
    			PackageType: pulumi.String("DOCKER"),
    			ApplyTo: &platform.HarLifecycleRuleApplyToArgs{
    				Mode: pulumi.String("EXPLICIT"),
    				Registries: pulumi.StringArray{
    					pulumi.String("prod-registry"),
    					pulumi.String("release-registry"),
    				},
    			},
    			FilterConfig: &platform.HarLifecycleRuleFilterConfigArgs{
    				PackageType: pulumi.String("DOCKER"),
    				TagNameAllowedPatterns: pulumi.StringArray{
    					pulumi.String("v*"),
    					pulumi.String("release-*"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Account-scoped DELETE rule with multiple criteria (ANY match)
    		_, err = platform.NewHarLifecycleRule(ctx, "multi_criteria_cleanup", &platform.HarLifecycleRuleArgs{
    			AccountId: pulumi.String("your-account-id"),
    			Name:      pulumi.String("multi-criteria-cleanup"),
    			Action:    pulumi.String("DELETE"),
    			ApplyTo: &platform.HarLifecycleRuleApplyToArgs{
    				Mode: pulumi.String("ALL_IN_SCOPE"),
    			},
    			Criteria: &platform.HarLifecycleRuleCriteriaArgs{
    				Match: pulumi.String("ANY"),
    				Rules: platform.HarLifecycleRuleCriteriaRuleArray{
    					&platform.HarLifecycleRuleCriteriaRuleArgs{
    						Type:  pulumi.String("KEEP_LAST_N"),
    						Value: pulumi.Int(5),
    					},
    					&platform.HarLifecycleRuleCriteriaRuleArgs{
    						Type:  pulumi.String("AGE_BASED"),
    						Value: pulumi.Int(90),
    						Unit:  pulumi.String("DAYS"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Harness = Pulumi.Harness;
    
    return await Deployment.RunAsync(() => 
    {
        // Account-scoped DELETE rule — keep last 10 versions, runs nightly
        var nightlyCleanup = new Harness.Platform.HarLifecycleRule("nightly_cleanup", new()
        {
            AccountId = "your-account-id",
            Name = "nightly-cleanup",
            Action = "DELETE",
            Description = "Keep last 10 versions of all artifacts",
            ApplyTo = new Harness.Platform.Inputs.HarLifecycleRuleApplyToArgs
            {
                Mode = "ALL_IN_SCOPE",
            },
            Criteria = new Harness.Platform.Inputs.HarLifecycleRuleCriteriaArgs
            {
                Match = "ALL",
                Rules = new[]
                {
                    new Harness.Platform.Inputs.HarLifecycleRuleCriteriaRuleArgs
                    {
                        Type = "KEEP_LAST_N",
                        Value = 10,
                    },
                },
            },
            Schedule = new Harness.Platform.Inputs.HarLifecycleRuleScheduleArgs
            {
                Expression = "0 2 * * *",
                Timezone = "UTC",
            },
        });
    
        // Project-scoped DELETE rule — delete artifacts older than 30 days
        var ageBasedCleanup = new Harness.Platform.HarLifecycleRule("age_based_cleanup", new()
        {
            AccountId = "your-account-id",
            OrgId = "your-org-id",
            ProjectId = "your-project-id",
            Name = "age-based-cleanup",
            Action = "DELETE",
            ApplyTo = new Harness.Platform.Inputs.HarLifecycleRuleApplyToArgs
            {
                Mode = "ALL_IN_SCOPE",
            },
            Criteria = new Harness.Platform.Inputs.HarLifecycleRuleCriteriaArgs
            {
                Match = "ALL",
                Rules = new[]
                {
                    new Harness.Platform.Inputs.HarLifecycleRuleCriteriaRuleArgs
                    {
                        Type = "AGE_BASED",
                        Value = 30,
                        Unit = "DAYS",
                    },
                },
            },
        });
    
        // Org-scoped PROTECT rule — protect images in specific registries matching a tag pattern
        var protectProd = new Harness.Platform.HarLifecycleRule("protect_prod", new()
        {
            AccountId = "your-account-id",
            OrgId = "your-org-id",
            Name = "protect-prod-images",
            Action = "PROTECT",
            PackageType = "DOCKER",
            ApplyTo = new Harness.Platform.Inputs.HarLifecycleRuleApplyToArgs
            {
                Mode = "EXPLICIT",
                Registries = new[]
                {
                    "prod-registry",
                    "release-registry",
                },
            },
            FilterConfig = new Harness.Platform.Inputs.HarLifecycleRuleFilterConfigArgs
            {
                PackageType = "DOCKER",
                TagNameAllowedPatterns = new[]
                {
                    "v*",
                    "release-*",
                },
            },
        });
    
        // Account-scoped DELETE rule with multiple criteria (ANY match)
        var multiCriteriaCleanup = new Harness.Platform.HarLifecycleRule("multi_criteria_cleanup", new()
        {
            AccountId = "your-account-id",
            Name = "multi-criteria-cleanup",
            Action = "DELETE",
            ApplyTo = new Harness.Platform.Inputs.HarLifecycleRuleApplyToArgs
            {
                Mode = "ALL_IN_SCOPE",
            },
            Criteria = new Harness.Platform.Inputs.HarLifecycleRuleCriteriaArgs
            {
                Match = "ANY",
                Rules = new[]
                {
                    new Harness.Platform.Inputs.HarLifecycleRuleCriteriaRuleArgs
                    {
                        Type = "KEEP_LAST_N",
                        Value = 5,
                    },
                    new Harness.Platform.Inputs.HarLifecycleRuleCriteriaRuleArgs
                    {
                        Type = "AGE_BASED",
                        Value = 90,
                        Unit = "DAYS",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.platform.HarLifecycleRule;
    import com.pulumi.harness.platform.HarLifecycleRuleArgs;
    import com.pulumi.harness.platform.inputs.HarLifecycleRuleApplyToArgs;
    import com.pulumi.harness.platform.inputs.HarLifecycleRuleCriteriaArgs;
    import com.pulumi.harness.platform.inputs.HarLifecycleRuleCriteriaRuleArgs;
    import com.pulumi.harness.platform.inputs.HarLifecycleRuleScheduleArgs;
    import com.pulumi.harness.platform.inputs.HarLifecycleRuleFilterConfigArgs;
    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) {
            // Account-scoped DELETE rule — keep last 10 versions, runs nightly
            var nightlyCleanup = new HarLifecycleRule("nightlyCleanup", HarLifecycleRuleArgs.builder()
                .accountId("your-account-id")
                .name("nightly-cleanup")
                .action("DELETE")
                .description("Keep last 10 versions of all artifacts")
                .applyTo(HarLifecycleRuleApplyToArgs.builder()
                    .mode("ALL_IN_SCOPE")
                    .build())
                .criteria(HarLifecycleRuleCriteriaArgs.builder()
                    .match("ALL")
                    .rules(HarLifecycleRuleCriteriaRuleArgs.builder()
                        .type("KEEP_LAST_N")
                        .value(10)
                        .build())
                    .build())
                .schedule(HarLifecycleRuleScheduleArgs.builder()
                    .expression("0 2 * * *")
                    .timezone("UTC")
                    .build())
                .build());
    
            // Project-scoped DELETE rule — delete artifacts older than 30 days
            var ageBasedCleanup = new HarLifecycleRule("ageBasedCleanup", HarLifecycleRuleArgs.builder()
                .accountId("your-account-id")
                .orgId("your-org-id")
                .projectId("your-project-id")
                .name("age-based-cleanup")
                .action("DELETE")
                .applyTo(HarLifecycleRuleApplyToArgs.builder()
                    .mode("ALL_IN_SCOPE")
                    .build())
                .criteria(HarLifecycleRuleCriteriaArgs.builder()
                    .match("ALL")
                    .rules(HarLifecycleRuleCriteriaRuleArgs.builder()
                        .type("AGE_BASED")
                        .value(30)
                        .unit("DAYS")
                        .build())
                    .build())
                .build());
    
            // Org-scoped PROTECT rule — protect images in specific registries matching a tag pattern
            var protectProd = new HarLifecycleRule("protectProd", HarLifecycleRuleArgs.builder()
                .accountId("your-account-id")
                .orgId("your-org-id")
                .name("protect-prod-images")
                .action("PROTECT")
                .packageType("DOCKER")
                .applyTo(HarLifecycleRuleApplyToArgs.builder()
                    .mode("EXPLICIT")
                    .registries(                
                        "prod-registry",
                        "release-registry")
                    .build())
                .filterConfig(HarLifecycleRuleFilterConfigArgs.builder()
                    .packageType("DOCKER")
                    .tagNameAllowedPatterns(                
                        "v*",
                        "release-*")
                    .build())
                .build());
    
            // Account-scoped DELETE rule with multiple criteria (ANY match)
            var multiCriteriaCleanup = new HarLifecycleRule("multiCriteriaCleanup", HarLifecycleRuleArgs.builder()
                .accountId("your-account-id")
                .name("multi-criteria-cleanup")
                .action("DELETE")
                .applyTo(HarLifecycleRuleApplyToArgs.builder()
                    .mode("ALL_IN_SCOPE")
                    .build())
                .criteria(HarLifecycleRuleCriteriaArgs.builder()
                    .match("ANY")
                    .rules(                
                        HarLifecycleRuleCriteriaRuleArgs.builder()
                            .type("KEEP_LAST_N")
                            .value(5)
                            .build(),
                        HarLifecycleRuleCriteriaRuleArgs.builder()
                            .type("AGE_BASED")
                            .value(90)
                            .unit("DAYS")
                            .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Account-scoped DELETE rule — keep last 10 versions, runs nightly
      nightlyCleanup:
        type: harness:platform:HarLifecycleRule
        name: nightly_cleanup
        properties:
          accountId: your-account-id
          name: nightly-cleanup
          action: DELETE
          description: Keep last 10 versions of all artifacts
          applyTo:
            mode: ALL_IN_SCOPE
          criteria:
            match: ALL
            rules:
              - type: KEEP_LAST_N
                value: 10
          schedule:
            expression: 0 2 * * *
            timezone: UTC
      # Project-scoped DELETE rule — delete artifacts older than 30 days
      ageBasedCleanup:
        type: harness:platform:HarLifecycleRule
        name: age_based_cleanup
        properties:
          accountId: your-account-id
          orgId: your-org-id
          projectId: your-project-id
          name: age-based-cleanup
          action: DELETE
          applyTo:
            mode: ALL_IN_SCOPE
          criteria:
            match: ALL
            rules:
              - type: AGE_BASED
                value: 30
                unit: DAYS
      # Org-scoped PROTECT rule — protect images in specific registries matching a tag pattern
      protectProd:
        type: harness:platform:HarLifecycleRule
        name: protect_prod
        properties:
          accountId: your-account-id
          orgId: your-org-id
          name: protect-prod-images
          action: PROTECT
          packageType: DOCKER
          applyTo:
            mode: EXPLICIT
            registries:
              - prod-registry
              - release-registry
          filterConfig:
            packageType: DOCKER
            tagNameAllowedPatterns:
              - v*
              - release-*
      # Account-scoped DELETE rule with multiple criteria (ANY match)
      multiCriteriaCleanup:
        type: harness:platform:HarLifecycleRule
        name: multi_criteria_cleanup
        properties:
          accountId: your-account-id
          name: multi-criteria-cleanup
          action: DELETE
          applyTo:
            mode: ALL_IN_SCOPE
          criteria:
            match: ANY
            rules:
              - type: KEEP_LAST_N
                value: 5
              - type: AGE_BASED
                value: 90
                unit: DAYS
    
    pulumi {
      required_providers {
        harness = {
          source = "pulumi/harness"
        }
      }
    }
    
    # Account-scoped DELETE rule — keep last 10 versions, runs nightly
    resource "harness_platform_harlifecyclerule" "nightly_cleanup" {
      account_id  = "your-account-id"
      name        = "nightly-cleanup"
      action      = "DELETE"
      description = "Keep last 10 versions of all artifacts"
      apply_to = {
        mode = "ALL_IN_SCOPE"
      }
      criteria = {
        match = "ALL"
        rules = [{
          "type"  = "KEEP_LAST_N"
          "value" = 10
        }]
      }
      schedule = {
        expression = "0 2 * * *"
        timezone   = "UTC"
      }
    }
    # Project-scoped DELETE rule — delete artifacts older than 30 days
    resource "harness_platform_harlifecyclerule" "age_based_cleanup" {
      account_id = "your-account-id"
      org_id     = "your-org-id"
      project_id = "your-project-id"
      name       = "age-based-cleanup"
      action     = "DELETE"
      apply_to = {
        mode = "ALL_IN_SCOPE"
      }
      criteria = {
        match = "ALL"
        rules = [{
          "type"  = "AGE_BASED"
          "value" = 30
          "unit"  = "DAYS"
        }]
      }
    }
    # Org-scoped PROTECT rule — protect images in specific registries matching a tag pattern
    resource "harness_platform_harlifecyclerule" "protect_prod" {
      account_id   = "your-account-id"
      org_id       = "your-org-id"
      name         = "protect-prod-images"
      action       = "PROTECT"
      package_type = "DOCKER"
      apply_to = {
        mode       = "EXPLICIT"
        registries = ["prod-registry", "release-registry"]
      }
      filter_config = {
        package_type              = "DOCKER"
        tag_name_allowed_patterns = ["v*", "release-*"]
      }
    }
    # Account-scoped DELETE rule with multiple criteria (ANY match)
    resource "harness_platform_harlifecyclerule" "multi_criteria_cleanup" {
      account_id = "your-account-id"
      name       = "multi-criteria-cleanup"
      action     = "DELETE"
      apply_to = {
        mode = "ALL_IN_SCOPE"
      }
      criteria = {
        match = "ANY"
        rules = [{
          "type"  = "KEEP_LAST_N"
          "value" = 5
          }, {
          "type"  = "AGE_BASED"
          "value" = 90
          "unit"  = "DAYS"
        }]
      }
    }
    

    Create HarLifecycleRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new HarLifecycleRule(name: string, args: HarLifecycleRuleArgs, opts?: CustomResourceOptions);
    @overload
    def HarLifecycleRule(resource_name: str,
                         args: HarLifecycleRuleArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def HarLifecycleRule(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         account_id: Optional[str] = None,
                         action: Optional[str] = None,
                         apply_to: Optional[HarLifecycleRuleApplyToArgs] = None,
                         criteria: Optional[HarLifecycleRuleCriteriaArgs] = None,
                         description: Optional[str] = None,
                         enabled: Optional[bool] = None,
                         filter_config: Optional[HarLifecycleRuleFilterConfigArgs] = None,
                         name: Optional[str] = None,
                         org_id: Optional[str] = None,
                         package_type: Optional[str] = None,
                         project_id: Optional[str] = None,
                         schedule: Optional[HarLifecycleRuleScheduleArgs] = None)
    func NewHarLifecycleRule(ctx *Context, name string, args HarLifecycleRuleArgs, opts ...ResourceOption) (*HarLifecycleRule, error)
    public HarLifecycleRule(string name, HarLifecycleRuleArgs args, CustomResourceOptions? opts = null)
    public HarLifecycleRule(String name, HarLifecycleRuleArgs args)
    public HarLifecycleRule(String name, HarLifecycleRuleArgs args, CustomResourceOptions options)
    
    type: harness:platform:HarLifecycleRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "harness_platform_harlifecyclerule" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args HarLifecycleRuleArgs
    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 HarLifecycleRuleArgs
    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 HarLifecycleRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args HarLifecycleRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args HarLifecycleRuleArgs
    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 harLifecycleRuleResource = new Harness.Platform.HarLifecycleRule("harLifecycleRuleResource", new()
    {
        AccountId = "string",
        Action = "string",
        ApplyTo = new Harness.Platform.Inputs.HarLifecycleRuleApplyToArgs
        {
            Mode = "string",
            Registries = new[]
            {
                "string",
            },
        },
        Criteria = new Harness.Platform.Inputs.HarLifecycleRuleCriteriaArgs
        {
            Match = "string",
            Rules = new[]
            {
                new Harness.Platform.Inputs.HarLifecycleRuleCriteriaRuleArgs
                {
                    Type = "string",
                    Unit = "string",
                    Value = 0,
                },
            },
        },
        Description = "string",
        Enabled = false,
        FilterConfig = new Harness.Platform.Inputs.HarLifecycleRuleFilterConfigArgs
        {
            PackageType = "string",
            DatasetAllowedPatterns = new[]
            {
                "string",
            },
            GroupIdAllowedPatterns = new[]
            {
                "string",
            },
            ModelAllowedPatterns = new[]
            {
                "string",
            },
            PackageNameAllowedPatterns = new[]
            {
                "string",
            },
            TagNameAllowedPatterns = new[]
            {
                "string",
            },
            VersionNameAllowedPatterns = new[]
            {
                "string",
            },
        },
        Name = "string",
        OrgId = "string",
        PackageType = "string",
        ProjectId = "string",
        Schedule = new Harness.Platform.Inputs.HarLifecycleRuleScheduleArgs
        {
            Expression = "string",
            Timezone = "string",
        },
    });
    
    example, err := platform.NewHarLifecycleRule(ctx, "harLifecycleRuleResource", &platform.HarLifecycleRuleArgs{
    	AccountId: pulumi.String("string"),
    	Action:    pulumi.String("string"),
    	ApplyTo: &platform.HarLifecycleRuleApplyToArgs{
    		Mode: pulumi.String("string"),
    		Registries: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	Criteria: &platform.HarLifecycleRuleCriteriaArgs{
    		Match: pulumi.String("string"),
    		Rules: platform.HarLifecycleRuleCriteriaRuleArray{
    			&platform.HarLifecycleRuleCriteriaRuleArgs{
    				Type:  pulumi.String("string"),
    				Unit:  pulumi.String("string"),
    				Value: pulumi.Int(0),
    			},
    		},
    	},
    	Description: pulumi.String("string"),
    	Enabled:     pulumi.Bool(false),
    	FilterConfig: &platform.HarLifecycleRuleFilterConfigArgs{
    		PackageType: pulumi.String("string"),
    		DatasetAllowedPatterns: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		GroupIdAllowedPatterns: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		ModelAllowedPatterns: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		PackageNameAllowedPatterns: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		TagNameAllowedPatterns: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		VersionNameAllowedPatterns: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	Name:        pulumi.String("string"),
    	OrgId:       pulumi.String("string"),
    	PackageType: pulumi.String("string"),
    	ProjectId:   pulumi.String("string"),
    	Schedule: &platform.HarLifecycleRuleScheduleArgs{
    		Expression: pulumi.String("string"),
    		Timezone:   pulumi.String("string"),
    	},
    })
    
    resource "harness_platform_harlifecyclerule" "harLifecycleRuleResource" {
      account_id = "string"
      action     = "string"
      apply_to = {
        mode       = "string"
        registries = ["string"]
      }
      criteria = {
        match = "string"
        rules = [{
          "type"  = "string"
          "unit"  = "string"
          "value" = 0
        }]
      }
      description = "string"
      enabled     = false
      filter_config = {
        package_type                  = "string"
        dataset_allowed_patterns      = ["string"]
        group_id_allowed_patterns     = ["string"]
        model_allowed_patterns        = ["string"]
        package_name_allowed_patterns = ["string"]
        tag_name_allowed_patterns     = ["string"]
        version_name_allowed_patterns = ["string"]
      }
      name         = "string"
      org_id       = "string"
      package_type = "string"
      project_id   = "string"
      schedule = {
        expression = "string"
        timezone   = "string"
      }
    }
    
    var harLifecycleRuleResource = new HarLifecycleRule("harLifecycleRuleResource", HarLifecycleRuleArgs.builder()
        .accountId("string")
        .action("string")
        .applyTo(HarLifecycleRuleApplyToArgs.builder()
            .mode("string")
            .registries("string")
            .build())
        .criteria(HarLifecycleRuleCriteriaArgs.builder()
            .match("string")
            .rules(HarLifecycleRuleCriteriaRuleArgs.builder()
                .type("string")
                .unit("string")
                .value(0)
                .build())
            .build())
        .description("string")
        .enabled(false)
        .filterConfig(HarLifecycleRuleFilterConfigArgs.builder()
            .packageType("string")
            .datasetAllowedPatterns("string")
            .groupIdAllowedPatterns("string")
            .modelAllowedPatterns("string")
            .packageNameAllowedPatterns("string")
            .tagNameAllowedPatterns("string")
            .versionNameAllowedPatterns("string")
            .build())
        .name("string")
        .orgId("string")
        .packageType("string")
        .projectId("string")
        .schedule(HarLifecycleRuleScheduleArgs.builder()
            .expression("string")
            .timezone("string")
            .build())
        .build());
    
    har_lifecycle_rule_resource = harness.platform.HarLifecycleRule("harLifecycleRuleResource",
        account_id="string",
        action="string",
        apply_to={
            "mode": "string",
            "registries": ["string"],
        },
        criteria={
            "match": "string",
            "rules": [{
                "type": "string",
                "unit": "string",
                "value": 0,
            }],
        },
        description="string",
        enabled=False,
        filter_config={
            "package_type": "string",
            "dataset_allowed_patterns": ["string"],
            "group_id_allowed_patterns": ["string"],
            "model_allowed_patterns": ["string"],
            "package_name_allowed_patterns": ["string"],
            "tag_name_allowed_patterns": ["string"],
            "version_name_allowed_patterns": ["string"],
        },
        name="string",
        org_id="string",
        package_type="string",
        project_id="string",
        schedule={
            "expression": "string",
            "timezone": "string",
        })
    
    const harLifecycleRuleResource = new harness.platform.HarLifecycleRule("harLifecycleRuleResource", {
        accountId: "string",
        action: "string",
        applyTo: {
            mode: "string",
            registries: ["string"],
        },
        criteria: {
            match: "string",
            rules: [{
                type: "string",
                unit: "string",
                value: 0,
            }],
        },
        description: "string",
        enabled: false,
        filterConfig: {
            packageType: "string",
            datasetAllowedPatterns: ["string"],
            groupIdAllowedPatterns: ["string"],
            modelAllowedPatterns: ["string"],
            packageNameAllowedPatterns: ["string"],
            tagNameAllowedPatterns: ["string"],
            versionNameAllowedPatterns: ["string"],
        },
        name: "string",
        orgId: "string",
        packageType: "string",
        projectId: "string",
        schedule: {
            expression: "string",
            timezone: "string",
        },
    });
    
    type: harness:platform:HarLifecycleRule
    properties:
        accountId: string
        action: string
        applyTo:
            mode: string
            registries:
                - string
        criteria:
            match: string
            rules:
                - type: string
                  unit: string
                  value: 0
        description: string
        enabled: false
        filterConfig:
            datasetAllowedPatterns:
                - string
            groupIdAllowedPatterns:
                - string
            modelAllowedPatterns:
                - string
            packageNameAllowedPatterns:
                - string
            packageType: string
            tagNameAllowedPatterns:
                - string
            versionNameAllowedPatterns:
                - string
        name: string
        orgId: string
        packageType: string
        projectId: string
        schedule:
            expression: string
            timezone: string
    

    HarLifecycleRule 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 HarLifecycleRule resource accepts the following input properties:

    AccountId string
    Account identifier for the lifecycle rule.
    Action string
    Action to perform: DELETE or PROTECT.
    ApplyTo HarLifecycleRuleApplyTo
    Defines which registries this rule applies to.
    Criteria HarLifecycleRuleCriteria
    Cleanup criteria for the lifecycle rule.
    Description string
    Enabled bool
    Whether the rule is enabled.
    FilterConfig HarLifecycleRuleFilterConfig
    Package-type-specific filter configuration.
    Name string
    Name of the lifecycle rule.
    OrgId string
    Organization identifier. Required for org-scoped rules.
    PackageType string
    Package type the rule applies to (e.g. DOCKER, MAVEN, HELM).
    ProjectId string
    Project identifier. Required for project-scoped rules.
    Schedule HarLifecycleRuleSchedule
    Cron schedule for automatic execution of the rule.
    AccountId string
    Account identifier for the lifecycle rule.
    Action string
    Action to perform: DELETE or PROTECT.
    ApplyTo HarLifecycleRuleApplyToArgs
    Defines which registries this rule applies to.
    Criteria HarLifecycleRuleCriteriaArgs
    Cleanup criteria for the lifecycle rule.
    Description string
    Enabled bool
    Whether the rule is enabled.
    FilterConfig HarLifecycleRuleFilterConfigArgs
    Package-type-specific filter configuration.
    Name string
    Name of the lifecycle rule.
    OrgId string
    Organization identifier. Required for org-scoped rules.
    PackageType string
    Package type the rule applies to (e.g. DOCKER, MAVEN, HELM).
    ProjectId string
    Project identifier. Required for project-scoped rules.
    Schedule HarLifecycleRuleScheduleArgs
    Cron schedule for automatic execution of the rule.
    account_id string
    Account identifier for the lifecycle rule.
    action string
    Action to perform: DELETE or PROTECT.
    apply_to object
    Defines which registries this rule applies to.
    criteria object
    Cleanup criteria for the lifecycle rule.
    description string
    enabled bool
    Whether the rule is enabled.
    filter_config object
    Package-type-specific filter configuration.
    name string
    Name of the lifecycle rule.
    org_id string
    Organization identifier. Required for org-scoped rules.
    package_type string
    Package type the rule applies to (e.g. DOCKER, MAVEN, HELM).
    project_id string
    Project identifier. Required for project-scoped rules.
    schedule object
    Cron schedule for automatic execution of the rule.
    accountId String
    Account identifier for the lifecycle rule.
    action String
    Action to perform: DELETE or PROTECT.
    applyTo HarLifecycleRuleApplyTo
    Defines which registries this rule applies to.
    criteria HarLifecycleRuleCriteria
    Cleanup criteria for the lifecycle rule.
    description String
    enabled Boolean
    Whether the rule is enabled.
    filterConfig HarLifecycleRuleFilterConfig
    Package-type-specific filter configuration.
    name String
    Name of the lifecycle rule.
    orgId String
    Organization identifier. Required for org-scoped rules.
    packageType String
    Package type the rule applies to (e.g. DOCKER, MAVEN, HELM).
    projectId String
    Project identifier. Required for project-scoped rules.
    schedule HarLifecycleRuleSchedule
    Cron schedule for automatic execution of the rule.
    accountId string
    Account identifier for the lifecycle rule.
    action string
    Action to perform: DELETE or PROTECT.
    applyTo HarLifecycleRuleApplyTo
    Defines which registries this rule applies to.
    criteria HarLifecycleRuleCriteria
    Cleanup criteria for the lifecycle rule.
    description string
    enabled boolean
    Whether the rule is enabled.
    filterConfig HarLifecycleRuleFilterConfig
    Package-type-specific filter configuration.
    name string
    Name of the lifecycle rule.
    orgId string
    Organization identifier. Required for org-scoped rules.
    packageType string
    Package type the rule applies to (e.g. DOCKER, MAVEN, HELM).
    projectId string
    Project identifier. Required for project-scoped rules.
    schedule HarLifecycleRuleSchedule
    Cron schedule for automatic execution of the rule.
    account_id str
    Account identifier for the lifecycle rule.
    action str
    Action to perform: DELETE or PROTECT.
    apply_to HarLifecycleRuleApplyToArgs
    Defines which registries this rule applies to.
    criteria HarLifecycleRuleCriteriaArgs
    Cleanup criteria for the lifecycle rule.
    description str
    enabled bool
    Whether the rule is enabled.
    filter_config HarLifecycleRuleFilterConfigArgs
    Package-type-specific filter configuration.
    name str
    Name of the lifecycle rule.
    org_id str
    Organization identifier. Required for org-scoped rules.
    package_type str
    Package type the rule applies to (e.g. DOCKER, MAVEN, HELM).
    project_id str
    Project identifier. Required for project-scoped rules.
    schedule HarLifecycleRuleScheduleArgs
    Cron schedule for automatic execution of the rule.
    accountId String
    Account identifier for the lifecycle rule.
    action String
    Action to perform: DELETE or PROTECT.
    applyTo Property Map
    Defines which registries this rule applies to.
    criteria Property Map
    Cleanup criteria for the lifecycle rule.
    description String
    enabled Boolean
    Whether the rule is enabled.
    filterConfig Property Map
    Package-type-specific filter configuration.
    name String
    Name of the lifecycle rule.
    orgId String
    Organization identifier. Required for org-scoped rules.
    packageType String
    Package type the rule applies to (e.g. DOCKER, MAVEN, HELM).
    projectId String
    Project identifier. Required for project-scoped rules.
    schedule Property Map
    Cron schedule for automatic execution of the rule.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the HarLifecycleRule resource produces the following output properties:

    CreatedAt int
    Timestamp when the rule was created (milliseconds since epoch).
    Id string
    The provider-assigned unique ID for this managed resource.
    LastRunAt int
    Timestamp of the last execution (milliseconds since epoch).
    NextRunAt int
    Timestamp of the next scheduled execution (milliseconds since epoch).
    RuleId string
    Unique ID of the lifecycle rule (returned by the API).
    UpdatedAt int
    Timestamp when the rule was last updated (milliseconds since epoch).
    CreatedAt int
    Timestamp when the rule was created (milliseconds since epoch).
    Id string
    The provider-assigned unique ID for this managed resource.
    LastRunAt int
    Timestamp of the last execution (milliseconds since epoch).
    NextRunAt int
    Timestamp of the next scheduled execution (milliseconds since epoch).
    RuleId string
    Unique ID of the lifecycle rule (returned by the API).
    UpdatedAt int
    Timestamp when the rule was last updated (milliseconds since epoch).
    created_at number
    Timestamp when the rule was created (milliseconds since epoch).
    id string
    The provider-assigned unique ID for this managed resource.
    last_run_at number
    Timestamp of the last execution (milliseconds since epoch).
    next_run_at number
    Timestamp of the next scheduled execution (milliseconds since epoch).
    rule_id string
    Unique ID of the lifecycle rule (returned by the API).
    updated_at number
    Timestamp when the rule was last updated (milliseconds since epoch).
    createdAt Integer
    Timestamp when the rule was created (milliseconds since epoch).
    id String
    The provider-assigned unique ID for this managed resource.
    lastRunAt Integer
    Timestamp of the last execution (milliseconds since epoch).
    nextRunAt Integer
    Timestamp of the next scheduled execution (milliseconds since epoch).
    ruleId String
    Unique ID of the lifecycle rule (returned by the API).
    updatedAt Integer
    Timestamp when the rule was last updated (milliseconds since epoch).
    createdAt number
    Timestamp when the rule was created (milliseconds since epoch).
    id string
    The provider-assigned unique ID for this managed resource.
    lastRunAt number
    Timestamp of the last execution (milliseconds since epoch).
    nextRunAt number
    Timestamp of the next scheduled execution (milliseconds since epoch).
    ruleId string
    Unique ID of the lifecycle rule (returned by the API).
    updatedAt number
    Timestamp when the rule was last updated (milliseconds since epoch).
    created_at int
    Timestamp when the rule was created (milliseconds since epoch).
    id str
    The provider-assigned unique ID for this managed resource.
    last_run_at int
    Timestamp of the last execution (milliseconds since epoch).
    next_run_at int
    Timestamp of the next scheduled execution (milliseconds since epoch).
    rule_id str
    Unique ID of the lifecycle rule (returned by the API).
    updated_at int
    Timestamp when the rule was last updated (milliseconds since epoch).
    createdAt Number
    Timestamp when the rule was created (milliseconds since epoch).
    id String
    The provider-assigned unique ID for this managed resource.
    lastRunAt Number
    Timestamp of the last execution (milliseconds since epoch).
    nextRunAt Number
    Timestamp of the next scheduled execution (milliseconds since epoch).
    ruleId String
    Unique ID of the lifecycle rule (returned by the API).
    updatedAt Number
    Timestamp when the rule was last updated (milliseconds since epoch).

    Look up Existing HarLifecycleRule Resource

    Get an existing HarLifecycleRule 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?: HarLifecycleRuleState, opts?: CustomResourceOptions): HarLifecycleRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            action: Optional[str] = None,
            apply_to: Optional[HarLifecycleRuleApplyToArgs] = None,
            created_at: Optional[int] = None,
            criteria: Optional[HarLifecycleRuleCriteriaArgs] = None,
            description: Optional[str] = None,
            enabled: Optional[bool] = None,
            filter_config: Optional[HarLifecycleRuleFilterConfigArgs] = None,
            last_run_at: Optional[int] = None,
            name: Optional[str] = None,
            next_run_at: Optional[int] = None,
            org_id: Optional[str] = None,
            package_type: Optional[str] = None,
            project_id: Optional[str] = None,
            rule_id: Optional[str] = None,
            schedule: Optional[HarLifecycleRuleScheduleArgs] = None,
            updated_at: Optional[int] = None) -> HarLifecycleRule
    func GetHarLifecycleRule(ctx *Context, name string, id IDInput, state *HarLifecycleRuleState, opts ...ResourceOption) (*HarLifecycleRule, error)
    public static HarLifecycleRule Get(string name, Input<string> id, HarLifecycleRuleState? state, CustomResourceOptions? opts = null)
    public static HarLifecycleRule get(String name, Output<String> id, HarLifecycleRuleState state, CustomResourceOptions options)
    resources:  _:    type: harness:platform:HarLifecycleRule    get:      id: ${id}
    import {
      to = harness_platform_harlifecyclerule.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.
    The following state arguments are supported:
    AccountId string
    Account identifier for the lifecycle rule.
    Action string
    Action to perform: DELETE or PROTECT.
    ApplyTo HarLifecycleRuleApplyTo
    Defines which registries this rule applies to.
    CreatedAt int
    Timestamp when the rule was created (milliseconds since epoch).
    Criteria HarLifecycleRuleCriteria
    Cleanup criteria for the lifecycle rule.
    Description string
    Enabled bool
    Whether the rule is enabled.
    FilterConfig HarLifecycleRuleFilterConfig
    Package-type-specific filter configuration.
    LastRunAt int
    Timestamp of the last execution (milliseconds since epoch).
    Name string
    Name of the lifecycle rule.
    NextRunAt int
    Timestamp of the next scheduled execution (milliseconds since epoch).
    OrgId string
    Organization identifier. Required for org-scoped rules.
    PackageType string
    Package type the rule applies to (e.g. DOCKER, MAVEN, HELM).
    ProjectId string
    Project identifier. Required for project-scoped rules.
    RuleId string
    Unique ID of the lifecycle rule (returned by the API).
    Schedule HarLifecycleRuleSchedule
    Cron schedule for automatic execution of the rule.
    UpdatedAt int
    Timestamp when the rule was last updated (milliseconds since epoch).
    AccountId string
    Account identifier for the lifecycle rule.
    Action string
    Action to perform: DELETE or PROTECT.
    ApplyTo HarLifecycleRuleApplyToArgs
    Defines which registries this rule applies to.
    CreatedAt int
    Timestamp when the rule was created (milliseconds since epoch).
    Criteria HarLifecycleRuleCriteriaArgs
    Cleanup criteria for the lifecycle rule.
    Description string
    Enabled bool
    Whether the rule is enabled.
    FilterConfig HarLifecycleRuleFilterConfigArgs
    Package-type-specific filter configuration.
    LastRunAt int
    Timestamp of the last execution (milliseconds since epoch).
    Name string
    Name of the lifecycle rule.
    NextRunAt int
    Timestamp of the next scheduled execution (milliseconds since epoch).
    OrgId string
    Organization identifier. Required for org-scoped rules.
    PackageType string
    Package type the rule applies to (e.g. DOCKER, MAVEN, HELM).
    ProjectId string
    Project identifier. Required for project-scoped rules.
    RuleId string
    Unique ID of the lifecycle rule (returned by the API).
    Schedule HarLifecycleRuleScheduleArgs
    Cron schedule for automatic execution of the rule.
    UpdatedAt int
    Timestamp when the rule was last updated (milliseconds since epoch).
    account_id string
    Account identifier for the lifecycle rule.
    action string
    Action to perform: DELETE or PROTECT.
    apply_to object
    Defines which registries this rule applies to.
    created_at number
    Timestamp when the rule was created (milliseconds since epoch).
    criteria object
    Cleanup criteria for the lifecycle rule.
    description string
    enabled bool
    Whether the rule is enabled.
    filter_config object
    Package-type-specific filter configuration.
    last_run_at number
    Timestamp of the last execution (milliseconds since epoch).
    name string
    Name of the lifecycle rule.
    next_run_at number
    Timestamp of the next scheduled execution (milliseconds since epoch).
    org_id string
    Organization identifier. Required for org-scoped rules.
    package_type string
    Package type the rule applies to (e.g. DOCKER, MAVEN, HELM).
    project_id string
    Project identifier. Required for project-scoped rules.
    rule_id string
    Unique ID of the lifecycle rule (returned by the API).
    schedule object
    Cron schedule for automatic execution of the rule.
    updated_at number
    Timestamp when the rule was last updated (milliseconds since epoch).
    accountId String
    Account identifier for the lifecycle rule.
    action String
    Action to perform: DELETE or PROTECT.
    applyTo HarLifecycleRuleApplyTo
    Defines which registries this rule applies to.
    createdAt Integer
    Timestamp when the rule was created (milliseconds since epoch).
    criteria HarLifecycleRuleCriteria
    Cleanup criteria for the lifecycle rule.
    description String
    enabled Boolean
    Whether the rule is enabled.
    filterConfig HarLifecycleRuleFilterConfig
    Package-type-specific filter configuration.
    lastRunAt Integer
    Timestamp of the last execution (milliseconds since epoch).
    name String
    Name of the lifecycle rule.
    nextRunAt Integer
    Timestamp of the next scheduled execution (milliseconds since epoch).
    orgId String
    Organization identifier. Required for org-scoped rules.
    packageType String
    Package type the rule applies to (e.g. DOCKER, MAVEN, HELM).
    projectId String
    Project identifier. Required for project-scoped rules.
    ruleId String
    Unique ID of the lifecycle rule (returned by the API).
    schedule HarLifecycleRuleSchedule
    Cron schedule for automatic execution of the rule.
    updatedAt Integer
    Timestamp when the rule was last updated (milliseconds since epoch).
    accountId string
    Account identifier for the lifecycle rule.
    action string
    Action to perform: DELETE or PROTECT.
    applyTo HarLifecycleRuleApplyTo
    Defines which registries this rule applies to.
    createdAt number
    Timestamp when the rule was created (milliseconds since epoch).
    criteria HarLifecycleRuleCriteria
    Cleanup criteria for the lifecycle rule.
    description string
    enabled boolean
    Whether the rule is enabled.
    filterConfig HarLifecycleRuleFilterConfig
    Package-type-specific filter configuration.
    lastRunAt number
    Timestamp of the last execution (milliseconds since epoch).
    name string
    Name of the lifecycle rule.
    nextRunAt number
    Timestamp of the next scheduled execution (milliseconds since epoch).
    orgId string
    Organization identifier. Required for org-scoped rules.
    packageType string
    Package type the rule applies to (e.g. DOCKER, MAVEN, HELM).
    projectId string
    Project identifier. Required for project-scoped rules.
    ruleId string
    Unique ID of the lifecycle rule (returned by the API).
    schedule HarLifecycleRuleSchedule
    Cron schedule for automatic execution of the rule.
    updatedAt number
    Timestamp when the rule was last updated (milliseconds since epoch).
    account_id str
    Account identifier for the lifecycle rule.
    action str
    Action to perform: DELETE or PROTECT.
    apply_to HarLifecycleRuleApplyToArgs
    Defines which registries this rule applies to.
    created_at int
    Timestamp when the rule was created (milliseconds since epoch).
    criteria HarLifecycleRuleCriteriaArgs
    Cleanup criteria for the lifecycle rule.
    description str
    enabled bool
    Whether the rule is enabled.
    filter_config HarLifecycleRuleFilterConfigArgs
    Package-type-specific filter configuration.
    last_run_at int
    Timestamp of the last execution (milliseconds since epoch).
    name str
    Name of the lifecycle rule.
    next_run_at int
    Timestamp of the next scheduled execution (milliseconds since epoch).
    org_id str
    Organization identifier. Required for org-scoped rules.
    package_type str
    Package type the rule applies to (e.g. DOCKER, MAVEN, HELM).
    project_id str
    Project identifier. Required for project-scoped rules.
    rule_id str
    Unique ID of the lifecycle rule (returned by the API).
    schedule HarLifecycleRuleScheduleArgs
    Cron schedule for automatic execution of the rule.
    updated_at int
    Timestamp when the rule was last updated (milliseconds since epoch).
    accountId String
    Account identifier for the lifecycle rule.
    action String
    Action to perform: DELETE or PROTECT.
    applyTo Property Map
    Defines which registries this rule applies to.
    createdAt Number
    Timestamp when the rule was created (milliseconds since epoch).
    criteria Property Map
    Cleanup criteria for the lifecycle rule.
    description String
    enabled Boolean
    Whether the rule is enabled.
    filterConfig Property Map
    Package-type-specific filter configuration.
    lastRunAt Number
    Timestamp of the last execution (milliseconds since epoch).
    name String
    Name of the lifecycle rule.
    nextRunAt Number
    Timestamp of the next scheduled execution (milliseconds since epoch).
    orgId String
    Organization identifier. Required for org-scoped rules.
    packageType String
    Package type the rule applies to (e.g. DOCKER, MAVEN, HELM).
    projectId String
    Project identifier. Required for project-scoped rules.
    ruleId String
    Unique ID of the lifecycle rule (returned by the API).
    schedule Property Map
    Cron schedule for automatic execution of the rule.
    updatedAt Number
    Timestamp when the rule was last updated (milliseconds since epoch).

    Supporting Types

    HarLifecycleRuleApplyTo, HarLifecycleRuleApplyToArgs

    Mode string
    Mode: ALLINSCOPE or EXPLICIT.
    Registries List<string>
    List of registry identifiers (required when mode=EXPLICIT).
    Mode string
    Mode: ALLINSCOPE or EXPLICIT.
    Registries []string
    List of registry identifiers (required when mode=EXPLICIT).
    mode string
    Mode: ALLINSCOPE or EXPLICIT.
    registries list(string)
    List of registry identifiers (required when mode=EXPLICIT).
    mode String
    Mode: ALLINSCOPE or EXPLICIT.
    registries List<String>
    List of registry identifiers (required when mode=EXPLICIT).
    mode string
    Mode: ALLINSCOPE or EXPLICIT.
    registries string[]
    List of registry identifiers (required when mode=EXPLICIT).
    mode str
    Mode: ALLINSCOPE or EXPLICIT.
    registries Sequence[str]
    List of registry identifiers (required when mode=EXPLICIT).
    mode String
    Mode: ALLINSCOPE or EXPLICIT.
    registries List<String>
    List of registry identifiers (required when mode=EXPLICIT).

    HarLifecycleRuleCriteria, HarLifecycleRuleCriteriaArgs

    Match string
    How criteria rules are combined: ALL or ANY.
    Rules List<HarLifecycleRuleCriteriaRule>
    List of individual criteria rules.
    Match string
    How criteria rules are combined: ALL or ANY.
    Rules []HarLifecycleRuleCriteriaRule
    List of individual criteria rules.
    match string
    How criteria rules are combined: ALL or ANY.
    rules list(object)
    List of individual criteria rules.
    match String
    How criteria rules are combined: ALL or ANY.
    rules List<HarLifecycleRuleCriteriaRule>
    List of individual criteria rules.
    match string
    How criteria rules are combined: ALL or ANY.
    rules HarLifecycleRuleCriteriaRule[]
    List of individual criteria rules.
    match str
    How criteria rules are combined: ALL or ANY.
    rules Sequence[HarLifecycleRuleCriteriaRule]
    List of individual criteria rules.
    match String
    How criteria rules are combined: ALL or ANY.
    rules List<Property Map>
    List of individual criteria rules.

    HarLifecycleRuleCriteriaRule, HarLifecycleRuleCriteriaRuleArgs

    Type string
    Criteria type: KEEPLASTN, AGEBASED, or UNUSEDFOR.
    Unit string
    Time unit for age/unused-for criteria: DAYS, MONTHS, or YEARS.
    Value int
    Numeric value for the criteria (e.g. number of versions, number of days).
    Type string
    Criteria type: KEEPLASTN, AGEBASED, or UNUSEDFOR.
    Unit string
    Time unit for age/unused-for criteria: DAYS, MONTHS, or YEARS.
    Value int
    Numeric value for the criteria (e.g. number of versions, number of days).
    type string
    Criteria type: KEEPLASTN, AGEBASED, or UNUSEDFOR.
    unit string
    Time unit for age/unused-for criteria: DAYS, MONTHS, or YEARS.
    value number
    Numeric value for the criteria (e.g. number of versions, number of days).
    type String
    Criteria type: KEEPLASTN, AGEBASED, or UNUSEDFOR.
    unit String
    Time unit for age/unused-for criteria: DAYS, MONTHS, or YEARS.
    value Integer
    Numeric value for the criteria (e.g. number of versions, number of days).
    type string
    Criteria type: KEEPLASTN, AGEBASED, or UNUSEDFOR.
    unit string
    Time unit for age/unused-for criteria: DAYS, MONTHS, or YEARS.
    value number
    Numeric value for the criteria (e.g. number of versions, number of days).
    type str
    Criteria type: KEEPLASTN, AGEBASED, or UNUSEDFOR.
    unit str
    Time unit for age/unused-for criteria: DAYS, MONTHS, or YEARS.
    value int
    Numeric value for the criteria (e.g. number of versions, number of days).
    type String
    Criteria type: KEEPLASTN, AGEBASED, or UNUSEDFOR.
    unit String
    Time unit for age/unused-for criteria: DAYS, MONTHS, or YEARS.
    value Number
    Numeric value for the criteria (e.g. number of versions, number of days).

    HarLifecycleRuleFilterConfig, HarLifecycleRuleFilterConfigArgs

    PackageType string
    Package type this filter applies to (e.g. DOCKER, MAVEN, HUGGINGFACE).
    DatasetAllowedPatterns List<string>
    Glob patterns for HuggingFace dataset names to include (HUGGINGFACE only).
    GroupIdAllowedPatterns List<string>
    Glob patterns for Maven group IDs to include (MAVEN only).
    ModelAllowedPatterns List<string>
    Glob patterns for HuggingFace model names to include (HUGGINGFACE only).
    PackageNameAllowedPatterns List<string>
    Glob patterns for package/image names to include.
    TagNameAllowedPatterns List<string>
    Glob patterns for Docker tag names to include (DOCKER only).
    VersionNameAllowedPatterns List<string>
    Glob patterns for version/tag names to include.
    PackageType string
    Package type this filter applies to (e.g. DOCKER, MAVEN, HUGGINGFACE).
    DatasetAllowedPatterns []string
    Glob patterns for HuggingFace dataset names to include (HUGGINGFACE only).
    GroupIdAllowedPatterns []string
    Glob patterns for Maven group IDs to include (MAVEN only).
    ModelAllowedPatterns []string
    Glob patterns for HuggingFace model names to include (HUGGINGFACE only).
    PackageNameAllowedPatterns []string
    Glob patterns for package/image names to include.
    TagNameAllowedPatterns []string
    Glob patterns for Docker tag names to include (DOCKER only).
    VersionNameAllowedPatterns []string
    Glob patterns for version/tag names to include.
    package_type string
    Package type this filter applies to (e.g. DOCKER, MAVEN, HUGGINGFACE).
    dataset_allowed_patterns list(string)
    Glob patterns for HuggingFace dataset names to include (HUGGINGFACE only).
    group_id_allowed_patterns list(string)
    Glob patterns for Maven group IDs to include (MAVEN only).
    model_allowed_patterns list(string)
    Glob patterns for HuggingFace model names to include (HUGGINGFACE only).
    package_name_allowed_patterns list(string)
    Glob patterns for package/image names to include.
    tag_name_allowed_patterns list(string)
    Glob patterns for Docker tag names to include (DOCKER only).
    version_name_allowed_patterns list(string)
    Glob patterns for version/tag names to include.
    packageType String
    Package type this filter applies to (e.g. DOCKER, MAVEN, HUGGINGFACE).
    datasetAllowedPatterns List<String>
    Glob patterns for HuggingFace dataset names to include (HUGGINGFACE only).
    groupIdAllowedPatterns List<String>
    Glob patterns for Maven group IDs to include (MAVEN only).
    modelAllowedPatterns List<String>
    Glob patterns for HuggingFace model names to include (HUGGINGFACE only).
    packageNameAllowedPatterns List<String>
    Glob patterns for package/image names to include.
    tagNameAllowedPatterns List<String>
    Glob patterns for Docker tag names to include (DOCKER only).
    versionNameAllowedPatterns List<String>
    Glob patterns for version/tag names to include.
    packageType string
    Package type this filter applies to (e.g. DOCKER, MAVEN, HUGGINGFACE).
    datasetAllowedPatterns string[]
    Glob patterns for HuggingFace dataset names to include (HUGGINGFACE only).
    groupIdAllowedPatterns string[]
    Glob patterns for Maven group IDs to include (MAVEN only).
    modelAllowedPatterns string[]
    Glob patterns for HuggingFace model names to include (HUGGINGFACE only).
    packageNameAllowedPatterns string[]
    Glob patterns for package/image names to include.
    tagNameAllowedPatterns string[]
    Glob patterns for Docker tag names to include (DOCKER only).
    versionNameAllowedPatterns string[]
    Glob patterns for version/tag names to include.
    package_type str
    Package type this filter applies to (e.g. DOCKER, MAVEN, HUGGINGFACE).
    dataset_allowed_patterns Sequence[str]
    Glob patterns for HuggingFace dataset names to include (HUGGINGFACE only).
    group_id_allowed_patterns Sequence[str]
    Glob patterns for Maven group IDs to include (MAVEN only).
    model_allowed_patterns Sequence[str]
    Glob patterns for HuggingFace model names to include (HUGGINGFACE only).
    package_name_allowed_patterns Sequence[str]
    Glob patterns for package/image names to include.
    tag_name_allowed_patterns Sequence[str]
    Glob patterns for Docker tag names to include (DOCKER only).
    version_name_allowed_patterns Sequence[str]
    Glob patterns for version/tag names to include.
    packageType String
    Package type this filter applies to (e.g. DOCKER, MAVEN, HUGGINGFACE).
    datasetAllowedPatterns List<String>
    Glob patterns for HuggingFace dataset names to include (HUGGINGFACE only).
    groupIdAllowedPatterns List<String>
    Glob patterns for Maven group IDs to include (MAVEN only).
    modelAllowedPatterns List<String>
    Glob patterns for HuggingFace model names to include (HUGGINGFACE only).
    packageNameAllowedPatterns List<String>
    Glob patterns for package/image names to include.
    tagNameAllowedPatterns List<String>
    Glob patterns for Docker tag names to include (DOCKER only).
    versionNameAllowedPatterns List<String>
    Glob patterns for version/tag names to include.

    HarLifecycleRuleSchedule, HarLifecycleRuleScheduleArgs

    Expression string
    Cron expression (e.g. '0 2 * * *').
    Timezone string
    Timezone for the cron schedule (e.g. 'UTC', 'America/New_York').
    Expression string
    Cron expression (e.g. '0 2 * * *').
    Timezone string
    Timezone for the cron schedule (e.g. 'UTC', 'America/New_York').
    expression string
    Cron expression (e.g. '0 2 * * *').
    timezone string
    Timezone for the cron schedule (e.g. 'UTC', 'America/New_York').
    expression String
    Cron expression (e.g. '0 2 * * *').
    timezone String
    Timezone for the cron schedule (e.g. 'UTC', 'America/New_York').
    expression string
    Cron expression (e.g. '0 2 * * *').
    timezone string
    Timezone for the cron schedule (e.g. 'UTC', 'America/New_York').
    expression str
    Cron expression (e.g. '0 2 * * *').
    timezone str
    Timezone for the cron schedule (e.g. 'UTC', 'America/New_York').
    expression String
    Cron expression (e.g. '0 2 * * *').
    timezone String
    Timezone for the cron schedule (e.g. 'UTC', 'America/New_York').

    Import

    The pulumi import command can be used, for example:

    Account level: <account_id>/<rule_id>

    $ pulumi import harness:platform/harLifecycleRule:HarLifecycleRule example <account_id>/<rule_id>
    

    Org level: <account_id>/<org_id>/<rule_id>

    $ pulumi import harness:platform/harLifecycleRule:HarLifecycleRule example <account_id>/<org_id>/<rule_id>
    

    Project level: <account_id>/<org_id>/<project_id>/<rule_id>

    $ pulumi import harness:platform/harLifecycleRule:HarLifecycleRule example <account_id>/<org_id>/<project_id>/<rule_id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    harness pulumi/pulumi-harness
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the harness Terraform Provider.
    harness logo
    Viewing docs for Harness v0.15.2
    published on Saturday, Jul 18, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial