Artifactory

Pulumi Official
Package maintained by Pulumi
v2.6.1 published on Tuesday, Aug 16, 2022 by Pulumi

Backup

This resource can be used to manage the automatic and periodic backups of the entire Artifactory instance.

When an artifactory.Backup resource is configured and enabled to true, backup of the entire Artifactory system will be done automatically and periodically. The backup process creates a time-stamped directory in the target backup directory.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Artifactory = Pulumi.Artifactory;

return await Deployment.RunAsync(() => 
{
    // Configure Artifactory Backup system config
    var backupConfigName = new Artifactory.Backup("backupConfigName", new()
    {
        CreateArchive = false,
        CronExp = "0 0 12 * * ?",
        Enabled = true,
        ExcludeNewRepositories = true,
        ExcludedRepositories = new[] {},
        Key = "backup_config_name",
        RetentionPeriodHours = 1000,
        SendMailOnError = true,
    });

});
package main

import (
	"github.com/pulumi/pulumi-artifactory/sdk/v2/go/artifactory"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := artifactory.NewBackup(ctx, "backupConfigName", &artifactory.BackupArgs{
			CreateArchive:          pulumi.Bool(false),
			CronExp:                pulumi.String("0 0 12 * * ?"),
			Enabled:                pulumi.Bool(true),
			ExcludeNewRepositories: pulumi.Bool(true),
			ExcludedRepositories:   pulumi.StringArray{},
			Key:                    pulumi.String("backup_config_name"),
			RetentionPeriodHours:   pulumi.Int(1000),
			SendMailOnError:        pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.artifactory.Backup;
import com.pulumi.artifactory.BackupArgs;
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 backupConfigName = new Backup("backupConfigName", BackupArgs.builder()        
            .createArchive(false)
            .cronExp("0 0 12 * * ?")
            .enabled(true)
            .excludeNewRepositories(true)
            .excludedRepositories()
            .key("backup_config_name")
            .retentionPeriodHours(1000)
            .sendMailOnError(true)
            .build());

    }
}
import pulumi
import pulumi_artifactory as artifactory

# Configure Artifactory Backup system config
backup_config_name = artifactory.Backup("backupConfigName",
    create_archive=False,
    cron_exp="0 0 12 * * ?",
    enabled=True,
    exclude_new_repositories=True,
    excluded_repositories=[],
    key="backup_config_name",
    retention_period_hours=1000,
    send_mail_on_error=True)
import * as pulumi from "@pulumi/pulumi";
import * as artifactory from "@pulumi/artifactory";

// Configure Artifactory Backup system config
const backupConfigName = new artifactory.Backup("backup_config_name", {
    createArchive: false,
    cronExp: "0 0 12 * * ?",
    enabled: true,
    excludeNewRepositories: true,
    excludedRepositories: [],
    key: "backup_config_name",
    retentionPeriodHours: 1000,
    sendMailOnError: true,
});
resources:
  # Configure Artifactory Backup system config
  backupConfigName:
    type: artifactory:Backup
    properties:
      createArchive: false
      cronExp: 0 0 12 * * ?
      enabled: true
      excludeNewRepositories: true
      excludedRepositories: []
      key: backup_config_name
      retentionPeriodHours: 1000
      sendMailOnError: true

Create a Backup Resource

new Backup(name: string, args: BackupArgs, opts?: CustomResourceOptions);
@overload
def Backup(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           create_archive: Optional[bool] = None,
           cron_exp: Optional[str] = None,
           enabled: Optional[bool] = None,
           exclude_new_repositories: Optional[bool] = None,
           excluded_repositories: Optional[Sequence[str]] = None,
           key: Optional[str] = None,
           retention_period_hours: Optional[int] = None,
           send_mail_on_error: Optional[bool] = None)
@overload
def Backup(resource_name: str,
           args: BackupArgs,
           opts: Optional[ResourceOptions] = None)
func NewBackup(ctx *Context, name string, args BackupArgs, opts ...ResourceOption) (*Backup, error)
public Backup(string name, BackupArgs args, CustomResourceOptions? opts = null)
public Backup(String name, BackupArgs args)
public Backup(String name, BackupArgs args, CustomResourceOptions options)
type: artifactory:Backup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args BackupArgs
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 BackupArgs
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 BackupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args BackupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args BackupArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

CronExp string

A valid CRON expression that you can use to control backup frequency. Eg: "0 0 12 * * ? ".

Key string

The unique ID of the artifactory backup config.

CreateArchive bool

If set, backups will be created within a Zip archive (Slow and CPU intensive). Default value is false.

Enabled bool

Flag to enable or disable the backup config. Default value is true.

ExcludeNewRepositories bool

When set, new repositories will not be automatically added to the backup. Default value is false.

ExcludedRepositories List<string>

A list of excluded repositories from the backup. Default is empty list.

RetentionPeriodHours int

The number of hours to keep a backup before Artifactory will clean it up to free up disk space. Applicable only to non-incremental backups. Default value is 168 hours ie: 7 days.

SendMailOnError bool

If set, all Artifactory administrators will be notified by email if any problem is encountered during backup. Default value is true.

CronExp string

A valid CRON expression that you can use to control backup frequency. Eg: "0 0 12 * * ? ".

Key string

The unique ID of the artifactory backup config.

CreateArchive bool

If set, backups will be created within a Zip archive (Slow and CPU intensive). Default value is false.

Enabled bool

Flag to enable or disable the backup config. Default value is true.

ExcludeNewRepositories bool

When set, new repositories will not be automatically added to the backup. Default value is false.

ExcludedRepositories []string

A list of excluded repositories from the backup. Default is empty list.

RetentionPeriodHours int

The number of hours to keep a backup before Artifactory will clean it up to free up disk space. Applicable only to non-incremental backups. Default value is 168 hours ie: 7 days.

SendMailOnError bool

If set, all Artifactory administrators will be notified by email if any problem is encountered during backup. Default value is true.

cronExp String

A valid CRON expression that you can use to control backup frequency. Eg: "0 0 12 * * ? ".

key String

The unique ID of the artifactory backup config.

createArchive Boolean

If set, backups will be created within a Zip archive (Slow and CPU intensive). Default value is false.

enabled Boolean

Flag to enable or disable the backup config. Default value is true.

excludeNewRepositories Boolean

When set, new repositories will not be automatically added to the backup. Default value is false.

excludedRepositories List<String>

A list of excluded repositories from the backup. Default is empty list.

retentionPeriodHours Integer

The number of hours to keep a backup before Artifactory will clean it up to free up disk space. Applicable only to non-incremental backups. Default value is 168 hours ie: 7 days.

sendMailOnError Boolean

If set, all Artifactory administrators will be notified by email if any problem is encountered during backup. Default value is true.

cronExp string

A valid CRON expression that you can use to control backup frequency. Eg: "0 0 12 * * ? ".

key string

The unique ID of the artifactory backup config.

createArchive boolean

If set, backups will be created within a Zip archive (Slow and CPU intensive). Default value is false.

enabled boolean

Flag to enable or disable the backup config. Default value is true.

excludeNewRepositories boolean

When set, new repositories will not be automatically added to the backup. Default value is false.

excludedRepositories string[]

A list of excluded repositories from the backup. Default is empty list.

retentionPeriodHours number

The number of hours to keep a backup before Artifactory will clean it up to free up disk space. Applicable only to non-incremental backups. Default value is 168 hours ie: 7 days.

sendMailOnError boolean

If set, all Artifactory administrators will be notified by email if any problem is encountered during backup. Default value is true.

cron_exp str

A valid CRON expression that you can use to control backup frequency. Eg: "0 0 12 * * ? ".

key str

The unique ID of the artifactory backup config.

create_archive bool

If set, backups will be created within a Zip archive (Slow and CPU intensive). Default value is false.

enabled bool

Flag to enable or disable the backup config. Default value is true.

exclude_new_repositories bool

When set, new repositories will not be automatically added to the backup. Default value is false.

excluded_repositories Sequence[str]

A list of excluded repositories from the backup. Default is empty list.

retention_period_hours int

The number of hours to keep a backup before Artifactory will clean it up to free up disk space. Applicable only to non-incremental backups. Default value is 168 hours ie: 7 days.

send_mail_on_error bool

If set, all Artifactory administrators will be notified by email if any problem is encountered during backup. Default value is true.

cronExp String

A valid CRON expression that you can use to control backup frequency. Eg: "0 0 12 * * ? ".

key String

The unique ID of the artifactory backup config.

createArchive Boolean

If set, backups will be created within a Zip archive (Slow and CPU intensive). Default value is false.

enabled Boolean

Flag to enable or disable the backup config. Default value is true.

excludeNewRepositories Boolean

When set, new repositories will not be automatically added to the backup. Default value is false.

excludedRepositories List<String>

A list of excluded repositories from the backup. Default is empty list.

retentionPeriodHours Number

The number of hours to keep a backup before Artifactory will clean it up to free up disk space. Applicable only to non-incremental backups. Default value is 168 hours ie: 7 days.

sendMailOnError Boolean

If set, all Artifactory administrators will be notified by email if any problem is encountered during backup. Default value is true.

Outputs

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

Get an existing Backup 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?: BackupState, opts?: CustomResourceOptions): Backup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        create_archive: Optional[bool] = None,
        cron_exp: Optional[str] = None,
        enabled: Optional[bool] = None,
        exclude_new_repositories: Optional[bool] = None,
        excluded_repositories: Optional[Sequence[str]] = None,
        key: Optional[str] = None,
        retention_period_hours: Optional[int] = None,
        send_mail_on_error: Optional[bool] = None) -> Backup
func GetBackup(ctx *Context, name string, id IDInput, state *BackupState, opts ...ResourceOption) (*Backup, error)
public static Backup Get(string name, Input<string> id, BackupState? state, CustomResourceOptions? opts = null)
public static Backup get(String name, Output<String> id, BackupState 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:
CreateArchive bool

If set, backups will be created within a Zip archive (Slow and CPU intensive). Default value is false.

CronExp string

A valid CRON expression that you can use to control backup frequency. Eg: "0 0 12 * * ? ".

Enabled bool

Flag to enable or disable the backup config. Default value is true.

ExcludeNewRepositories bool

When set, new repositories will not be automatically added to the backup. Default value is false.

ExcludedRepositories List<string>

A list of excluded repositories from the backup. Default is empty list.

Key string

The unique ID of the artifactory backup config.

RetentionPeriodHours int

The number of hours to keep a backup before Artifactory will clean it up to free up disk space. Applicable only to non-incremental backups. Default value is 168 hours ie: 7 days.

SendMailOnError bool

If set, all Artifactory administrators will be notified by email if any problem is encountered during backup. Default value is true.

CreateArchive bool

If set, backups will be created within a Zip archive (Slow and CPU intensive). Default value is false.

CronExp string

A valid CRON expression that you can use to control backup frequency. Eg: "0 0 12 * * ? ".

Enabled bool

Flag to enable or disable the backup config. Default value is true.

ExcludeNewRepositories bool

When set, new repositories will not be automatically added to the backup. Default value is false.

ExcludedRepositories []string

A list of excluded repositories from the backup. Default is empty list.

Key string

The unique ID of the artifactory backup config.

RetentionPeriodHours int

The number of hours to keep a backup before Artifactory will clean it up to free up disk space. Applicable only to non-incremental backups. Default value is 168 hours ie: 7 days.

SendMailOnError bool

If set, all Artifactory administrators will be notified by email if any problem is encountered during backup. Default value is true.

createArchive Boolean

If set, backups will be created within a Zip archive (Slow and CPU intensive). Default value is false.

cronExp String

A valid CRON expression that you can use to control backup frequency. Eg: "0 0 12 * * ? ".

enabled Boolean

Flag to enable or disable the backup config. Default value is true.

excludeNewRepositories Boolean

When set, new repositories will not be automatically added to the backup. Default value is false.

excludedRepositories List<String>

A list of excluded repositories from the backup. Default is empty list.

key String

The unique ID of the artifactory backup config.

retentionPeriodHours Integer

The number of hours to keep a backup before Artifactory will clean it up to free up disk space. Applicable only to non-incremental backups. Default value is 168 hours ie: 7 days.

sendMailOnError Boolean

If set, all Artifactory administrators will be notified by email if any problem is encountered during backup. Default value is true.

createArchive boolean

If set, backups will be created within a Zip archive (Slow and CPU intensive). Default value is false.

cronExp string

A valid CRON expression that you can use to control backup frequency. Eg: "0 0 12 * * ? ".

enabled boolean

Flag to enable or disable the backup config. Default value is true.

excludeNewRepositories boolean

When set, new repositories will not be automatically added to the backup. Default value is false.

excludedRepositories string[]

A list of excluded repositories from the backup. Default is empty list.

key string

The unique ID of the artifactory backup config.

retentionPeriodHours number

The number of hours to keep a backup before Artifactory will clean it up to free up disk space. Applicable only to non-incremental backups. Default value is 168 hours ie: 7 days.

sendMailOnError boolean

If set, all Artifactory administrators will be notified by email if any problem is encountered during backup. Default value is true.

create_archive bool

If set, backups will be created within a Zip archive (Slow and CPU intensive). Default value is false.

cron_exp str

A valid CRON expression that you can use to control backup frequency. Eg: "0 0 12 * * ? ".

enabled bool

Flag to enable or disable the backup config. Default value is true.

exclude_new_repositories bool

When set, new repositories will not be automatically added to the backup. Default value is false.

excluded_repositories Sequence[str]

A list of excluded repositories from the backup. Default is empty list.

key str

The unique ID of the artifactory backup config.

retention_period_hours int

The number of hours to keep a backup before Artifactory will clean it up to free up disk space. Applicable only to non-incremental backups. Default value is 168 hours ie: 7 days.

send_mail_on_error bool

If set, all Artifactory administrators will be notified by email if any problem is encountered during backup. Default value is true.

createArchive Boolean

If set, backups will be created within a Zip archive (Slow and CPU intensive). Default value is false.

cronExp String

A valid CRON expression that you can use to control backup frequency. Eg: "0 0 12 * * ? ".

enabled Boolean

Flag to enable or disable the backup config. Default value is true.

excludeNewRepositories Boolean

When set, new repositories will not be automatically added to the backup. Default value is false.

excludedRepositories List<String>

A list of excluded repositories from the backup. Default is empty list.

key String

The unique ID of the artifactory backup config.

retentionPeriodHours Number

The number of hours to keep a backup before Artifactory will clean it up to free up disk space. Applicable only to non-incremental backups. Default value is 168 hours ie: 7 days.

sendMailOnError Boolean

If set, all Artifactory administrators will be notified by email if any problem is encountered during backup. Default value is true.

Import

Backup config can be imported using the key, e.g.

 $ pulumi import artifactory:index/backup:Backup backup_name backup_name

Package Details

Repository
https://github.com/pulumi/pulumi-artifactory
License
Apache-2.0
Notes

This Pulumi package is based on the artifactory Terraform Provider.