1. Packages
  2. Artifactory Provider
  3. API Docs
  4. ArchivePolicy
artifactory v8.8.1 published on Wednesday, Apr 9, 2025 by Pulumi

artifactory.ArchivePolicy

Explore with Pulumi AI

Provides an Artifactory Archive 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 Retention Policies for more details.

~>Currently in beta and not yet globally available. A full rollout is scheduled for Q1 2025.

Create ArchivePolicy Resource

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

Constructor syntax

new ArchivePolicy(name: string, args: ArchivePolicyArgs, opts?: CustomResourceOptions);
@overload
def ArchivePolicy(resource_name: str,
                  args: ArchivePolicyArgs,
                  opts: Optional[ResourceOptions] = None)

@overload
def ArchivePolicy(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  key: Optional[str] = None,
                  search_criteria: Optional[ArchivePolicySearchCriteriaArgs] = 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 NewArchivePolicy(ctx *Context, name string, args ArchivePolicyArgs, opts ...ResourceOption) (*ArchivePolicy, error)
public ArchivePolicy(string name, ArchivePolicyArgs args, CustomResourceOptions? opts = null)
public ArchivePolicy(String name, ArchivePolicyArgs args)
public ArchivePolicy(String name, ArchivePolicyArgs args, CustomResourceOptions options)
type: artifactory:ArchivePolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ArchivePolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ArchivePolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ArchivePolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ArchivePolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ArchivePolicyArgs
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 archivePolicyResource = new Artifactory.ArchivePolicy("archivePolicyResource", new()
{
    Key = "string",
    SearchCriteria = new Artifactory.Inputs.ArchivePolicySearchCriteriaArgs
    {
        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,
});
Copy
example, err := artifactory.NewArchivePolicy(ctx, "archivePolicyResource", &artifactory.ArchivePolicyArgs{
	Key: pulumi.String("string"),
	SearchCriteria: &artifactory.ArchivePolicySearchCriteriaArgs{
		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),
})
Copy
var archivePolicyResource = new ArchivePolicy("archivePolicyResource", ArchivePolicyArgs.builder()
    .key("string")
    .searchCriteria(ArchivePolicySearchCriteriaArgs.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());
Copy
archive_policy_resource = artifactory.ArchivePolicy("archivePolicyResource",
    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)
Copy
const archivePolicyResource = new artifactory.ArchivePolicy("archivePolicyResource", {
    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,
});
Copy
type: artifactory:ArchivePolicy
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
Copy

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

Key This property is required. string
An ID that is used to identify the archive policy. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
SearchCriteria This property is required. ArchivePolicySearchCriteria
CronExpression string
The cron expression determines when the policy is run. This parameter is not mandatory, however if left empty the policy will not run automatically and can only be triggered manually.
Description string
DurationInMinutes int
The maximum duration (in minutes) for policy execution, after which the policy will stop running even if not completed. While setting a maximum run duration for a policy is useful for adhering to a strict archive V2 schedule, it 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 archive V2 policies, it is not used for global-level policies.
SkipTrashcan bool
A true value means that when this policy is executed, packages will be permanently deleted. false means that when the policy is executed packages will be deleted to the Trash Can. Defaults to false.
Key This property is required. string
An ID that is used to identify the archive policy. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
SearchCriteria This property is required. ArchivePolicySearchCriteriaArgs
CronExpression string
The cron expression determines when the policy is run. This parameter is not mandatory, however if left empty the policy will not run automatically and can only be triggered manually.
Description string
DurationInMinutes int
The maximum duration (in minutes) for policy execution, after which the policy will stop running even if not completed. While setting a maximum run duration for a policy is useful for adhering to a strict archive V2 schedule, it 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 archive V2 policies, it is not used for global-level policies.
SkipTrashcan bool
A true value means that when this policy is executed, packages will be permanently deleted. false means that when the policy is executed packages will be deleted to the Trash Can. Defaults to false.
key This property is required. String
An ID that is used to identify the archive policy. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
searchCriteria This property is required. ArchivePolicySearchCriteria
cronExpression String
The cron expression determines when the policy is run. This parameter is not mandatory, however if left empty the policy will not run automatically and can only be triggered manually.
description String
durationInMinutes Integer
The maximum duration (in minutes) for policy execution, after which the policy will stop running even if not completed. While setting a maximum run duration for a policy is useful for adhering to a strict archive V2 schedule, it 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 archive V2 policies, it is not used for global-level policies.
skipTrashcan Boolean
A true value means that when this policy is executed, packages will be permanently deleted. false means that when the policy is executed packages will be deleted to the Trash Can. Defaults to false.
key This property is required. string
An ID that is used to identify the archive policy. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
searchCriteria This property is required. ArchivePolicySearchCriteria
cronExpression string
The cron expression determines when the policy is run. This parameter is not mandatory, however if left empty the policy will not run automatically and can only be triggered manually.
description string
durationInMinutes number
The maximum duration (in minutes) for policy execution, after which the policy will stop running even if not completed. While setting a maximum run duration for a policy is useful for adhering to a strict archive V2 schedule, it 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 archive V2 policies, it is not used for global-level policies.
skipTrashcan boolean
A true value means that when this policy is executed, packages will be permanently deleted. false means that when the policy is executed packages will be deleted to the Trash Can. Defaults to false.
key This property is required. str
An ID that is used to identify the archive policy. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
search_criteria This property is required. ArchivePolicySearchCriteriaArgs
cron_expression str
The cron expression determines when the policy is run. This parameter is not mandatory, however if left empty the policy will not run automatically and can only be triggered manually.
description str
duration_in_minutes int
The maximum duration (in minutes) for policy execution, after which the policy will stop running even if not completed. While setting a maximum run duration for a policy is useful for adhering to a strict archive V2 schedule, it 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 archive V2 policies, it is not used for global-level policies.
skip_trashcan bool
A true value means that when this policy is executed, packages will be permanently deleted. false means that when the policy is executed packages will be deleted to the Trash Can. Defaults to false.
key This property is required. String
An ID that is used to identify the archive policy. A minimum of three characters is required and can include letters, numbers, underscore and hyphen.
searchCriteria This property is required. Property Map
cronExpression String
The cron expression determines when the policy is run. This parameter is not mandatory, however if left empty the policy will not run automatically and can only be triggered manually.
description String
durationInMinutes Number
The maximum duration (in minutes) for policy execution, after which the policy will stop running even if not completed. While setting a maximum run duration for a policy is useful for adhering to a strict archive V2 schedule, it 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 archive V2 policies, it is not used for global-level policies.
skipTrashcan Boolean
A true value means that when this policy is executed, packages will be permanently deleted. false means that when the policy is executed packages will be deleted to the Trash Can. Defaults to false.

Outputs

All input properties are implicitly available as output properties. Additionally, the ArchivePolicy 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 ArchivePolicy Resource

Get an existing ArchivePolicy 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?: ArchivePolicyState, opts?: CustomResourceOptions): ArchivePolicy
@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[ArchivePolicySearchCriteriaArgs] = None,
        skip_trashcan: Optional[bool] = None) -> ArchivePolicy
func GetArchivePolicy(ctx *Context, name string, id IDInput, state *ArchivePolicyState, opts ...ResourceOption) (*ArchivePolicy, error)
public static ArchivePolicy Get(string name, Input<string> id, ArchivePolicyState? state, CustomResourceOptions? opts = null)
public static ArchivePolicy get(String name, Output<String> id, ArchivePolicyState state, CustomResourceOptions options)
resources:  _:    type: artifactory:ArchivePolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 determines when the policy is run. This parameter is not mandatory, however if left empty the policy will not run automatically and can only be triggered manually.
Description string
DurationInMinutes int
The maximum duration (in minutes) for policy execution, after which the policy will stop running even if not completed. While setting a maximum run duration for a policy is useful for adhering to a strict archive V2 schedule, it 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
An ID that is used to identify the archive policy. 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 archive V2 policies, it is not used for global-level policies.
SearchCriteria ArchivePolicySearchCriteria
SkipTrashcan bool
A true value means that when this policy is executed, packages will be permanently deleted. false means that when the policy is executed packages will be deleted to the Trash Can. Defaults to false.
CronExpression string
The cron expression determines when the policy is run. This parameter is not mandatory, however if left empty the policy will not run automatically and can only be triggered manually.
Description string
DurationInMinutes int
The maximum duration (in minutes) for policy execution, after which the policy will stop running even if not completed. While setting a maximum run duration for a policy is useful for adhering to a strict archive V2 schedule, it 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
An ID that is used to identify the archive policy. 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 archive V2 policies, it is not used for global-level policies.
SearchCriteria ArchivePolicySearchCriteriaArgs
SkipTrashcan bool
A true value means that when this policy is executed, packages will be permanently deleted. false means that when the policy is executed packages will be deleted to the Trash Can. Defaults to false.
cronExpression String
The cron expression determines when the policy is run. This parameter is not mandatory, however if left empty the policy will not run automatically and can only be triggered manually.
description String
durationInMinutes Integer
The maximum duration (in minutes) for policy execution, after which the policy will stop running even if not completed. While setting a maximum run duration for a policy is useful for adhering to a strict archive V2 schedule, it 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
An ID that is used to identify the archive policy. 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 archive V2 policies, it is not used for global-level policies.
searchCriteria ArchivePolicySearchCriteria
skipTrashcan Boolean
A true value means that when this policy is executed, packages will be permanently deleted. false means that when the policy is executed packages will be deleted to the Trash Can. Defaults to false.
cronExpression string
The cron expression determines when the policy is run. This parameter is not mandatory, however if left empty the policy will not run automatically and can only be triggered manually.
description string
durationInMinutes number
The maximum duration (in minutes) for policy execution, after which the policy will stop running even if not completed. While setting a maximum run duration for a policy is useful for adhering to a strict archive V2 schedule, it 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
An ID that is used to identify the archive policy. 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 archive V2 policies, it is not used for global-level policies.
searchCriteria ArchivePolicySearchCriteria
skipTrashcan boolean
A true value means that when this policy is executed, packages will be permanently deleted. false means that when the policy is executed packages will be deleted to the Trash Can. Defaults to false.
cron_expression str
The cron expression determines when the policy is run. This parameter is not mandatory, however if left empty the policy will not run automatically and can only be triggered manually.
description str
duration_in_minutes int
The maximum duration (in minutes) for policy execution, after which the policy will stop running even if not completed. While setting a maximum run duration for a policy is useful for adhering to a strict archive V2 schedule, it 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
An ID that is used to identify the archive policy. 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 archive V2 policies, it is not used for global-level policies.
search_criteria ArchivePolicySearchCriteriaArgs
skip_trashcan bool
A true value means that when this policy is executed, packages will be permanently deleted. false means that when the policy is executed packages will be deleted to the Trash Can. Defaults to false.
cronExpression String
The cron expression determines when the policy is run. This parameter is not mandatory, however if left empty the policy will not run automatically and can only be triggered manually.
description String
durationInMinutes Number
The maximum duration (in minutes) for policy execution, after which the policy will stop running even if not completed. While setting a maximum run duration for a policy is useful for adhering to a strict archive V2 schedule, it 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
An ID that is used to identify the archive policy. 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 archive V2 policies, it is not used for global-level policies.
searchCriteria Property Map
skipTrashcan Boolean
A true value means that when this policy is executed, packages will be permanently deleted. false means that when the policy is executed packages will be deleted to the Trash Can. Defaults to false.

Supporting Types

ArchivePolicySearchCriteria
, ArchivePolicySearchCriteriaArgs

IncludedPackages This property is required. 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 This property is required. List<string>
Repos This property is required. List<string>
Specify one or more patterns for the repository name(s) on which you want the archive policy to run. You can also specify explicit repository names. Specifying at least one pattern or explicit name is required. Only packages in repositories that match the pattern or explicit name will be archived. For including all repos use **. Example: repos = ["**"]
CreatedBeforeInMonths int
The archive policy will archive packages based on how long ago they were created. For example, if this parameter is 2 then packages created more than 2 months ago will be archived as part of the policy.
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 archive policy.
IncludeAllProjects bool
Set this value to true if you want the policy to run on all Artifactory projects. The default value is false.
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.

~>This setting is relevant only on the global level, for Platform Admins.

KeepLastNVersions int

Set a value for the number of latest versions to keep. The archive policy will remove all versions before the number you select here. The latest version is always excluded.

~>Versions are determined by creation date.

~>Not all package types support this condition. If you include a package type in your policy that is not compatible with this condition, a validation error (400) is returned. For information on which package types support this condition, see here.

LastDownloadedBeforeInMonths int

The archive policy will archive packages based on how long ago they were downloaded. For example, if this parameter is 5 then packages downloaded more than 5 months ago will be archived as part of the policy.

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

IncludedPackages This property is required. []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 This property is required. []string
Repos This property is required. []string
Specify one or more patterns for the repository name(s) on which you want the archive policy to run. You can also specify explicit repository names. Specifying at least one pattern or explicit name is required. Only packages in repositories that match the pattern or explicit name will be archived. For including all repos use **. Example: repos = ["**"]
CreatedBeforeInMonths int
The archive policy will archive packages based on how long ago they were created. For example, if this parameter is 2 then packages created more than 2 months ago will be archived as part of the policy.
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 archive policy.
IncludeAllProjects bool
Set this value to true if you want the policy to run on all Artifactory projects. The default value is false.
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.

~>This setting is relevant only on the global level, for Platform Admins.

KeepLastNVersions int

Set a value for the number of latest versions to keep. The archive policy will remove all versions before the number you select here. The latest version is always excluded.

~>Versions are determined by creation date.

~>Not all package types support this condition. If you include a package type in your policy that is not compatible with this condition, a validation error (400) is returned. For information on which package types support this condition, see here.

LastDownloadedBeforeInMonths int

The archive policy will archive packages based on how long ago they were downloaded. For example, if this parameter is 5 then packages downloaded more than 5 months ago will be archived as part of the policy.

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

includedPackages This property is required. 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 This property is required. List<String>
repos This property is required. List<String>
Specify one or more patterns for the repository name(s) on which you want the archive policy to run. You can also specify explicit repository names. Specifying at least one pattern or explicit name is required. Only packages in repositories that match the pattern or explicit name will be archived. For including all repos use **. Example: repos = ["**"]
createdBeforeInMonths Integer
The archive policy will archive packages based on how long ago they were created. For example, if this parameter is 2 then packages created more than 2 months ago will be archived as part of the policy.
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 archive policy.
includeAllProjects Boolean
Set this value to true if you want the policy to run on all Artifactory projects. The default value is false.
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.

~>This setting is relevant only on the global level, for Platform Admins.

keepLastNVersions Integer

Set a value for the number of latest versions to keep. The archive policy will remove all versions before the number you select here. The latest version is always excluded.

~>Versions are determined by creation date.

~>Not all package types support this condition. If you include a package type in your policy that is not compatible with this condition, a validation error (400) is returned. For information on which package types support this condition, see here.

lastDownloadedBeforeInMonths Integer

The archive policy will archive packages based on how long ago they were downloaded. For example, if this parameter is 5 then packages downloaded more than 5 months ago will be archived as part of the policy.

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

includedPackages This property is required. 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 This property is required. string[]
repos This property is required. string[]
Specify one or more patterns for the repository name(s) on which you want the archive policy to run. You can also specify explicit repository names. Specifying at least one pattern or explicit name is required. Only packages in repositories that match the pattern or explicit name will be archived. For including all repos use **. Example: repos = ["**"]
createdBeforeInMonths number
The archive policy will archive packages based on how long ago they were created. For example, if this parameter is 2 then packages created more than 2 months ago will be archived as part of the policy.
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 archive policy.
includeAllProjects boolean
Set this value to true if you want the policy to run on all Artifactory projects. The default value is false.
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.

~>This setting is relevant only on the global level, for Platform Admins.

keepLastNVersions number

Set a value for the number of latest versions to keep. The archive policy will remove all versions before the number you select here. The latest version is always excluded.

~>Versions are determined by creation date.

~>Not all package types support this condition. If you include a package type in your policy that is not compatible with this condition, a validation error (400) is returned. For information on which package types support this condition, see here.

lastDownloadedBeforeInMonths number

The archive policy will archive packages based on how long ago they were downloaded. For example, if this parameter is 5 then packages downloaded more than 5 months ago will be archived as part of the policy.

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

included_packages This property is required. 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 This property is required. Sequence[str]
repos This property is required. Sequence[str]
Specify one or more patterns for the repository name(s) on which you want the archive policy to run. You can also specify explicit repository names. Specifying at least one pattern or explicit name is required. Only packages in repositories that match the pattern or explicit name will be archived. For including all repos use **. Example: repos = ["**"]
created_before_in_months int
The archive policy will archive packages based on how long ago they were created. For example, if this parameter is 2 then packages created more than 2 months ago will be archived as part of the policy.
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 archive policy.
include_all_projects bool
Set this value to true if you want the policy to run on all Artifactory projects. The default value is false.
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.

~>This setting is relevant only on the global level, for Platform Admins.

keep_last_n_versions int

Set a value for the number of latest versions to keep. The archive policy will remove all versions before the number you select here. The latest version is always excluded.

~>Versions are determined by creation date.

~>Not all package types support this condition. If you include a package type in your policy that is not compatible with this condition, a validation error (400) is returned. For information on which package types support this condition, see here.

last_downloaded_before_in_months int

The archive policy will archive packages based on how long ago they were downloaded. For example, if this parameter is 5 then packages downloaded more than 5 months ago will be archived as part of the policy.

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

includedPackages This property is required. 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 This property is required. List<String>
repos This property is required. List<String>
Specify one or more patterns for the repository name(s) on which you want the archive policy to run. You can also specify explicit repository names. Specifying at least one pattern or explicit name is required. Only packages in repositories that match the pattern or explicit name will be archived. For including all repos use **. Example: repos = ["**"]
createdBeforeInMonths Number
The archive policy will archive packages based on how long ago they were created. For example, if this parameter is 2 then packages created more than 2 months ago will be archived as part of the policy.
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 archive policy.
includeAllProjects Boolean
Set this value to true if you want the policy to run on all Artifactory projects. The default value is false.
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.

~>This setting is relevant only on the global level, for Platform Admins.

keepLastNVersions Number

Set a value for the number of latest versions to keep. The archive policy will remove all versions before the number you select here. The latest version is always excluded.

~>Versions are determined by creation date.

~>Not all package types support this condition. If you include a package type in your policy that is not compatible with this condition, a validation error (400) is returned. For information on which package types support this condition, see here.

lastDownloadedBeforeInMonths Number

The archive policy will archive packages based on how long ago they were downloaded. For example, if this parameter is 5 then packages downloaded more than 5 months ago will be archived as part of the policy.

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

Import

$ pulumi import artifactory:index/archivePolicy:ArchivePolicy my-archive-policy my-policy
Copy
$ pulumi import artifactory:index/archivePolicy:ArchivePolicy my-archive-policy my-policy:myproj
Copy

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.