artifactory.PackageCleanupPolicy
Explore with Pulumi AI
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 will be globally available in v7.98.x.
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={
"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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
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.
- Search
Criteria PackageCleanup Policy Search Criteria - Cron
Expression 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
- Duration
In intMinutes - 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 string - 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.
- Search
Criteria PackageCleanup Policy Search Criteria Args - Cron
Expression 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
- Duration
In intMinutes - 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 string - 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.
- search
Criteria PackageCleanup Policy Search Criteria - cron
Expression 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
- duration
In IntegerMinutes - 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
- project
Key String - This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
- skip
Trashcan 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.
- search
Criteria PackageCleanup Policy Search Criteria - cron
Expression 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
- duration
In numberMinutes - 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
- project
Key string - This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
- skip
Trashcan 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 PackageCleanup Policy Search Criteria Args - 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_ intminutes - 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.
- search
Criteria Property Map - cron
Expression 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
- duration
In NumberMinutes - 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
- project
Key String - This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
- skip
Trashcan 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.
- Cron
Expression 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
- Duration
In intMinutes - 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.
- Project
Key string - This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
- Search
Criteria PackageCleanup Policy Search Criteria - 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
.
- Cron
Expression 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
- Duration
In intMinutes - 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.
- Project
Key string - This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
- Search
Criteria PackageCleanup Policy Search Criteria Args - 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
.
- cron
Expression 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
- duration
In IntegerMinutes - 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.
- project
Key String - This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
- search
Criteria PackageCleanup Policy Search Criteria - skip
Trashcan 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 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
- duration
In numberMinutes - 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.
- project
Key string - This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
- search
Criteria PackageCleanup Policy Search Criteria - skip
Trashcan 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_ intminutes - 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 PackageCleanup Policy Search Criteria Args - 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
.
- cron
Expression 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
- duration
In NumberMinutes - 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.
- project
Key String - This attribute is used only for project-level cleanup policies, it is not used for global-level policies.
- search
Criteria Property Map - skip
Trashcan 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
- Included
Packages 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 = ["**"]
- Package
Types List<string> - Types of packages to be removed. Support: conan, debian, docker, gems, generic, go, gradle, helm, maven, npm, nuget, pypi, yum.
- Repos List<string>
- Specify patterns for repository names or explicit repository names. For including all repos use
**
. Example:repos = ["**"]
- Created
Before intIn Months - 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 List<string> - Specify explicit package names that you want excluded from the policy. Only Name explicit names (and not patterns) are accepted.
- Excluded
Repos List<string> - Specify patterns for repository names or explicit repository names that you want excluded from the cleanup policy.
- Include
All boolProjects - Set this to
true
if you want the policy to run on all projects on the platform. - Included
Projects 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
. - Keep
Last intNVersions 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 intBefore In Months 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 []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 = ["**"]
- Package
Types []string - Types of packages to be removed. Support: conan, debian, docker, gems, generic, go, gradle, helm, maven, npm, nuget, pypi, yum.
- Repos []string
- Specify patterns for repository names or explicit repository names. For including all repos use
**
. Example:repos = ["**"]
- Created
Before intIn Months - 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 []string - Specify explicit package names that you want excluded from the policy. Only Name explicit names (and not patterns) are accepted.
- Excluded
Repos []string - Specify patterns for repository names or explicit repository names that you want excluded from the cleanup policy.
- Include
All boolProjects - Set this to
true
if you want the policy to run on all projects on the platform. - Included
Projects []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
. - Keep
Last intNVersions 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 intBefore In Months 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 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 = ["**"]
- package
Types List<String> - Types of packages to be removed. Support: conan, debian, docker, gems, generic, go, gradle, helm, maven, npm, nuget, pypi, yum.
- repos List<String>
- Specify patterns for repository names or explicit repository names. For including all repos use
**
. Example:repos = ["**"]
- created
Before IntegerIn Months - 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 List<String> - Specify explicit package names that you want excluded from the policy. Only Name explicit names (and not patterns) are accepted.
- excluded
Repos List<String> - Specify patterns for repository names or explicit repository names that you want excluded from the cleanup policy.
- include
All BooleanProjects - Set this to
true
if you want the policy to run on all projects on the platform. - included
Projects 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
. - keep
Last IntegerNVersions 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 IntegerBefore In Months 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 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 = ["**"]
- package
Types string[] - Types of packages to be removed. Support: conan, debian, docker, gems, generic, go, gradle, helm, maven, npm, nuget, pypi, yum.
- repos string[]
- Specify patterns for repository names or explicit repository names. For including all repos use
**
. Example:repos = ["**"]
- created
Before numberIn Months - 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 string[] - Specify explicit package names that you want excluded from the policy. Only Name explicit names (and not patterns) are accepted.
- excluded
Repos string[] - Specify patterns for repository names or explicit repository names that you want excluded from the cleanup policy.
- include
All booleanProjects - Set this to
true
if you want the policy to run on all projects on the platform. - included
Projects 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
. - keep
Last numberNVersions 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 numberBefore In Months 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, debian, docker, gems, generic, go, gradle, helm, maven, npm, nuget, pypi, yum.
- repos Sequence[str]
- Specify patterns for repository names or explicit repository names. For including all repos use
**
. Example:repos = ["**"]
- created_
before_ intin_ months - 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_ boolprojects - 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_ intn_ versions 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_ intbefore_ in_ months 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 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 = ["**"]
- package
Types List<String> - Types of packages to be removed. Support: conan, debian, docker, gems, generic, go, gradle, helm, maven, npm, nuget, pypi, yum.
- repos List<String>
- Specify patterns for repository names or explicit repository names. For including all repos use
**
. Example:repos = ["**"]
- created
Before NumberIn Months - 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 List<String> - Specify explicit package names that you want excluded from the policy. Only Name explicit names (and not patterns) are accepted.
- excluded
Repos List<String> - Specify patterns for repository names or explicit repository names that you want excluded from the cleanup policy.
- include
All BooleanProjects - Set this to
true
if you want the policy to run on all projects on the platform. - included
Projects 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
. - keep
Last NumberNVersions 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 NumberBefore In Months 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.