1. Packages
  2. Harbor
  3. API Docs
  4. Project
Harbor v3.10.11 published on Wednesday, Jun 19, 2024 by Pulumiverse

harbor.Project

Explore with Pulumi AI

harbor logo
Harbor v3.10.11 published on Wednesday, Jun 19, 2024 by Pulumiverse

    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)
    }
    

    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"
    }
    

    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,
                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 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 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 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 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 String
    The unique name of the resource.
    args 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()
    {
        CveAllowlists = new[]
        {
            "string",
        },
        DeploymentSecurity = "string",
        EnableContentTrust = false,
        EnableContentTrustCosign = false,
        ForceDestroy = false,
        Name = "string",
        Public = false,
        RegistryId = 0,
        StorageQuota = 0,
        VulnerabilityScanning = false,
    });
    
    example, err := harbor.NewProject(ctx, "projectResource", &harbor.ProjectArgs{
    	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),
    })
    
    var projectResource = new Project("projectResource", ProjectArgs.builder()
        .cveAllowlists("string")
        .deploymentSecurity("string")
        .enableContentTrust(false)
        .enableContentTrustCosign(false)
        .forceDestroy(false)
        .name("string")
        .public_(false)
        .registryId(0)
        .storageQuota(0)
        .vulnerabilityScanning(false)
        .build());
    
    project_resource = harbor.Project("projectResource",
        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)
    
    const projectResource = new harbor.Project("projectResource", {
        cveAllowlists: ["string"],
        deploymentSecurity: "string",
        enableContentTrust: false,
        enableContentTrustCosign: false,
        forceDestroy: false,
        name: "string",
        "public": false,
        registryId: 0,
        storageQuota: 0,
        vulnerabilityScanning: false,
    });
    
    type: harbor:Project
    properties:
        cveAllowlists:
            - string
        deploymentSecurity: string
        enableContentTrust: false
        enableContentTrustCosign: false
        forceDestroy: false
        name: string
        public: false
        registryId: 0
        storageQuota: 0
        vulnerabilityScanning: false
    

    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

    The Project resource accepts the following input properties:

    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 string
    The name of the project that will be created in harbor.
    Public bool
    The project will be public accessibility.(Default: false)
    RegistryId 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)
    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 string
    The name of the project that will be created in harbor.
    Public bool
    The project will be public accessibility.(Default: false)
    RegistryId 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)
    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 String
    The name of the project that will be created in harbor.
    public_ Boolean
    The project will be public accessibility.(Default: false)
    registryId 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)
    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 string
    The name of the project that will be created in harbor.
    public boolean
    The project will be public accessibility.(Default: false)
    registryId 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)
    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 str
    The name of the project that will be created in harbor.
    public bool
    The project will be public accessibility.(Default: false)
    registry_id 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)
    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 String
    The name of the project that will be created in harbor.
    public Boolean
    The project will be public accessibility.(Default: false)
    registryId 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,
            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)
    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:
    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 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 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)
    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 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 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)
    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 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 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)
    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 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 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)
    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 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 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)
    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 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 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
    

    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.
    harbor logo
    Harbor v3.10.11 published on Wednesday, Jun 19, 2024 by Pulumiverse