1. Packages
  2. Packages
  3. Gitlab Provider
  4. API Docs
  5. ProjectSecretDetectionValidityChecks
Viewing docs for GitLab v10.1.1
published on Thursday, Jul 23, 2026 by Pulumi
gitlab logo
Viewing docs for GitLab v10.1.1
published on Thursday, Jul 23, 2026 by Pulumi

    The gitlab.ProjectSecretDetectionValidityChecks resource allows managing whether secret detection validity checks are enabled on a project.

    This resource requires a GitLab Ultimate license, and is available on GitLab.com, GitLab Self-Managed, and GitLab Dedicated.

    Validity checks verify whether detected secrets are still active, reducing false positives in secret detection results.

    When you destroy the resource, you can control if the validity checks setting is kept or not. Set keepSettingsOnDestroy to true (default) to leave the setting as last configured. Set keepSettingsOnDestroy to false to reset it to its pre-Terraform value. The original value is saved in state when you create the resource. You can change the keepSettingsOnDestroy value before destroying the resource to control this behavior.

    Upstream API: GitLab GraphQL API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    const example = new gitlab.Project("example", {name: "example"});
    const exampleProjectSecretDetectionValidityChecks = new gitlab.ProjectSecretDetectionValidityChecks("example", {
        project: example.id,
        validityChecksEnabled: true,
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    example = gitlab.Project("example", name="example")
    example_project_secret_detection_validity_checks = gitlab.ProjectSecretDetectionValidityChecks("example",
        project=example.id,
        validity_checks_enabled=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gitlab/sdk/v10/go/gitlab"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := gitlab.NewProject(ctx, "example", &gitlab.ProjectArgs{
    			Name: pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gitlab.NewProjectSecretDetectionValidityChecks(ctx, "example", &gitlab.ProjectSecretDetectionValidityChecksArgs{
    			Project:               example.ID(),
    			ValidityChecksEnabled: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using GitLab = Pulumi.GitLab;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new GitLab.Project("example", new()
        {
            Name = "example",
        });
    
        var exampleProjectSecretDetectionValidityChecks = new GitLab.ProjectSecretDetectionValidityChecks("example", new()
        {
            Project = example.Id,
            ValidityChecksEnabled = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.Project;
    import com.pulumi.gitlab.ProjectArgs;
    import com.pulumi.gitlab.ProjectSecretDetectionValidityChecks;
    import com.pulumi.gitlab.ProjectSecretDetectionValidityChecksArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new Project("example", ProjectArgs.builder()
                .name("example")
                .build());
    
            var exampleProjectSecretDetectionValidityChecks = new ProjectSecretDetectionValidityChecks("exampleProjectSecretDetectionValidityChecks", ProjectSecretDetectionValidityChecksArgs.builder()
                .project(example.id())
                .validityChecksEnabled(true)
                .build());
    
        }
    }
    
    resources:
      example:
        type: gitlab:Project
        properties:
          name: example
      exampleProjectSecretDetectionValidityChecks:
        type: gitlab:ProjectSecretDetectionValidityChecks
        name: example
        properties:
          project: ${example.id}
          validityChecksEnabled: true
    
    pulumi {
      required_providers {
        gitlab = {
          source = "pulumi/gitlab"
        }
      }
    }
    
    resource "gitlab_project" "example" {
      name = "example"
    }
    resource "gitlab_projectsecretdetectionvaliditychecks" "example" {
      project                 = gitlab_project.example.id
      validity_checks_enabled = true
    }
    

    Create ProjectSecretDetectionValidityChecks Resource

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

    Constructor syntax

    new ProjectSecretDetectionValidityChecks(name: string, args: ProjectSecretDetectionValidityChecksArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectSecretDetectionValidityChecks(resource_name: str,
                                             args: ProjectSecretDetectionValidityChecksArgs,
                                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectSecretDetectionValidityChecks(resource_name: str,
                                             opts: Optional[ResourceOptions] = None,
                                             project: Optional[str] = None,
                                             validity_checks_enabled: Optional[bool] = None,
                                             keep_settings_on_destroy: Optional[bool] = None)
    func NewProjectSecretDetectionValidityChecks(ctx *Context, name string, args ProjectSecretDetectionValidityChecksArgs, opts ...ResourceOption) (*ProjectSecretDetectionValidityChecks, error)
    public ProjectSecretDetectionValidityChecks(string name, ProjectSecretDetectionValidityChecksArgs args, CustomResourceOptions? opts = null)
    public ProjectSecretDetectionValidityChecks(String name, ProjectSecretDetectionValidityChecksArgs args)
    public ProjectSecretDetectionValidityChecks(String name, ProjectSecretDetectionValidityChecksArgs args, CustomResourceOptions options)
    
    type: gitlab:ProjectSecretDetectionValidityChecks
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "gitlab_project_secret_detection_validity_checks" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ProjectSecretDetectionValidityChecksArgs
    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 ProjectSecretDetectionValidityChecksArgs
    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 ProjectSecretDetectionValidityChecksArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectSecretDetectionValidityChecksArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectSecretDetectionValidityChecksArgs
    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 projectSecretDetectionValidityChecksResource = new GitLab.ProjectSecretDetectionValidityChecks("projectSecretDetectionValidityChecksResource", new()
    {
        Project = "string",
        ValidityChecksEnabled = false,
        KeepSettingsOnDestroy = false,
    });
    
    example, err := gitlab.NewProjectSecretDetectionValidityChecks(ctx, "projectSecretDetectionValidityChecksResource", &gitlab.ProjectSecretDetectionValidityChecksArgs{
    	Project:               pulumi.String("string"),
    	ValidityChecksEnabled: pulumi.Bool(false),
    	KeepSettingsOnDestroy: pulumi.Bool(false),
    })
    
    resource "gitlab_project_secret_detection_validity_checks" "projectSecretDetectionValidityChecksResource" {
      lifecycle {
        create_before_destroy = true
      }
      project                  = "string"
      validity_checks_enabled  = false
      keep_settings_on_destroy = false
    }
    
    var projectSecretDetectionValidityChecksResource = new ProjectSecretDetectionValidityChecks("projectSecretDetectionValidityChecksResource", ProjectSecretDetectionValidityChecksArgs.builder()
        .project("string")
        .validityChecksEnabled(false)
        .keepSettingsOnDestroy(false)
        .build());
    
    project_secret_detection_validity_checks_resource = gitlab.ProjectSecretDetectionValidityChecks("projectSecretDetectionValidityChecksResource",
        project="string",
        validity_checks_enabled=False,
        keep_settings_on_destroy=False)
    
    const projectSecretDetectionValidityChecksResource = new gitlab.ProjectSecretDetectionValidityChecks("projectSecretDetectionValidityChecksResource", {
        project: "string",
        validityChecksEnabled: false,
        keepSettingsOnDestroy: false,
    });
    
    type: gitlab:ProjectSecretDetectionValidityChecks
    properties:
        keepSettingsOnDestroy: false
        project: string
        validityChecksEnabled: false
    

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

    Project string
    The ID or full path of the project to change the validity checks setting of.
    ValidityChecksEnabled bool
    Whether to enable secret detection validity checks for the project. Requires a GitLab Ultimate license.
    KeepSettingsOnDestroy bool
    Set to true if the validity checks setting should not be reset to its pre-Terraform value on destroy.
    Project string
    The ID or full path of the project to change the validity checks setting of.
    ValidityChecksEnabled bool
    Whether to enable secret detection validity checks for the project. Requires a GitLab Ultimate license.
    KeepSettingsOnDestroy bool
    Set to true if the validity checks setting should not be reset to its pre-Terraform value on destroy.
    project string
    The ID or full path of the project to change the validity checks setting of.
    validity_checks_enabled bool
    Whether to enable secret detection validity checks for the project. Requires a GitLab Ultimate license.
    keep_settings_on_destroy bool
    Set to true if the validity checks setting should not be reset to its pre-Terraform value on destroy.
    project String
    The ID or full path of the project to change the validity checks setting of.
    validityChecksEnabled Boolean
    Whether to enable secret detection validity checks for the project. Requires a GitLab Ultimate license.
    keepSettingsOnDestroy Boolean
    Set to true if the validity checks setting should not be reset to its pre-Terraform value on destroy.
    project string
    The ID or full path of the project to change the validity checks setting of.
    validityChecksEnabled boolean
    Whether to enable secret detection validity checks for the project. Requires a GitLab Ultimate license.
    keepSettingsOnDestroy boolean
    Set to true if the validity checks setting should not be reset to its pre-Terraform value on destroy.
    project str
    The ID or full path of the project to change the validity checks setting of.
    validity_checks_enabled bool
    Whether to enable secret detection validity checks for the project. Requires a GitLab Ultimate license.
    keep_settings_on_destroy bool
    Set to true if the validity checks setting should not be reset to its pre-Terraform value on destroy.
    project String
    The ID or full path of the project to change the validity checks setting of.
    validityChecksEnabled Boolean
    Whether to enable secret detection validity checks for the project. Requires a GitLab Ultimate license.
    keepSettingsOnDestroy Boolean
    Set to true if the validity checks setting should not be reset to its pre-Terraform value on destroy.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ProjectSecretDetectionValidityChecks Resource

    Get an existing ProjectSecretDetectionValidityChecks 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?: ProjectSecretDetectionValidityChecksState, opts?: CustomResourceOptions): ProjectSecretDetectionValidityChecks
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            keep_settings_on_destroy: Optional[bool] = None,
            project: Optional[str] = None,
            validity_checks_enabled: Optional[bool] = None) -> ProjectSecretDetectionValidityChecks
    func GetProjectSecretDetectionValidityChecks(ctx *Context, name string, id IDInput, state *ProjectSecretDetectionValidityChecksState, opts ...ResourceOption) (*ProjectSecretDetectionValidityChecks, error)
    public static ProjectSecretDetectionValidityChecks Get(string name, Input<string> id, ProjectSecretDetectionValidityChecksState? state, CustomResourceOptions? opts = null)
    public static ProjectSecretDetectionValidityChecks get(String name, Output<String> id, ProjectSecretDetectionValidityChecksState state, CustomResourceOptions options)
    resources:  _:    type: gitlab:ProjectSecretDetectionValidityChecks    get:      id: ${id}
    import {
      to = gitlab_project_secret_detection_validity_checks.example
      id = "${id}"
    }
    
    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:
    KeepSettingsOnDestroy bool
    Set to true if the validity checks setting should not be reset to its pre-Terraform value on destroy.
    Project string
    The ID or full path of the project to change the validity checks setting of.
    ValidityChecksEnabled bool
    Whether to enable secret detection validity checks for the project. Requires a GitLab Ultimate license.
    KeepSettingsOnDestroy bool
    Set to true if the validity checks setting should not be reset to its pre-Terraform value on destroy.
    Project string
    The ID or full path of the project to change the validity checks setting of.
    ValidityChecksEnabled bool
    Whether to enable secret detection validity checks for the project. Requires a GitLab Ultimate license.
    keep_settings_on_destroy bool
    Set to true if the validity checks setting should not be reset to its pre-Terraform value on destroy.
    project string
    The ID or full path of the project to change the validity checks setting of.
    validity_checks_enabled bool
    Whether to enable secret detection validity checks for the project. Requires a GitLab Ultimate license.
    keepSettingsOnDestroy Boolean
    Set to true if the validity checks setting should not be reset to its pre-Terraform value on destroy.
    project String
    The ID or full path of the project to change the validity checks setting of.
    validityChecksEnabled Boolean
    Whether to enable secret detection validity checks for the project. Requires a GitLab Ultimate license.
    keepSettingsOnDestroy boolean
    Set to true if the validity checks setting should not be reset to its pre-Terraform value on destroy.
    project string
    The ID or full path of the project to change the validity checks setting of.
    validityChecksEnabled boolean
    Whether to enable secret detection validity checks for the project. Requires a GitLab Ultimate license.
    keep_settings_on_destroy bool
    Set to true if the validity checks setting should not be reset to its pre-Terraform value on destroy.
    project str
    The ID or full path of the project to change the validity checks setting of.
    validity_checks_enabled bool
    Whether to enable secret detection validity checks for the project. Requires a GitLab Ultimate license.
    keepSettingsOnDestroy Boolean
    Set to true if the validity checks setting should not be reset to its pre-Terraform value on destroy.
    project String
    The ID or full path of the project to change the validity checks setting of.
    validityChecksEnabled Boolean
    Whether to enable secret detection validity checks for the project. Requires a GitLab Ultimate license.

    Import

    Starting in Terraform v1.5.0, you can use an import block to import gitlab.ProjectSecretDetectionValidityChecks. For example:

    Importing using the CLI is supported with the following syntax:

    GitLab project secret detection validity checks can be imported using the project ID or full path, e.g.

    $ pulumi import gitlab:index/projectSecretDetectionValidityChecks:ProjectSecretDetectionValidityChecks example "12345"
    

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

    Package Details

    Repository
    GitLab pulumi/pulumi-gitlab
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the gitlab Terraform Provider.
    gitlab logo
    Viewing docs for GitLab v10.1.1
    published on Thursday, Jul 23, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial