1. Packages
  2. Harbor
  3. API Docs
  4. Project
Harbor v3.10.19 published on Monday, Feb 10, 2025 by Pulumiverse

harbor.Project

Explore with Pulumi AI

Example Usage

Hosted

resource "harbor_project" "main" {
  name                        = "main"
  public                      = false               # (Optional) Default value is false
  vulnerability_scanning      = true                # (Optional) Default value is true. Automatically scan images on push
  enable_content_trust        = true                # (Optional) Default value is false. Deny unsigned images from being pulled (notary)
  enable_content_trust_cosign = false               # (Optional) Default value is false. Deny unsigned images from being pulled (cosign)
  auto_sbom_generation        = true                # (Optional) Default value is false. Automatically generate SBOMs for images
}
Copy

Proxy

resource "harbor_project" "main" {
  name        = "acctest"
  registry_id = harbor_registry.docker.registry_id
}

resource "harbor_registry" "docker" {
  provider_name = "docker-hub"
  name          = "test"
  endpoint_url  = "https://hub.docker.com"
}
Copy

Create Project Resource

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

Constructor syntax

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

@overload
def Project(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            auto_sbom_generation: Optional[bool] = None,
            cve_allowlists: Optional[Sequence[str]] = None,
            deployment_security: Optional[str] = None,
            enable_content_trust: Optional[bool] = None,
            enable_content_trust_cosign: Optional[bool] = None,
            force_destroy: Optional[bool] = None,
            name: Optional[str] = None,
            public: Optional[bool] = None,
            registry_id: Optional[int] = None,
            storage_quota: Optional[int] = None,
            vulnerability_scanning: Optional[bool] = None)
func NewProject(ctx *Context, name string, args *ProjectArgs, opts ...ResourceOption) (*Project, error)
public Project(string name, ProjectArgs? args = null, CustomResourceOptions? opts = null)
public Project(String name, ProjectArgs args)
public Project(String name, ProjectArgs args, CustomResourceOptions options)
type: harbor:Project
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 ProjectArgs
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 ProjectArgs
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 ProjectArgs
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 ProjectArgs
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. ProjectArgs
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 projectResource = new Harbor.Project("projectResource", new()
{
    AutoSbomGeneration = false,
    CveAllowlists = new[]
    {
        "string",
    },
    DeploymentSecurity = "string",
    EnableContentTrust = false,
    EnableContentTrustCosign = false,
    ForceDestroy = false,
    Name = "string",
    Public = false,
    RegistryId = 0,
    StorageQuota = 0,
    VulnerabilityScanning = false,
});
Copy
example, err := harbor.NewProject(ctx, "projectResource", &harbor.ProjectArgs{
	AutoSbomGeneration: pulumi.Bool(false),
	CveAllowlists: pulumi.StringArray{
		pulumi.String("string"),
	},
	DeploymentSecurity:       pulumi.String("string"),
	EnableContentTrust:       pulumi.Bool(false),
	EnableContentTrustCosign: pulumi.Bool(false),
	ForceDestroy:             pulumi.Bool(false),
	Name:                     pulumi.String("string"),
	Public:                   pulumi.Bool(false),
	RegistryId:               pulumi.Int(0),
	StorageQuota:             pulumi.Int(0),
	VulnerabilityScanning:    pulumi.Bool(false),
})
Copy
var projectResource = new Project("projectResource", ProjectArgs.builder()
    .autoSbomGeneration(false)
    .cveAllowlists("string")
    .deploymentSecurity("string")
    .enableContentTrust(false)
    .enableContentTrustCosign(false)
    .forceDestroy(false)
    .name("string")
    .public_(false)
    .registryId(0)
    .storageQuota(0)
    .vulnerabilityScanning(false)
    .build());
Copy
project_resource = harbor.Project("projectResource",
    auto_sbom_generation=False,
    cve_allowlists=["string"],
    deployment_security="string",
    enable_content_trust=False,
    enable_content_trust_cosign=False,
    force_destroy=False,
    name="string",
    public=False,
    registry_id=0,
    storage_quota=0,
    vulnerability_scanning=False)
Copy
const projectResource = new harbor.Project("projectResource", {
    autoSbomGeneration: false,
    cveAllowlists: ["string"],
    deploymentSecurity: "string",
    enableContentTrust: false,
    enableContentTrustCosign: false,
    forceDestroy: false,
    name: "string",
    "public": false,
    registryId: 0,
    storageQuota: 0,
    vulnerabilityScanning: false,
});
Copy
type: harbor:Project
properties:
    autoSbomGeneration: false
    cveAllowlists:
        - string
    deploymentSecurity: string
    enableContentTrust: false
    enableContentTrustCosign: false
    forceDestroy: false
    name: string
    public: false
    registryId: 0
    storageQuota: 0
    vulnerabilityScanning: false
Copy

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

AutoSbomGeneration bool
Automatically generate SBOM for images pushed to this project. (Default: false) can only be used with Harbor version v2.11.0 and above
CveAllowlists List<string>
Project allowlist allows vulnerabilities in this list to be ignored in this project when pushing and pulling images. Should be in the format or ["CVE-123", "CVE-145"] or ["CVE-123"]
DeploymentSecurity string
Prevent deployment of images with vulnerability severity equal or higher than the specified value. Images must be scanned before this takes effect. Possible values: "critical", "high", "medium", "low", "none". (Default: "" - empty)
EnableContentTrust bool
Enables Content Trust for project. When enabled it queries the embedded docker notary server. (Default: false).
EnableContentTrustCosign bool
Enables Content Trust Cosign for project. When enabled it queries Cosign. (Default: false)
ForceDestroy bool
A boolean that indicates all repositories should be deleted from the project so that the project can be destroyed without error. These repositories are not recoverable.
Name Changes to this property will trigger replacement. string
The name of the project that will be created in harbor.
Public bool
The project will be public accessibility.(Default: false)
RegistryId Changes to this property will trigger replacement. int
To enable project as Proxy Cache.
StorageQuota int
The storage quota of the project in GB's.
VulnerabilityScanning bool
Images will be scanned for vulnerabilities when push to harbor. (Default: true)
AutoSbomGeneration bool
Automatically generate SBOM for images pushed to this project. (Default: false) can only be used with Harbor version v2.11.0 and above
CveAllowlists []string
Project allowlist allows vulnerabilities in this list to be ignored in this project when pushing and pulling images. Should be in the format or ["CVE-123", "CVE-145"] or ["CVE-123"]
DeploymentSecurity string
Prevent deployment of images with vulnerability severity equal or higher than the specified value. Images must be scanned before this takes effect. Possible values: "critical", "high", "medium", "low", "none". (Default: "" - empty)
EnableContentTrust bool
Enables Content Trust for project. When enabled it queries the embedded docker notary server. (Default: false).
EnableContentTrustCosign bool
Enables Content Trust Cosign for project. When enabled it queries Cosign. (Default: false)
ForceDestroy bool
A boolean that indicates all repositories should be deleted from the project so that the project can be destroyed without error. These repositories are not recoverable.
Name Changes to this property will trigger replacement. string
The name of the project that will be created in harbor.
Public bool
The project will be public accessibility.(Default: false)
RegistryId Changes to this property will trigger replacement. int
To enable project as Proxy Cache.
StorageQuota int
The storage quota of the project in GB's.
VulnerabilityScanning bool
Images will be scanned for vulnerabilities when push to harbor. (Default: true)
autoSbomGeneration Boolean
Automatically generate SBOM for images pushed to this project. (Default: false) can only be used with Harbor version v2.11.0 and above
cveAllowlists List<String>
Project allowlist allows vulnerabilities in this list to be ignored in this project when pushing and pulling images. Should be in the format or ["CVE-123", "CVE-145"] or ["CVE-123"]
deploymentSecurity String
Prevent deployment of images with vulnerability severity equal or higher than the specified value. Images must be scanned before this takes effect. Possible values: "critical", "high", "medium", "low", "none". (Default: "" - empty)
enableContentTrust Boolean
Enables Content Trust for project. When enabled it queries the embedded docker notary server. (Default: false).
enableContentTrustCosign Boolean
Enables Content Trust Cosign for project. When enabled it queries Cosign. (Default: false)
forceDestroy Boolean
A boolean that indicates all repositories should be deleted from the project so that the project can be destroyed without error. These repositories are not recoverable.
name Changes to this property will trigger replacement. String
The name of the project that will be created in harbor.
public_ Boolean
The project will be public accessibility.(Default: false)
registryId Changes to this property will trigger replacement. Integer
To enable project as Proxy Cache.
storageQuota Integer
The storage quota of the project in GB's.
vulnerabilityScanning Boolean
Images will be scanned for vulnerabilities when push to harbor. (Default: true)
autoSbomGeneration boolean
Automatically generate SBOM for images pushed to this project. (Default: false) can only be used with Harbor version v2.11.0 and above
cveAllowlists string[]
Project allowlist allows vulnerabilities in this list to be ignored in this project when pushing and pulling images. Should be in the format or ["CVE-123", "CVE-145"] or ["CVE-123"]
deploymentSecurity string
Prevent deployment of images with vulnerability severity equal or higher than the specified value. Images must be scanned before this takes effect. Possible values: "critical", "high", "medium", "low", "none". (Default: "" - empty)
enableContentTrust boolean
Enables Content Trust for project. When enabled it queries the embedded docker notary server. (Default: false).
enableContentTrustCosign boolean
Enables Content Trust Cosign for project. When enabled it queries Cosign. (Default: false)
forceDestroy boolean
A boolean that indicates all repositories should be deleted from the project so that the project can be destroyed without error. These repositories are not recoverable.
name Changes to this property will trigger replacement. string
The name of the project that will be created in harbor.
public boolean
The project will be public accessibility.(Default: false)
registryId Changes to this property will trigger replacement. number
To enable project as Proxy Cache.
storageQuota number
The storage quota of the project in GB's.
vulnerabilityScanning boolean
Images will be scanned for vulnerabilities when push to harbor. (Default: true)
auto_sbom_generation bool
Automatically generate SBOM for images pushed to this project. (Default: false) can only be used with Harbor version v2.11.0 and above
cve_allowlists Sequence[str]
Project allowlist allows vulnerabilities in this list to be ignored in this project when pushing and pulling images. Should be in the format or ["CVE-123", "CVE-145"] or ["CVE-123"]
deployment_security str
Prevent deployment of images with vulnerability severity equal or higher than the specified value. Images must be scanned before this takes effect. Possible values: "critical", "high", "medium", "low", "none". (Default: "" - empty)
enable_content_trust bool
Enables Content Trust for project. When enabled it queries the embedded docker notary server. (Default: false).
enable_content_trust_cosign bool
Enables Content Trust Cosign for project. When enabled it queries Cosign. (Default: false)
force_destroy bool
A boolean that indicates all repositories should be deleted from the project so that the project can be destroyed without error. These repositories are not recoverable.
name Changes to this property will trigger replacement. str
The name of the project that will be created in harbor.
public bool
The project will be public accessibility.(Default: false)
registry_id Changes to this property will trigger replacement. int
To enable project as Proxy Cache.
storage_quota int
The storage quota of the project in GB's.
vulnerability_scanning bool
Images will be scanned for vulnerabilities when push to harbor. (Default: true)
autoSbomGeneration Boolean
Automatically generate SBOM for images pushed to this project. (Default: false) can only be used with Harbor version v2.11.0 and above
cveAllowlists List<String>
Project allowlist allows vulnerabilities in this list to be ignored in this project when pushing and pulling images. Should be in the format or ["CVE-123", "CVE-145"] or ["CVE-123"]
deploymentSecurity String
Prevent deployment of images with vulnerability severity equal or higher than the specified value. Images must be scanned before this takes effect. Possible values: "critical", "high", "medium", "low", "none". (Default: "" - empty)
enableContentTrust Boolean
Enables Content Trust for project. When enabled it queries the embedded docker notary server. (Default: false).
enableContentTrustCosign Boolean
Enables Content Trust Cosign for project. When enabled it queries Cosign. (Default: false)
forceDestroy Boolean
A boolean that indicates all repositories should be deleted from the project so that the project can be destroyed without error. These repositories are not recoverable.
name Changes to this property will trigger replacement. String
The name of the project that will be created in harbor.
public Boolean
The project will be public accessibility.(Default: false)
registryId Changes to this property will trigger replacement. Number
To enable project as Proxy Cache.
storageQuota Number
The storage quota of the project in GB's.
vulnerabilityScanning Boolean
Images will be scanned for vulnerabilities when push to harbor. (Default: true)

Outputs

All input properties are implicitly available as output properties. Additionally, the Project resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
ProjectId int
The project id of this resource.
Id string
The provider-assigned unique ID for this managed resource.
ProjectId int
The project id of this resource.
id String
The provider-assigned unique ID for this managed resource.
projectId Integer
The project id of this resource.
id string
The provider-assigned unique ID for this managed resource.
projectId number
The project id of this resource.
id str
The provider-assigned unique ID for this managed resource.
project_id int
The project id of this resource.
id String
The provider-assigned unique ID for this managed resource.
projectId Number
The project id of this resource.

Look up Existing Project Resource

Get an existing Project 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?: ProjectState, opts?: CustomResourceOptions): Project
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        auto_sbom_generation: Optional[bool] = None,
        cve_allowlists: Optional[Sequence[str]] = None,
        deployment_security: Optional[str] = None,
        enable_content_trust: Optional[bool] = None,
        enable_content_trust_cosign: Optional[bool] = None,
        force_destroy: Optional[bool] = None,
        name: Optional[str] = None,
        project_id: Optional[int] = None,
        public: Optional[bool] = None,
        registry_id: Optional[int] = None,
        storage_quota: Optional[int] = None,
        vulnerability_scanning: Optional[bool] = None) -> Project
func GetProject(ctx *Context, name string, id IDInput, state *ProjectState, opts ...ResourceOption) (*Project, error)
public static Project Get(string name, Input<string> id, ProjectState? state, CustomResourceOptions? opts = null)
public static Project get(String name, Output<String> id, ProjectState state, CustomResourceOptions options)
resources:  _:    type: harbor:Project    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:
AutoSbomGeneration bool
Automatically generate SBOM for images pushed to this project. (Default: false) can only be used with Harbor version v2.11.0 and above
CveAllowlists List<string>
Project allowlist allows vulnerabilities in this list to be ignored in this project when pushing and pulling images. Should be in the format or ["CVE-123", "CVE-145"] or ["CVE-123"]
DeploymentSecurity string
Prevent deployment of images with vulnerability severity equal or higher than the specified value. Images must be scanned before this takes effect. Possible values: "critical", "high", "medium", "low", "none". (Default: "" - empty)
EnableContentTrust bool
Enables Content Trust for project. When enabled it queries the embedded docker notary server. (Default: false).
EnableContentTrustCosign bool
Enables Content Trust Cosign for project. When enabled it queries Cosign. (Default: false)
ForceDestroy bool
A boolean that indicates all repositories should be deleted from the project so that the project can be destroyed without error. These repositories are not recoverable.
Name Changes to this property will trigger replacement. string
The name of the project that will be created in harbor.
ProjectId int
The project id of this resource.
Public bool
The project will be public accessibility.(Default: false)
RegistryId Changes to this property will trigger replacement. int
To enable project as Proxy Cache.
StorageQuota int
The storage quota of the project in GB's.
VulnerabilityScanning bool
Images will be scanned for vulnerabilities when push to harbor. (Default: true)
AutoSbomGeneration bool
Automatically generate SBOM for images pushed to this project. (Default: false) can only be used with Harbor version v2.11.0 and above
CveAllowlists []string
Project allowlist allows vulnerabilities in this list to be ignored in this project when pushing and pulling images. Should be in the format or ["CVE-123", "CVE-145"] or ["CVE-123"]
DeploymentSecurity string
Prevent deployment of images with vulnerability severity equal or higher than the specified value. Images must be scanned before this takes effect. Possible values: "critical", "high", "medium", "low", "none". (Default: "" - empty)
EnableContentTrust bool
Enables Content Trust for project. When enabled it queries the embedded docker notary server. (Default: false).
EnableContentTrustCosign bool
Enables Content Trust Cosign for project. When enabled it queries Cosign. (Default: false)
ForceDestroy bool
A boolean that indicates all repositories should be deleted from the project so that the project can be destroyed without error. These repositories are not recoverable.
Name Changes to this property will trigger replacement. string
The name of the project that will be created in harbor.
ProjectId int
The project id of this resource.
Public bool
The project will be public accessibility.(Default: false)
RegistryId Changes to this property will trigger replacement. int
To enable project as Proxy Cache.
StorageQuota int
The storage quota of the project in GB's.
VulnerabilityScanning bool
Images will be scanned for vulnerabilities when push to harbor. (Default: true)
autoSbomGeneration Boolean
Automatically generate SBOM for images pushed to this project. (Default: false) can only be used with Harbor version v2.11.0 and above
cveAllowlists List<String>
Project allowlist allows vulnerabilities in this list to be ignored in this project when pushing and pulling images. Should be in the format or ["CVE-123", "CVE-145"] or ["CVE-123"]
deploymentSecurity String
Prevent deployment of images with vulnerability severity equal or higher than the specified value. Images must be scanned before this takes effect. Possible values: "critical", "high", "medium", "low", "none". (Default: "" - empty)
enableContentTrust Boolean
Enables Content Trust for project. When enabled it queries the embedded docker notary server. (Default: false).
enableContentTrustCosign Boolean
Enables Content Trust Cosign for project. When enabled it queries Cosign. (Default: false)
forceDestroy Boolean
A boolean that indicates all repositories should be deleted from the project so that the project can be destroyed without error. These repositories are not recoverable.
name Changes to this property will trigger replacement. String
The name of the project that will be created in harbor.
projectId Integer
The project id of this resource.
public_ Boolean
The project will be public accessibility.(Default: false)
registryId Changes to this property will trigger replacement. Integer
To enable project as Proxy Cache.
storageQuota Integer
The storage quota of the project in GB's.
vulnerabilityScanning Boolean
Images will be scanned for vulnerabilities when push to harbor. (Default: true)
autoSbomGeneration boolean
Automatically generate SBOM for images pushed to this project. (Default: false) can only be used with Harbor version v2.11.0 and above
cveAllowlists string[]
Project allowlist allows vulnerabilities in this list to be ignored in this project when pushing and pulling images. Should be in the format or ["CVE-123", "CVE-145"] or ["CVE-123"]
deploymentSecurity string
Prevent deployment of images with vulnerability severity equal or higher than the specified value. Images must be scanned before this takes effect. Possible values: "critical", "high", "medium", "low", "none". (Default: "" - empty)
enableContentTrust boolean
Enables Content Trust for project. When enabled it queries the embedded docker notary server. (Default: false).
enableContentTrustCosign boolean
Enables Content Trust Cosign for project. When enabled it queries Cosign. (Default: false)
forceDestroy boolean
A boolean that indicates all repositories should be deleted from the project so that the project can be destroyed without error. These repositories are not recoverable.
name Changes to this property will trigger replacement. string
The name of the project that will be created in harbor.
projectId number
The project id of this resource.
public boolean
The project will be public accessibility.(Default: false)
registryId Changes to this property will trigger replacement. number
To enable project as Proxy Cache.
storageQuota number
The storage quota of the project in GB's.
vulnerabilityScanning boolean
Images will be scanned for vulnerabilities when push to harbor. (Default: true)
auto_sbom_generation bool
Automatically generate SBOM for images pushed to this project. (Default: false) can only be used with Harbor version v2.11.0 and above
cve_allowlists Sequence[str]
Project allowlist allows vulnerabilities in this list to be ignored in this project when pushing and pulling images. Should be in the format or ["CVE-123", "CVE-145"] or ["CVE-123"]
deployment_security str
Prevent deployment of images with vulnerability severity equal or higher than the specified value. Images must be scanned before this takes effect. Possible values: "critical", "high", "medium", "low", "none". (Default: "" - empty)
enable_content_trust bool
Enables Content Trust for project. When enabled it queries the embedded docker notary server. (Default: false).
enable_content_trust_cosign bool
Enables Content Trust Cosign for project. When enabled it queries Cosign. (Default: false)
force_destroy bool
A boolean that indicates all repositories should be deleted from the project so that the project can be destroyed without error. These repositories are not recoverable.
name Changes to this property will trigger replacement. str
The name of the project that will be created in harbor.
project_id int
The project id of this resource.
public bool
The project will be public accessibility.(Default: false)
registry_id Changes to this property will trigger replacement. int
To enable project as Proxy Cache.
storage_quota int
The storage quota of the project in GB's.
vulnerability_scanning bool
Images will be scanned for vulnerabilities when push to harbor. (Default: true)
autoSbomGeneration Boolean
Automatically generate SBOM for images pushed to this project. (Default: false) can only be used with Harbor version v2.11.0 and above
cveAllowlists List<String>
Project allowlist allows vulnerabilities in this list to be ignored in this project when pushing and pulling images. Should be in the format or ["CVE-123", "CVE-145"] or ["CVE-123"]
deploymentSecurity String
Prevent deployment of images with vulnerability severity equal or higher than the specified value. Images must be scanned before this takes effect. Possible values: "critical", "high", "medium", "low", "none". (Default: "" - empty)
enableContentTrust Boolean
Enables Content Trust for project. When enabled it queries the embedded docker notary server. (Default: false).
enableContentTrustCosign Boolean
Enables Content Trust Cosign for project. When enabled it queries Cosign. (Default: false)
forceDestroy Boolean
A boolean that indicates all repositories should be deleted from the project so that the project can be destroyed without error. These repositories are not recoverable.
name Changes to this property will trigger replacement. String
The name of the project that will be created in harbor.
projectId Number
The project id of this resource.
public Boolean
The project will be public accessibility.(Default: false)
registryId Changes to this property will trigger replacement. Number
To enable project as Proxy Cache.
storageQuota Number
The storage quota of the project in GB's.
vulnerabilityScanning Boolean
Images will be scanned for vulnerabilities when push to harbor. (Default: true)

Import

$ pulumi import harbor:index/project:Project main /projects/1
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
harbor pulumiverse/pulumi-harbor
License
Apache-2.0
Notes
This Pulumi package is based on the harbor Terraform Provider.