|
| 1 | +--- |
| 2 | +subcategory: "project" |
| 3 | +page_title: "Harbor: harbor_project" |
| 4 | +description: |- |
| 5 | + Manages an Harbor Project |
| 6 | +--- |
| 7 | + |
| 8 | +# Resource: harbor_project |
| 9 | + |
| 10 | +Handle a [Harbor Project Resource](https://goharbor.io/docs/1.10/working-with-projects/create-projects/). |
| 11 | + |
| 12 | +## Example Usage |
| 13 | + |
| 14 | +```hcl |
| 15 | +resource "harbor_project" "main" { |
| 16 | + name = "main" |
| 17 | + public = false # (Optional) Default value is false |
| 18 | + vulnerability_scanning = true # (Optional) Default value is true. Automatically scan images on push |
| 19 | + reuse_sys_cve_whitelist = false # (Optional) Default value is true. |
| 20 | + cve_whitelist = ["CVE-2020-12345", "CVE-2020-54321"] |
| 21 | +} |
| 22 | +``` |
| 23 | + |
| 24 | +## Argument Reference |
| 25 | + |
| 26 | +The following arguments are required: |
| 27 | + |
| 28 | +* `name` - (Required) Name of the Project. |
| 29 | + |
| 30 | +The following arguments are optional: |
| 31 | + |
| 32 | +* `public` - (Optional) Handle the access to the hosted images. Default: `true` |
| 33 | + |
| 34 | + If `true` Any user can pull images from this project. This is a convenient way for you to share repositories with others. |
| 35 | + |
| 36 | + If `false` Only users who are members of the project can pull images |
| 37 | + |
| 38 | +* `vulnerability_scanning` - (Optional) Activate [Vulnerability Scanning](https://goharbor.io/docs/1.10/administration/vulnerability-scanning/). Default: `true` |
| 39 | + |
| 40 | +* `reuse_sys_cve_whitelist` - (Optional) Whether this project should reuse the system level CVE whitelist as the whitelist of its own. Default: `true` |
| 41 | + |
| 42 | + If `true` The whitelist associated with this project will be ignored. |
| 43 | + |
| 44 | + If `false` The project will use the whitelist defined by `cve_whitelist`. |
| 45 | + |
| 46 | +* `cve_whitelist` - (Optional) List of whitelisted CVE ids for the project. |
| 47 | + |
| 48 | +## Attributes Reference |
| 49 | + |
| 50 | +In addition to all arguments above, the following attributes are exported: |
| 51 | + |
| 52 | +* `id` - Harbor Project ID. |
| 53 | + |
| 54 | +## Import |
| 55 | + |
| 56 | +Harbor Projects can be imported using the `harbor_project`, e.g. |
| 57 | + |
| 58 | +``` |
| 59 | +$ terraform import harbor_project.main 1 |
| 60 | +``` |
0 commit comments