|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "gcore_lifecyclepolicy Resource - terraform-provider-gcorelabs" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + Represent lifecycle policy. Use to periodically take snapshots |
| 7 | +--- |
| 8 | + |
| 9 | +# gcore_lifecyclepolicy (Resource) |
| 10 | + |
| 11 | +Represent lifecycle policy. Use to periodically take snapshots |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```terraform |
| 16 | +provider gcore { |
| 17 | + user_name = "test" |
| 18 | + password = "test" |
| 19 | + gcore_platform = "https://api.gcdn.co" |
| 20 | + gcore_api = "https://api.cloud.gcorelabs.com" |
| 21 | +} |
| 22 | +
|
| 23 | +resource "gcore_lifecyclepolicy" "lp" { |
| 24 | + project_id = 1 |
| 25 | + region_id = 1 |
| 26 | + name = "test" |
| 27 | + status = "active" |
| 28 | + action = "volume_snapshot" |
| 29 | + volume { |
| 30 | + id = "fe93bfdd-4ce3-4041-b89b-4f10d0d49498" |
| 31 | + } |
| 32 | + schedule { |
| 33 | + max_quantity = 4 |
| 34 | + interval { |
| 35 | + weeks = 1 |
| 36 | + days = 2 |
| 37 | + hours = 3 |
| 38 | + minutes = 4 |
| 39 | + } |
| 40 | + resource_name_template = "reserve snap of the volume {volume_id}" |
| 41 | + retention_time { |
| 42 | + weeks = 4 |
| 43 | + days = 3 |
| 44 | + hours = 2 |
| 45 | + minutes = 1 |
| 46 | + } |
| 47 | + } |
| 48 | +} |
| 49 | +``` |
| 50 | + |
| 51 | +<!-- schema generated by tfplugindocs --> |
| 52 | +## Schema |
| 53 | + |
| 54 | +### Required |
| 55 | + |
| 56 | +- **name** (String) |
| 57 | + |
| 58 | +### Optional |
| 59 | + |
| 60 | +- **action** (String) |
| 61 | +- **id** (String) The ID of this resource. |
| 62 | +- **project_id** (Number) |
| 63 | +- **project_name** (String) |
| 64 | +- **region_id** (Number) |
| 65 | +- **region_name** (String) |
| 66 | +- **schedule** (Block List) (see [below for nested schema](#nestedblock--schedule)) |
| 67 | +- **status** (String) |
| 68 | +- **volume** (Block Set) List of managed volumes (see [below for nested schema](#nestedblock--volume)) |
| 69 | + |
| 70 | +### Read-Only |
| 71 | + |
| 72 | +- **user_id** (Number) |
| 73 | + |
| 74 | +<a id="nestedblock--schedule"></a> |
| 75 | +### Nested Schema for `schedule` |
| 76 | + |
| 77 | +Required: |
| 78 | + |
| 79 | +- **max_quantity** (Number) Maximum number of stored resources |
| 80 | + |
| 81 | +Optional: |
| 82 | + |
| 83 | +- **cron** (Block List, Max: 1) Use for taking actions at specified moments of time. Exactly one of interval and cron blocks should be provided (see [below for nested schema](#nestedblock--schedule--cron)) |
| 84 | +- **interval** (Block List, Max: 1) Use for taking actions with equal time intervals between them. Exactly one of interval and cron blocks should be provided (see [below for nested schema](#nestedblock--schedule--interval)) |
| 85 | +- **resource_name_template** (String) Used to name snapshots. {volume_id} is substituted with volume.id on creation |
| 86 | +- **retention_time** (Block List, Max: 1) If it is set, new resource will be deleted after time (see [below for nested schema](#nestedblock--schedule--retention_time)) |
| 87 | + |
| 88 | +Read-Only: |
| 89 | + |
| 90 | +- **id** (String) The ID of this resource. |
| 91 | +- **type** (String) |
| 92 | + |
| 93 | +<a id="nestedblock--schedule--cron"></a> |
| 94 | +### Nested Schema for `schedule.cron` |
| 95 | + |
| 96 | +Optional: |
| 97 | + |
| 98 | +- **day** (String) Either single asterisk or comma-separated list of integers (1-31) |
| 99 | +- **day_of_week** (String) Either single asterisk or comma-separated list of integers (0-6) |
| 100 | +- **hour** (String) Either single asterisk or comma-separated list of integers (0-23) |
| 101 | +- **minute** (String) Either single asterisk or comma-separated list of integers (0-59) |
| 102 | +- **month** (String) Either single asterisk or comma-separated list of integers (1-12) |
| 103 | +- **timezone** (String) |
| 104 | +- **week** (String) Either single asterisk or comma-separated list of integers (1-53) |
| 105 | + |
| 106 | + |
| 107 | +<a id="nestedblock--schedule--interval"></a> |
| 108 | +### Nested Schema for `schedule.interval` |
| 109 | + |
| 110 | +Optional: |
| 111 | + |
| 112 | +- **days** (Number) Number of days to wait between actions |
| 113 | +- **hours** (Number) Number of hours to wait between actions |
| 114 | +- **minutes** (Number) Number of minutes to wait between actions |
| 115 | +- **weeks** (Number) Number of weeks to wait between actions |
| 116 | + |
| 117 | + |
| 118 | +<a id="nestedblock--schedule--retention_time"></a> |
| 119 | +### Nested Schema for `schedule.retention_time` |
| 120 | + |
| 121 | +Optional: |
| 122 | + |
| 123 | +- **days** (Number) Number of days to wait before deleting snapshot |
| 124 | +- **hours** (Number) Number of hours to wait before deleting snapshot |
| 125 | +- **minutes** (Number) Number of minutes to wait before deleting snapshot |
| 126 | +- **weeks** (Number) Number of weeks to wait before deleting snapshot |
| 127 | + |
| 128 | + |
| 129 | + |
| 130 | +<a id="nestedblock--volume"></a> |
| 131 | +### Nested Schema for `volume` |
| 132 | + |
| 133 | +Required: |
| 134 | + |
| 135 | +- **id** (String) The ID of this resource. |
| 136 | + |
| 137 | +Read-Only: |
| 138 | + |
| 139 | +- **name** (String) |
| 140 | + |
| 141 | + |
0 commit comments