-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add validation for 'excluded_repositories' attribute
Switch doc to be generated using terraform-plugin-docs plugin
- Loading branch information
Showing
5 changed files
with
71 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,67 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "artifactory_backup Resource - terraform-provider-artifactory" | ||
subcategory: "Configuration" | ||
description: |- | ||
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. | ||
See JFrog Artifactory Backup https://www.jfrog.com/confluence/display/JFROG/Backups for more details. | ||
~>Only supported in self-hosted environment. | ||
--- | ||
# Artifactory Backup Resource | ||
|
||
# artifactory_backup (Resource) | ||
|
||
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. | ||
|
||
~>The `artifactory_backup` resource utilizes endpoints which are blocked/removed in SaaS environments (i.e. in Artifactory online), rendering this resource incompatible with Artifactory SaaS environments. | ||
See [JFrog Artifactory Backup](https://www.jfrog.com/confluence/display/JFROG/Backups) for more details. | ||
|
||
~>Only supported in self-hosted environment. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
# Configure Artifactory Backup system config | ||
```terraform | ||
resource "artifactory_backup" "backup_config_name" { | ||
key = "backup_config_name" | ||
enabled = true | ||
cron_exp = "0 0 12 * * ? *" | ||
retention_period_hours = 1000 | ||
excluded_repositories = [] | ||
excluded_repositories = ["my-docker-local"] | ||
create_archive = false | ||
exclude_new_repositories = true | ||
send_mail_on_error = true | ||
verify_disk_space = true | ||
export_mission_control = true | ||
} | ||
``` | ||
Note: `Key` argument has to match to the resource name. | ||
Reference Link: [JFrog Artifactory Backup](https://www.jfrog.com/confluence/display/JFROG/Backups) | ||
|
||
## Argument Reference | ||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
The following arguments are supported: | ||
### Required | ||
|
||
* `key` - (Required) The unique ID of the artifactory backup config. | ||
* `enabled` - (Optional) Flag to enable or disable the backup config. Default value is `true`. | ||
* `cron_exp` - (Required) A valid CRON expression that you can use to control backup frequency. Eg: "0 0 12 * * ? *", "0 0 2 ? * MON-SAT *". Note: please use 7 character format - Seconds, Minutes Hours, Day Of Month, Month, Day Of Week, Year. Also, specifying both a day-of-week AND a day-of-month parameter is not supported. One of them should be replaced by `?`. Incorrect: `* 5,7,9 14/2 * * WED,SAT *`, correct: `* 5,7,9 14/2 ? * WED,SAT *`. See details in [Cron Trigger Tutorial](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html) and in [Cronexp package readme](https://github.com/gorhill/cronexpr#other-details). | ||
* `retention_period_hours` - (Optional) 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. | ||
* `excluded_repositories` - (Optional) A list of excluded repositories from the backup. Default is empty list. | ||
* `create_archive` - (Optional) If set, backups will be created within a Zip archive (Slow and CPU intensive). Default value is `false`. | ||
* `exclude_new_repositories` - (Optional) When set, new repositories will not be automatically added to the backup. Default value is `false`. | ||
* `send_mail_on_error` - (Optional) If set, all Artifactory administrators will be notified by email if any problem is encountered during backup. Default value is `true`. | ||
* `verify_disk_space` - (Optional) If set, Artifactory will verify that the backup target location has enough disk space available to hold the backed up data. If there is not enough space available, Artifactory will abort the backup and write a message in the log file. Applicable only to non-incremental backups. | ||
* `export_mission_control` - (Optional) When set to true, mission control will not be automatically added to the backup. Default value is `false`. | ||
- `cron_exp` (String) A valid CRON expression that you can use to control backup frequency. Eg: `0 0 12 * * ? *`, `0 0 2 ? * MON-SAT *`. **Note:** please use 7 character format - Seconds, Minutes Hours, Day Of Month, Month, Day Of Week, Year. Also, specifying both a day-of-week AND a day-of-month parameter is not supported. One of them should be replaced by `?`. Incorrect: `* 5,7,9 14/2 * * WED,SAT *`, correct: `* 5,7,9 14/2 ? * WED,SAT *`. See details in [Cron Trigger Tutorial](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html) and in [Cronexp package readme](https://github.com/gorhill/cronexpr#other-details). | ||
- `key` (String) | ||
|
||
### Optional | ||
|
||
- `create_archive` (Boolean) If set to true, 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`. | ||
- `exclude_new_repositories` (Boolean) When set to true, new repositories will not be automatically added to the backup. Default value is `false`. | ||
- `excluded_repositories` (List of String) List of excluded repositories from the backup. | ||
- `export_mission_control` (Boolean) When set to true, mission control will not be automatically added to the backup. Default value is `false`. | ||
- `retention_period_hours` (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 i.e. 7 days. | ||
- `send_mail_on_error` (Boolean) If set to true, all Artifactory administrators will be notified by email if any problem is encountered during backup. Default value is `true`. | ||
- `verify_disk_space` (Boolean) If set, Artifactory will verify that the backup target location has enough disk space available to hold the backed up data. If there is not enough space available, Artifactory will abort the backup and write a message in the log file. Applicable only to non-incremental backups. Default value is `false`. | ||
|
||
## Import | ||
|
||
Backup config can be imported using the key, e.g. | ||
Import is supported using the following syntax: | ||
|
||
``` | ||
$ terraform import artifactory_backup.backup_name backup_name | ||
```shell | ||
terraform import artifactory_backup.backup_name backup_name | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
terraform import artifactory_backup.backup_name backup_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
resource "artifactory_backup" "backup_config_name" { | ||
key = "backup_config_name" | ||
enabled = true | ||
cron_exp = "0 0 12 * * ? *" | ||
retention_period_hours = 1000 | ||
excluded_repositories = ["my-docker-local"] | ||
create_archive = false | ||
exclude_new_repositories = true | ||
send_mail_on_error = true | ||
verify_disk_space = true | ||
export_mission_control = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters