1. Packages
  2. Artifactory Provider
  3. API Docs
  4. PackageCleanupPolicy
artifactory v8.1.0 published on Saturday, Sep 28, 2024 by Pulumi

artifactory.PackageCleanupPolicy

Explore with Pulumi AI

artifactory logo
artifactory v8.1.0 published on Saturday, Sep 28, 2024 by Pulumi

    Provides an Artifactory Package Cleanup Policy resource. This resource enable system administrators to define and customize policies based on specific criteria for removing unused binaries from across their JFrog platform. See Rentation Policies for more details.

    ~>Currently in beta and not yet globally available. A full rollout is scheduled for early October 2024.

    Example Usage

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.artifactory.PackageCleanupPolicy;
    import com.pulumi.artifactory.PackageCleanupPolicyArgs;
    import com.pulumi.artifactory.inputs.PackageCleanupPolicySearchCriteriaArgs;
    import java.util.List;
    import java.util.ArrayList;
    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 my_cleanup_policy = new PackageCleanupPolicy("my-cleanup-policy", PackageCleanupPolicyArgs.builder()
                .key("my-policy")
                .description("My package cleanup policy")
                .cronExpression("0 0 2 ? * MON-SAT *")
                .durationInMinutes(60)
                .enabled(true)
                .skipTrashcan(false)
                .projectKey("myprojkey")
                .searchCriteria(PackageCleanupPolicySearchCriteriaArgs.builder()
                    .package_types(                
                        "docker",
                        "maven")
                    .repos(                
                        "my-docker-local",
                        "my-maven-local")
                    .excluded_repos("gradle-global")
                    .include_all_projects(false)
                    .included_projects()
                    .included_packages("com/jfrog")
                    .excluded_packages("com/jfrog/latest")
                    .created_before_in_months(1)
                    .last_downloaded_before_in_months(6)
                    .keep_last_n_versions(0)
                    .build())
                .build());
    
        }
    }
    
    resources:
      my-cleanup-policy:
        type: artifactory:PackageCleanupPolicy
        properties:
          key: my-policy
          description: My package cleanup policy
          cronExpression: 0 0 2 ? * MON-SAT *
          durationInMinutes: 60
          enabled: true
          skipTrashcan: false
          projectKey: myprojkey
          searchCriteria:
            package_types:
              - docker
              - maven
            repos:
              - my-docker-local
              - my-maven-local
            excluded_repos:
              - gradle-global
            include_all_projects: false
            included_projects: []
            included_packages:
              - com/jfrog
            excluded_packages:
              - com/jfrog/latest
            created_before_in_months: 1
            last_downloaded_before_in_months: 6
            keep_last_n_versions: 0
    

    Create PackageCleanupPolicy Resource

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

    Constructor syntax

    new PackageCleanupPolicy(name: string, args: PackageCleanupPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def PackageCleanupPolicy(resource_name: str,
                             args: PackageCleanupPolicyArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def PackageCleanupPolicy(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             key: Optional[str] = None,
                             search_criteria: Optional[PackageCleanupPolicySearchCriteriaArgs] = None,
                             cron_expression: Optional[str] = None,
                             description: Optional[str] = None,
                             duration_in_minutes: Optional[int] = None,
                             enabled: Optional[bool] = None,
                             project_key: Optional[str] = None,
                             skip_trashcan: Optional[bool] = None)
    func NewPackageCleanupPolicy(ctx *Context, name string, args PackageCleanupPolicyArgs, opts ...ResourceOption) (*PackageCleanupPolicy, error)
    public PackageCleanupPolicy(string name, PackageCleanupPolicyArgs args, CustomResourceOptions? opts = null)
    public PackageCleanupPolicy(String name, PackageCleanupPolicyArgs args)
    public PackageCleanupPolicy(String name, PackageCleanupPolicyArgs args, CustomResourceOptions options)
    
    type: artifactory:PackageCleanupPolicy
    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 PackageCleanupPolicyArgs
    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 PackageCleanupPolicyArgs
    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 PackageCleanupPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PackageCleanupPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PackageCleanupPolicyArgs
    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 packageCleanupPolicyResource = new Artifactory.PackageCleanupPolicy("packageCleanupPolicyResource", new()
    {
        Key = "string",
        SearchCriteria = new Artifactory.Inputs.PackageCleanupPolicySearchCriteriaArgs
        {
            IncludedPackages = new[]
            {
                "string",
            },
            PackageTypes = new[]
            {
                "string",
            },
            Repos = new[]
            {
                "string",
            },
            CreatedBeforeInMonths = 0,
            ExcludedPackages = new[]
            {
                "string",
            },
            ExcludedRepos = new[]
            {
                "string",
            },
            IncludeAllProjects = false,
            IncludedProjects = new[]
            {
                "string",
            },
            KeepLastNVersions = 0,
            LastDownloadedBeforeInMonths = 0,
        },
        CronExpression = "string",
        Description = "string",
        DurationInMinutes = 0,
        Enabled = false,
        ProjectKey = "string",
        SkipTrashcan = false,
    });
    
    example, err := artifactory.NewPackageCleanupPolicy(ctx, "packageCleanupPolicyResource", &artifactory.PackageCleanupPolicyArgs{
    	Key: pulumi.String("string"),
    	SearchCriteria: &artifactory.PackageCleanupPolicySearchCriteriaArgs{
    		IncludedPackages: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		PackageTypes: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		Repos: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		CreatedBeforeInMonths: pulumi.Int(0),
    		ExcludedPackages: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		ExcludedRepos: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		IncludeAllProjects: pulumi.Bool(false),
    		IncludedProjects: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		KeepLastNVersions:            pulumi.Int(0),
    		LastDownloadedBeforeInMonths: pulumi.Int(0),
    	},
    	CronExpression:    pulumi.String("string"),
    	Description:       pulumi.String("string"),
    	DurationInMinutes: pulumi.Int(0),
    	Enabled:           pulumi.Bool(false),
    	ProjectKey:        pulumi.String("string"),
    	SkipTrashcan:      pulumi.Bool(false),
    })
    
    var packageCleanupPolicyResource = new PackageCleanupPolicy("packageCleanupPolicyResource", PackageCleanupPolicyArgs.builder()
        .key("string")
        .searchCriteria(PackageCleanupPolicySearchCriteriaArgs.builder()
            .includedPackages("string")
            .packageTypes("string")
            .repos("string")
            .createdBeforeInMonths(0)
            .excludedPackages("string")
            .excludedRepos("string")
            .includeAllProjects(false)
            .includedProjects("string")
            .keepLastNVersions(0)
            .lastDownloadedBeforeInMonths(0)
            .build())
        .cronExpression("string")
        .description("string")
        .durationInMinutes(0)
        .enabled(false)
        .projectKey("string")
        .skipTrashcan(false)
        .build());
    
    package_cleanup_policy_resource = artifactory.PackageCleanupPolicy("packageCleanupPolicyResource",
        key="string",
        search_criteria=artifactory.PackageCleanupPolicySearchCriteriaArgs(
            included_packages=["string"],
            package_types=["string"],
            repos=["string"],
            created_before_in_months=0,
            excluded_packages=["string"],
            excluded_repos=["string"],
            include_all_projects=False,
            included_projects=["string"],
            keep_last_n_versions=0,
            last_downloaded_before_in_months=0,
        ),
        cron_expression="string",
        description="string",
        duration_in_minutes=0,
        enabled=False,
        project_key="string",
        skip_trashcan=False)
    
    const packageCleanupPolicyResource = new artifactory.PackageCleanupPolicy("packageCleanupPolicyResource", {
        key: "string",
        searchCriteria: {
            includedPackages: ["string"],
            packageTypes: ["string"],
            repos: ["string"],
            createdBeforeInMonths: 0,
            excludedPackages: ["string"],
            excludedRepos: ["string"],
            includeAllProjects: false,
            includedProjects: ["string"],
            keepLastNVersions: 0,
            lastDownloadedBeforeInMonths: 0,
        },
        cronExpression: "string",
        description: "string",
        durationInMinutes: 0,
        enabled: false,
        projectKey: "string",
        skipTrashcan: false,
    });
    
    type: artifactory:PackageCleanupPolicy
    properties:
        cronExpression: string
        description: string
        durationInMinutes: 0
        enabled: false
        key: string
        projectKey: string
        searchCriteria:
            createdBeforeInMonths: 0
            excludedPackages:
                - string
            excludedRepos:
                - string
            includeAllProjects: false
            includedPackages:
                - string
            includedProjects:
                - string
            keepLastNVersions: 0
            lastDownloadedBeforeInMonths: 0
            packageTypes:
                - string
            repos:
                - string
        skipTrashcan: false
    

    PackageCleanupPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The PackageCleanupPolicy resource accepts the following input properties:

    Key string
    Policy key. It has to be unique. It should not be used for other policies and configuration entities like archive policies, key pairs, repo layouts, property sets, backups, proxies, reverse proxies etc. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
    SearchCriteria PackageCleanupPolicySearchCriteria
    CronExpression string
    The Cron expression that sets the schedule of policy execution. For example, 0 0 2 * * ? executes the policy every day at 02:00 AM. The minimum recurrent time for policy execution is 6 hours.
    Description string
    DurationInMinutes int
    Enable and select the maximum duration for policy execution. Note: using this setting can cause the policy to stop before completion.
    Enabled bool
    Enables or disabled the package cleanup policy. This allows the user to run the policy manually. If a policy has a valid cron expression, then it will be scheduled for execution based on it. If a policy is disabled, its future executions will be unscheduled. Defaults to true
    ProjectKey string
    This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
    SkipTrashcan bool
    Enabling this setting results in packages being permanently deleted from Artifactory after the cleanup policy is executed instead of going to the Trash Can repository. Defaults to false.
    Key string
    Policy key. It has to be unique. It should not be used for other policies and configuration entities like archive policies, key pairs, repo layouts, property sets, backups, proxies, reverse proxies etc. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
    SearchCriteria PackageCleanupPolicySearchCriteriaArgs
    CronExpression string
    The Cron expression that sets the schedule of policy execution. For example, 0 0 2 * * ? executes the policy every day at 02:00 AM. The minimum recurrent time for policy execution is 6 hours.
    Description string
    DurationInMinutes int
    Enable and select the maximum duration for policy execution. Note: using this setting can cause the policy to stop before completion.
    Enabled bool
    Enables or disabled the package cleanup policy. This allows the user to run the policy manually. If a policy has a valid cron expression, then it will be scheduled for execution based on it. If a policy is disabled, its future executions will be unscheduled. Defaults to true
    ProjectKey string
    This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
    SkipTrashcan bool
    Enabling this setting results in packages being permanently deleted from Artifactory after the cleanup policy is executed instead of going to the Trash Can repository. Defaults to false.
    key String
    Policy key. It has to be unique. It should not be used for other policies and configuration entities like archive policies, key pairs, repo layouts, property sets, backups, proxies, reverse proxies etc. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
    searchCriteria PackageCleanupPolicySearchCriteria
    cronExpression String
    The Cron expression that sets the schedule of policy execution. For example, 0 0 2 * * ? executes the policy every day at 02:00 AM. The minimum recurrent time for policy execution is 6 hours.
    description String
    durationInMinutes Integer
    Enable and select the maximum duration for policy execution. Note: using this setting can cause the policy to stop before completion.
    enabled Boolean
    Enables or disabled the package cleanup policy. This allows the user to run the policy manually. If a policy has a valid cron expression, then it will be scheduled for execution based on it. If a policy is disabled, its future executions will be unscheduled. Defaults to true
    projectKey String
    This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
    skipTrashcan Boolean
    Enabling this setting results in packages being permanently deleted from Artifactory after the cleanup policy is executed instead of going to the Trash Can repository. Defaults to false.
    key string
    Policy key. It has to be unique. It should not be used for other policies and configuration entities like archive policies, key pairs, repo layouts, property sets, backups, proxies, reverse proxies etc. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
    searchCriteria PackageCleanupPolicySearchCriteria
    cronExpression string
    The Cron expression that sets the schedule of policy execution. For example, 0 0 2 * * ? executes the policy every day at 02:00 AM. The minimum recurrent time for policy execution is 6 hours.
    description string
    durationInMinutes number
    Enable and select the maximum duration for policy execution. Note: using this setting can cause the policy to stop before completion.
    enabled boolean
    Enables or disabled the package cleanup policy. This allows the user to run the policy manually. If a policy has a valid cron expression, then it will be scheduled for execution based on it. If a policy is disabled, its future executions will be unscheduled. Defaults to true
    projectKey string
    This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
    skipTrashcan boolean
    Enabling this setting results in packages being permanently deleted from Artifactory after the cleanup policy is executed instead of going to the Trash Can repository. Defaults to false.
    key str
    Policy key. It has to be unique. It should not be used for other policies and configuration entities like archive policies, key pairs, repo layouts, property sets, backups, proxies, reverse proxies etc. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
    search_criteria PackageCleanupPolicySearchCriteriaArgs
    cron_expression str
    The Cron expression that sets the schedule of policy execution. For example, 0 0 2 * * ? executes the policy every day at 02:00 AM. The minimum recurrent time for policy execution is 6 hours.
    description str
    duration_in_minutes int
    Enable and select the maximum duration for policy execution. Note: using this setting can cause the policy to stop before completion.
    enabled bool
    Enables or disabled the package cleanup policy. This allows the user to run the policy manually. If a policy has a valid cron expression, then it will be scheduled for execution based on it. If a policy is disabled, its future executions will be unscheduled. Defaults to true
    project_key str
    This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
    skip_trashcan bool
    Enabling this setting results in packages being permanently deleted from Artifactory after the cleanup policy is executed instead of going to the Trash Can repository. Defaults to false.
    key String
    Policy key. It has to be unique. It should not be used for other policies and configuration entities like archive policies, key pairs, repo layouts, property sets, backups, proxies, reverse proxies etc. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
    searchCriteria Property Map
    cronExpression String
    The Cron expression that sets the schedule of policy execution. For example, 0 0 2 * * ? executes the policy every day at 02:00 AM. The minimum recurrent time for policy execution is 6 hours.
    description String
    durationInMinutes Number
    Enable and select the maximum duration for policy execution. Note: using this setting can cause the policy to stop before completion.
    enabled Boolean
    Enables or disabled the package cleanup policy. This allows the user to run the policy manually. If a policy has a valid cron expression, then it will be scheduled for execution based on it. If a policy is disabled, its future executions will be unscheduled. Defaults to true
    projectKey String
    This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
    skipTrashcan Boolean
    Enabling this setting results in packages being permanently deleted from Artifactory after the cleanup policy is executed instead of going to the Trash Can repository. Defaults to false.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PackageCleanupPolicy Resource

    Get an existing PackageCleanupPolicy 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?: PackageCleanupPolicyState, opts?: CustomResourceOptions): PackageCleanupPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cron_expression: Optional[str] = None,
            description: Optional[str] = None,
            duration_in_minutes: Optional[int] = None,
            enabled: Optional[bool] = None,
            key: Optional[str] = None,
            project_key: Optional[str] = None,
            search_criteria: Optional[PackageCleanupPolicySearchCriteriaArgs] = None,
            skip_trashcan: Optional[bool] = None) -> PackageCleanupPolicy
    func GetPackageCleanupPolicy(ctx *Context, name string, id IDInput, state *PackageCleanupPolicyState, opts ...ResourceOption) (*PackageCleanupPolicy, error)
    public static PackageCleanupPolicy Get(string name, Input<string> id, PackageCleanupPolicyState? state, CustomResourceOptions? opts = null)
    public static PackageCleanupPolicy get(String name, Output<String> id, PackageCleanupPolicyState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    CronExpression string
    The Cron expression that sets the schedule of policy execution. For example, 0 0 2 * * ? executes the policy every day at 02:00 AM. The minimum recurrent time for policy execution is 6 hours.
    Description string
    DurationInMinutes int
    Enable and select the maximum duration for policy execution. Note: using this setting can cause the policy to stop before completion.
    Enabled bool
    Enables or disabled the package cleanup policy. This allows the user to run the policy manually. If a policy has a valid cron expression, then it will be scheduled for execution based on it. If a policy is disabled, its future executions will be unscheduled. Defaults to true
    Key string
    Policy key. It has to be unique. It should not be used for other policies and configuration entities like archive policies, key pairs, repo layouts, property sets, backups, proxies, reverse proxies etc. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
    ProjectKey string
    This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
    SearchCriteria PackageCleanupPolicySearchCriteria
    SkipTrashcan bool
    Enabling this setting results in packages being permanently deleted from Artifactory after the cleanup policy is executed instead of going to the Trash Can repository. Defaults to false.
    CronExpression string
    The Cron expression that sets the schedule of policy execution. For example, 0 0 2 * * ? executes the policy every day at 02:00 AM. The minimum recurrent time for policy execution is 6 hours.
    Description string
    DurationInMinutes int
    Enable and select the maximum duration for policy execution. Note: using this setting can cause the policy to stop before completion.
    Enabled bool
    Enables or disabled the package cleanup policy. This allows the user to run the policy manually. If a policy has a valid cron expression, then it will be scheduled for execution based on it. If a policy is disabled, its future executions will be unscheduled. Defaults to true
    Key string
    Policy key. It has to be unique. It should not be used for other policies and configuration entities like archive policies, key pairs, repo layouts, property sets, backups, proxies, reverse proxies etc. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
    ProjectKey string
    This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
    SearchCriteria PackageCleanupPolicySearchCriteriaArgs
    SkipTrashcan bool
    Enabling this setting results in packages being permanently deleted from Artifactory after the cleanup policy is executed instead of going to the Trash Can repository. Defaults to false.
    cronExpression String
    The Cron expression that sets the schedule of policy execution. For example, 0 0 2 * * ? executes the policy every day at 02:00 AM. The minimum recurrent time for policy execution is 6 hours.
    description String
    durationInMinutes Integer
    Enable and select the maximum duration for policy execution. Note: using this setting can cause the policy to stop before completion.
    enabled Boolean
    Enables or disabled the package cleanup policy. This allows the user to run the policy manually. If a policy has a valid cron expression, then it will be scheduled for execution based on it. If a policy is disabled, its future executions will be unscheduled. Defaults to true
    key String
    Policy key. It has to be unique. It should not be used for other policies and configuration entities like archive policies, key pairs, repo layouts, property sets, backups, proxies, reverse proxies etc. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
    projectKey String
    This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
    searchCriteria PackageCleanupPolicySearchCriteria
    skipTrashcan Boolean
    Enabling this setting results in packages being permanently deleted from Artifactory after the cleanup policy is executed instead of going to the Trash Can repository. Defaults to false.
    cronExpression string
    The Cron expression that sets the schedule of policy execution. For example, 0 0 2 * * ? executes the policy every day at 02:00 AM. The minimum recurrent time for policy execution is 6 hours.
    description string
    durationInMinutes number
    Enable and select the maximum duration for policy execution. Note: using this setting can cause the policy to stop before completion.
    enabled boolean
    Enables or disabled the package cleanup policy. This allows the user to run the policy manually. If a policy has a valid cron expression, then it will be scheduled for execution based on it. If a policy is disabled, its future executions will be unscheduled. Defaults to true
    key string
    Policy key. It has to be unique. It should not be used for other policies and configuration entities like archive policies, key pairs, repo layouts, property sets, backups, proxies, reverse proxies etc. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
    projectKey string
    This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
    searchCriteria PackageCleanupPolicySearchCriteria
    skipTrashcan boolean
    Enabling this setting results in packages being permanently deleted from Artifactory after the cleanup policy is executed instead of going to the Trash Can repository. Defaults to false.
    cron_expression str
    The Cron expression that sets the schedule of policy execution. For example, 0 0 2 * * ? executes the policy every day at 02:00 AM. The minimum recurrent time for policy execution is 6 hours.
    description str
    duration_in_minutes int
    Enable and select the maximum duration for policy execution. Note: using this setting can cause the policy to stop before completion.
    enabled bool
    Enables or disabled the package cleanup policy. This allows the user to run the policy manually. If a policy has a valid cron expression, then it will be scheduled for execution based on it. If a policy is disabled, its future executions will be unscheduled. Defaults to true
    key str
    Policy key. It has to be unique. It should not be used for other policies and configuration entities like archive policies, key pairs, repo layouts, property sets, backups, proxies, reverse proxies etc. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
    project_key str
    This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
    search_criteria PackageCleanupPolicySearchCriteriaArgs
    skip_trashcan bool
    Enabling this setting results in packages being permanently deleted from Artifactory after the cleanup policy is executed instead of going to the Trash Can repository. Defaults to false.
    cronExpression String
    The Cron expression that sets the schedule of policy execution. For example, 0 0 2 * * ? executes the policy every day at 02:00 AM. The minimum recurrent time for policy execution is 6 hours.
    description String
    durationInMinutes Number
    Enable and select the maximum duration for policy execution. Note: using this setting can cause the policy to stop before completion.
    enabled Boolean
    Enables or disabled the package cleanup policy. This allows the user to run the policy manually. If a policy has a valid cron expression, then it will be scheduled for execution based on it. If a policy is disabled, its future executions will be unscheduled. Defaults to true
    key String
    Policy key. It has to be unique. It should not be used for other policies and configuration entities like archive policies, key pairs, repo layouts, property sets, backups, proxies, reverse proxies etc. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
    projectKey String
    This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
    searchCriteria Property Map
    skipTrashcan Boolean
    Enabling this setting results in packages being permanently deleted from Artifactory after the cleanup policy is executed instead of going to the Trash Can repository. Defaults to false.

    Supporting Types

    PackageCleanupPolicySearchCriteria, PackageCleanupPolicySearchCriteriaArgs

    IncludedPackages List<string>
    Specify a pattern for a package name or an explicit package name. It accept only single element which can be specific package or pattern, and for including all packages use **. Example: included_packages = ["**"]
    PackageTypes List<string>
    Types of packages to be removed. Support: conan, docker, generic, gradle, maven, npm, nuget, rpm.
    Repos List<string>
    Specify patterns for repository names or explicit repository names. For including all repos use **. Example: repos = ["**"]
    CreatedBeforeInMonths int
    Remove packages based on when they were created. For example, remove packages that were created more than a year ago. The default value is to remove packages created more than 2 years ago.
    ExcludedPackages List<string>
    Specify explicit package names that you want excluded from the policy. Only Name explicit names (and not patterns) are accepted.
    ExcludedRepos List<string>
    Specify patterns for repository names or explicit repository names that you want excluded from the cleanup policy.
    IncludeAllProjects bool
    Set this to true if you want the policy to run on all projects on the platform.
    IncludedProjects List<string>
    List of projects on which you want this policy to run. To include repositories that are not assigned to any project, enter the project key default.
    KeepLastNVersions int

    Select the number of latest versions to keep. The cleanup policy will remove all versions prior to the number you select here. The latest version is always excluded. Versions are determined by creation date.

    ~>Not all package types support this condition. For information on which package types support this condition, learn more.

    LastDownloadedBeforeInMonths int

    Removes packages based on when they were last downloaded. For example, removes packages that were not downloaded in the past year. The default value is to remove packages that were downloaded more than 2 years ago.

    ~>If a package was never downloaded, the policy will remove it based only on the age-condition (created_before_in_months).

    ~>JFrog recommends using the last_downloaded_before_in_months condition to ensure that packages currently in use are not deleted.

    IncludedPackages []string
    Specify a pattern for a package name or an explicit package name. It accept only single element which can be specific package or pattern, and for including all packages use **. Example: included_packages = ["**"]
    PackageTypes []string
    Types of packages to be removed. Support: conan, docker, generic, gradle, maven, npm, nuget, rpm.
    Repos []string
    Specify patterns for repository names or explicit repository names. For including all repos use **. Example: repos = ["**"]
    CreatedBeforeInMonths int
    Remove packages based on when they were created. For example, remove packages that were created more than a year ago. The default value is to remove packages created more than 2 years ago.
    ExcludedPackages []string
    Specify explicit package names that you want excluded from the policy. Only Name explicit names (and not patterns) are accepted.
    ExcludedRepos []string
    Specify patterns for repository names or explicit repository names that you want excluded from the cleanup policy.
    IncludeAllProjects bool
    Set this to true if you want the policy to run on all projects on the platform.
    IncludedProjects []string
    List of projects on which you want this policy to run. To include repositories that are not assigned to any project, enter the project key default.
    KeepLastNVersions int

    Select the number of latest versions to keep. The cleanup policy will remove all versions prior to the number you select here. The latest version is always excluded. Versions are determined by creation date.

    ~>Not all package types support this condition. For information on which package types support this condition, learn more.

    LastDownloadedBeforeInMonths int

    Removes packages based on when they were last downloaded. For example, removes packages that were not downloaded in the past year. The default value is to remove packages that were downloaded more than 2 years ago.

    ~>If a package was never downloaded, the policy will remove it based only on the age-condition (created_before_in_months).

    ~>JFrog recommends using the last_downloaded_before_in_months condition to ensure that packages currently in use are not deleted.

    includedPackages List<String>
    Specify a pattern for a package name or an explicit package name. It accept only single element which can be specific package or pattern, and for including all packages use **. Example: included_packages = ["**"]
    packageTypes List<String>
    Types of packages to be removed. Support: conan, docker, generic, gradle, maven, npm, nuget, rpm.
    repos List<String>
    Specify patterns for repository names or explicit repository names. For including all repos use **. Example: repos = ["**"]
    createdBeforeInMonths Integer
    Remove packages based on when they were created. For example, remove packages that were created more than a year ago. The default value is to remove packages created more than 2 years ago.
    excludedPackages List<String>
    Specify explicit package names that you want excluded from the policy. Only Name explicit names (and not patterns) are accepted.
    excludedRepos List<String>
    Specify patterns for repository names or explicit repository names that you want excluded from the cleanup policy.
    includeAllProjects Boolean
    Set this to true if you want the policy to run on all projects on the platform.
    includedProjects List<String>
    List of projects on which you want this policy to run. To include repositories that are not assigned to any project, enter the project key default.
    keepLastNVersions Integer

    Select the number of latest versions to keep. The cleanup policy will remove all versions prior to the number you select here. The latest version is always excluded. Versions are determined by creation date.

    ~>Not all package types support this condition. For information on which package types support this condition, learn more.

    lastDownloadedBeforeInMonths Integer

    Removes packages based on when they were last downloaded. For example, removes packages that were not downloaded in the past year. The default value is to remove packages that were downloaded more than 2 years ago.

    ~>If a package was never downloaded, the policy will remove it based only on the age-condition (created_before_in_months).

    ~>JFrog recommends using the last_downloaded_before_in_months condition to ensure that packages currently in use are not deleted.

    includedPackages string[]
    Specify a pattern for a package name or an explicit package name. It accept only single element which can be specific package or pattern, and for including all packages use **. Example: included_packages = ["**"]
    packageTypes string[]
    Types of packages to be removed. Support: conan, docker, generic, gradle, maven, npm, nuget, rpm.
    repos string[]
    Specify patterns for repository names or explicit repository names. For including all repos use **. Example: repos = ["**"]
    createdBeforeInMonths number
    Remove packages based on when they were created. For example, remove packages that were created more than a year ago. The default value is to remove packages created more than 2 years ago.
    excludedPackages string[]
    Specify explicit package names that you want excluded from the policy. Only Name explicit names (and not patterns) are accepted.
    excludedRepos string[]
    Specify patterns for repository names or explicit repository names that you want excluded from the cleanup policy.
    includeAllProjects boolean
    Set this to true if you want the policy to run on all projects on the platform.
    includedProjects string[]
    List of projects on which you want this policy to run. To include repositories that are not assigned to any project, enter the project key default.
    keepLastNVersions number

    Select the number of latest versions to keep. The cleanup policy will remove all versions prior to the number you select here. The latest version is always excluded. Versions are determined by creation date.

    ~>Not all package types support this condition. For information on which package types support this condition, learn more.

    lastDownloadedBeforeInMonths number

    Removes packages based on when they were last downloaded. For example, removes packages that were not downloaded in the past year. The default value is to remove packages that were downloaded more than 2 years ago.

    ~>If a package was never downloaded, the policy will remove it based only on the age-condition (created_before_in_months).

    ~>JFrog recommends using the last_downloaded_before_in_months condition to ensure that packages currently in use are not deleted.

    included_packages Sequence[str]
    Specify a pattern for a package name or an explicit package name. It accept only single element which can be specific package or pattern, and for including all packages use **. Example: included_packages = ["**"]
    package_types Sequence[str]
    Types of packages to be removed. Support: conan, docker, generic, gradle, maven, npm, nuget, rpm.
    repos Sequence[str]
    Specify patterns for repository names or explicit repository names. For including all repos use **. Example: repos = ["**"]
    created_before_in_months int
    Remove packages based on when they were created. For example, remove packages that were created more than a year ago. The default value is to remove packages created more than 2 years ago.
    excluded_packages Sequence[str]
    Specify explicit package names that you want excluded from the policy. Only Name explicit names (and not patterns) are accepted.
    excluded_repos Sequence[str]
    Specify patterns for repository names or explicit repository names that you want excluded from the cleanup policy.
    include_all_projects bool
    Set this to true if you want the policy to run on all projects on the platform.
    included_projects Sequence[str]
    List of projects on which you want this policy to run. To include repositories that are not assigned to any project, enter the project key default.
    keep_last_n_versions int

    Select the number of latest versions to keep. The cleanup policy will remove all versions prior to the number you select here. The latest version is always excluded. Versions are determined by creation date.

    ~>Not all package types support this condition. For information on which package types support this condition, learn more.

    last_downloaded_before_in_months int

    Removes packages based on when they were last downloaded. For example, removes packages that were not downloaded in the past year. The default value is to remove packages that were downloaded more than 2 years ago.

    ~>If a package was never downloaded, the policy will remove it based only on the age-condition (created_before_in_months).

    ~>JFrog recommends using the last_downloaded_before_in_months condition to ensure that packages currently in use are not deleted.

    includedPackages List<String>
    Specify a pattern for a package name or an explicit package name. It accept only single element which can be specific package or pattern, and for including all packages use **. Example: included_packages = ["**"]
    packageTypes List<String>
    Types of packages to be removed. Support: conan, docker, generic, gradle, maven, npm, nuget, rpm.
    repos List<String>
    Specify patterns for repository names or explicit repository names. For including all repos use **. Example: repos = ["**"]
    createdBeforeInMonths Number
    Remove packages based on when they were created. For example, remove packages that were created more than a year ago. The default value is to remove packages created more than 2 years ago.
    excludedPackages List<String>
    Specify explicit package names that you want excluded from the policy. Only Name explicit names (and not patterns) are accepted.
    excludedRepos List<String>
    Specify patterns for repository names or explicit repository names that you want excluded from the cleanup policy.
    includeAllProjects Boolean
    Set this to true if you want the policy to run on all projects on the platform.
    includedProjects List<String>
    List of projects on which you want this policy to run. To include repositories that are not assigned to any project, enter the project key default.
    keepLastNVersions Number

    Select the number of latest versions to keep. The cleanup policy will remove all versions prior to the number you select here. The latest version is always excluded. Versions are determined by creation date.

    ~>Not all package types support this condition. For information on which package types support this condition, learn more.

    lastDownloadedBeforeInMonths Number

    Removes packages based on when they were last downloaded. For example, removes packages that were not downloaded in the past year. The default value is to remove packages that were downloaded more than 2 years ago.

    ~>If a package was never downloaded, the policy will remove it based only on the age-condition (created_before_in_months).

    ~>JFrog recommends using the last_downloaded_before_in_months condition to ensure that packages currently in use are not deleted.

    Import

    $ pulumi import artifactory:index/packageCleanupPolicy:PackageCleanupPolicy my-cleanup-policy my-policy
    
    $ pulumi import artifactory:index/packageCleanupPolicy:PackageCleanupPolicy my-cleanup-policy my-policy:myproj
    

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

    Package Details

    Repository
    artifactory pulumi/pulumi-artifactory
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the artifactory Terraform Provider.
    artifactory logo
    artifactory v8.1.0 published on Saturday, Sep 28, 2024 by Pulumi