1. Registry
  2. Packages
  3. Gitlab Provider
  4. API Docs
  5. ComplianceRequirement
Viewing docs for GitLab v10.2.0
published on Wednesday, Aug 26, 2026 by Pulumi
gitlab logo
Viewing docs for GitLab v10.2.0
published on Wednesday, Aug 26, 2026 by Pulumi

    The gitlab.ComplianceRequirement resource allows managing the lifecycle of a compliance requirement within a compliance framework.

    Compliance requirements define specific compliance conditions that projects must meet, with associated controls that specify how compliance is verified.

    This resource requires a GitLab Enterprise instance with an Ultimate license.

    Upstream API: GitLab GraphQL API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    // Example: Create a compliance requirement with an internal control
    const internalControl = new gitlab.ComplianceRequirement("internal_control", {
        frameworkId: example.frameworkId,
        namespacePath: example.namespacePath,
        name: "Dependency Scanning Required",
        description: "Ensures dependency scanning is enabled and running",
        internalControls: [{
            name: "scanner_dep_scanning_running",
            expression: {
                field: "scanner_dep_scanning_running",
                operator: "=",
                value: "true",
            },
        }],
    });
    // Example: Create a compliance requirement with an external control
    const externalControl = new gitlab.ComplianceRequirement("external_control", {
        frameworkId: example.frameworkId,
        namespacePath: example.namespacePath,
        name: "External Security Check",
        description: "Verifies compliance via an external security service",
        externalControls: [{
            externalUrl: "https://example.com/compliance-check",
            secretToken: "my-secret-token",
            pingEnabled: true,
        }],
    });
    // Example: Create a compliance requirement with an external control with all options
    const externalControlAllOptions = new gitlab.ComplianceRequirement("external_control_all_options", {
        frameworkId: example.frameworkId,
        namespacePath: example.namespacePath,
        name: "External Security Check with All Options",
        description: "Verifies compliance via an external security service with all options configured",
        externalControls: [{
            externalUrl: "https://example.com/compliance-check",
            secretToken: "my-secret-token",
            externalControlName: "My External Control",
            pingEnabled: false,
        }],
    });
    // Example: Create a compliance requriement with both internal and external controls
    const internalAndExternalControls = new gitlab.ComplianceRequirement("internal_and_external_controls", {
        frameworkId: example.frameworkId,
        namespacePath: example.namespacePath,
        name: "Combined Security Check",
        description: "Verifies compliance via both internal and external controls",
        internalControls: [{
            name: "scanner_dep_scanning_running",
            expression: {
                field: "scanner_dep_scanning_running",
                operator: "=",
                value: "true",
            },
        }],
        externalControls: [{
            externalUrl: "https://example.com/compliance-check",
            secretToken: "my-secret-token",
            pingEnabled: true,
        }],
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    # Example: Create a compliance requirement with an internal control
    internal_control = gitlab.ComplianceRequirement("internal_control",
        framework_id=example["frameworkId"],
        namespace_path=example["namespacePath"],
        name="Dependency Scanning Required",
        description="Ensures dependency scanning is enabled and running",
        internal_controls=[{
            "name": "scanner_dep_scanning_running",
            "expression": {
                "field": "scanner_dep_scanning_running",
                "operator": "=",
                "value": "true",
            },
        }])
    # Example: Create a compliance requirement with an external control
    external_control = gitlab.ComplianceRequirement("external_control",
        framework_id=example["frameworkId"],
        namespace_path=example["namespacePath"],
        name="External Security Check",
        description="Verifies compliance via an external security service",
        external_controls=[{
            "external_url": "https://example.com/compliance-check",
            "secret_token": "my-secret-token",
            "ping_enabled": True,
        }])
    # Example: Create a compliance requirement with an external control with all options
    external_control_all_options = gitlab.ComplianceRequirement("external_control_all_options",
        framework_id=example["frameworkId"],
        namespace_path=example["namespacePath"],
        name="External Security Check with All Options",
        description="Verifies compliance via an external security service with all options configured",
        external_controls=[{
            "external_url": "https://example.com/compliance-check",
            "secret_token": "my-secret-token",
            "external_control_name": "My External Control",
            "ping_enabled": False,
        }])
    # Example: Create a compliance requriement with both internal and external controls
    internal_and_external_controls = gitlab.ComplianceRequirement("internal_and_external_controls",
        framework_id=example["frameworkId"],
        namespace_path=example["namespacePath"],
        name="Combined Security Check",
        description="Verifies compliance via both internal and external controls",
        internal_controls=[{
            "name": "scanner_dep_scanning_running",
            "expression": {
                "field": "scanner_dep_scanning_running",
                "operator": "=",
                "value": "true",
            },
        }],
        external_controls=[{
            "external_url": "https://example.com/compliance-check",
            "secret_token": "my-secret-token",
            "ping_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: Create a compliance requirement with an internal control
    		_, err := gitlab.NewComplianceRequirement(ctx, "internal_control", &gitlab.ComplianceRequirementArgs{
    			FrameworkId:   pulumi.Any(example.FrameworkId),
    			NamespacePath: pulumi.Any(example.NamespacePath),
    			Name:          pulumi.String("Dependency Scanning Required"),
    			Description:   pulumi.String("Ensures dependency scanning is enabled and running"),
    			InternalControls: gitlab.ComplianceRequirementInternalControlArray{
    				&gitlab.ComplianceRequirementInternalControlArgs{
    					Name: pulumi.String("scanner_dep_scanning_running"),
    					Expression: &gitlab.ComplianceRequirementInternalControlExpressionArgs{
    						Field:    pulumi.String("scanner_dep_scanning_running"),
    						Operator: pulumi.String("="),
    						Value:    pulumi.String("true"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Example: Create a compliance requirement with an external control
    		_, err = gitlab.NewComplianceRequirement(ctx, "external_control", &gitlab.ComplianceRequirementArgs{
    			FrameworkId:   pulumi.Any(example.FrameworkId),
    			NamespacePath: pulumi.Any(example.NamespacePath),
    			Name:          pulumi.String("External Security Check"),
    			Description:   pulumi.String("Verifies compliance via an external security service"),
    			ExternalControls: gitlab.ComplianceRequirementExternalControlArray{
    				&gitlab.ComplianceRequirementExternalControlArgs{
    					ExternalUrl: pulumi.String("https://example.com/compliance-check"),
    					SecretToken: pulumi.String("my-secret-token"),
    					PingEnabled: pulumi.Bool(true),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Example: Create a compliance requirement with an external control with all options
    		_, err = gitlab.NewComplianceRequirement(ctx, "external_control_all_options", &gitlab.ComplianceRequirementArgs{
    			FrameworkId:   pulumi.Any(example.FrameworkId),
    			NamespacePath: pulumi.Any(example.NamespacePath),
    			Name:          pulumi.String("External Security Check with All Options"),
    			Description:   pulumi.String("Verifies compliance via an external security service with all options configured"),
    			ExternalControls: gitlab.ComplianceRequirementExternalControlArray{
    				&gitlab.ComplianceRequirementExternalControlArgs{
    					ExternalUrl:         pulumi.String("https://example.com/compliance-check"),
    					SecretToken:         pulumi.String("my-secret-token"),
    					ExternalControlName: pulumi.String("My External Control"),
    					PingEnabled:         pulumi.Bool(false),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Example: Create a compliance requriement with both internal and external controls
    		_, err = gitlab.NewComplianceRequirement(ctx, "internal_and_external_controls", &gitlab.ComplianceRequirementArgs{
    			FrameworkId:   pulumi.Any(example.FrameworkId),
    			NamespacePath: pulumi.Any(example.NamespacePath),
    			Name:          pulumi.String("Combined Security Check"),
    			Description:   pulumi.String("Verifies compliance via both internal and external controls"),
    			InternalControls: gitlab.ComplianceRequirementInternalControlArray{
    				&gitlab.ComplianceRequirementInternalControlArgs{
    					Name: pulumi.String("scanner_dep_scanning_running"),
    					Expression: &gitlab.ComplianceRequirementInternalControlExpressionArgs{
    						Field:    pulumi.String("scanner_dep_scanning_running"),
    						Operator: pulumi.String("="),
    						Value:    pulumi.String("true"),
    					},
    				},
    			},
    			ExternalControls: gitlab.ComplianceRequirementExternalControlArray{
    				&gitlab.ComplianceRequirementExternalControlArgs{
    					ExternalUrl: pulumi.String("https://example.com/compliance-check"),
    					SecretToken: pulumi.String("my-secret-token"),
    					PingEnabled: 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(() => 
    {
        // Example: Create a compliance requirement with an internal control
        var internalControl = new GitLab.ComplianceRequirement("internal_control", new()
        {
            FrameworkId = example.FrameworkId,
            NamespacePath = example.NamespacePath,
            Name = "Dependency Scanning Required",
            Description = "Ensures dependency scanning is enabled and running",
            InternalControls = new[]
            {
                new GitLab.Inputs.ComplianceRequirementInternalControlArgs
                {
                    Name = "scanner_dep_scanning_running",
                    Expression = new GitLab.Inputs.ComplianceRequirementInternalControlExpressionArgs
                    {
                        Field = "scanner_dep_scanning_running",
                        Operator = "=",
                        Value = "true",
                    },
                },
            },
        });
    
        // Example: Create a compliance requirement with an external control
        var externalControl = new GitLab.ComplianceRequirement("external_control", new()
        {
            FrameworkId = example.FrameworkId,
            NamespacePath = example.NamespacePath,
            Name = "External Security Check",
            Description = "Verifies compliance via an external security service",
            ExternalControls = new[]
            {
                new GitLab.Inputs.ComplianceRequirementExternalControlArgs
                {
                    ExternalUrl = "https://example.com/compliance-check",
                    SecretToken = "my-secret-token",
                    PingEnabled = true,
                },
            },
        });
    
        // Example: Create a compliance requirement with an external control with all options
        var externalControlAllOptions = new GitLab.ComplianceRequirement("external_control_all_options", new()
        {
            FrameworkId = example.FrameworkId,
            NamespacePath = example.NamespacePath,
            Name = "External Security Check with All Options",
            Description = "Verifies compliance via an external security service with all options configured",
            ExternalControls = new[]
            {
                new GitLab.Inputs.ComplianceRequirementExternalControlArgs
                {
                    ExternalUrl = "https://example.com/compliance-check",
                    SecretToken = "my-secret-token",
                    ExternalControlName = "My External Control",
                    PingEnabled = false,
                },
            },
        });
    
        // Example: Create a compliance requriement with both internal and external controls
        var internalAndExternalControls = new GitLab.ComplianceRequirement("internal_and_external_controls", new()
        {
            FrameworkId = example.FrameworkId,
            NamespacePath = example.NamespacePath,
            Name = "Combined Security Check",
            Description = "Verifies compliance via both internal and external controls",
            InternalControls = new[]
            {
                new GitLab.Inputs.ComplianceRequirementInternalControlArgs
                {
                    Name = "scanner_dep_scanning_running",
                    Expression = new GitLab.Inputs.ComplianceRequirementInternalControlExpressionArgs
                    {
                        Field = "scanner_dep_scanning_running",
                        Operator = "=",
                        Value = "true",
                    },
                },
            },
            ExternalControls = new[]
            {
                new GitLab.Inputs.ComplianceRequirementExternalControlArgs
                {
                    ExternalUrl = "https://example.com/compliance-check",
                    SecretToken = "my-secret-token",
                    PingEnabled = true,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.ComplianceRequirement;
    import com.pulumi.gitlab.ComplianceRequirementArgs;
    import com.pulumi.gitlab.inputs.ComplianceRequirementInternalControlArgs;
    import com.pulumi.gitlab.inputs.ComplianceRequirementInternalControlExpressionArgs;
    import com.pulumi.gitlab.inputs.ComplianceRequirementExternalControlArgs;
    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) {
            // Example: Create a compliance requirement with an internal control
            var internalControl = new ComplianceRequirement("internalControl", ComplianceRequirementArgs.builder()
                .frameworkId(example.frameworkId())
                .namespacePath(example.namespacePath())
                .name("Dependency Scanning Required")
                .description("Ensures dependency scanning is enabled and running")
                .internalControls(ComplianceRequirementInternalControlArgs.builder()
                    .name("scanner_dep_scanning_running")
                    .expression(ComplianceRequirementInternalControlExpressionArgs.builder()
                        .field("scanner_dep_scanning_running")
                        .operator("=")
                        .value("true")
                        .build())
                    .build())
                .build());
    
            // Example: Create a compliance requirement with an external control
            var externalControl = new ComplianceRequirement("externalControl", ComplianceRequirementArgs.builder()
                .frameworkId(example.frameworkId())
                .namespacePath(example.namespacePath())
                .name("External Security Check")
                .description("Verifies compliance via an external security service")
                .externalControls(ComplianceRequirementExternalControlArgs.builder()
                    .externalUrl("https://example.com/compliance-check")
                    .secretToken("my-secret-token")
                    .pingEnabled(true)
                    .build())
                .build());
    
            // Example: Create a compliance requirement with an external control with all options
            var externalControlAllOptions = new ComplianceRequirement("externalControlAllOptions", ComplianceRequirementArgs.builder()
                .frameworkId(example.frameworkId())
                .namespacePath(example.namespacePath())
                .name("External Security Check with All Options")
                .description("Verifies compliance via an external security service with all options configured")
                .externalControls(ComplianceRequirementExternalControlArgs.builder()
                    .externalUrl("https://example.com/compliance-check")
                    .secretToken("my-secret-token")
                    .externalControlName("My External Control")
                    .pingEnabled(false)
                    .build())
                .build());
    
            // Example: Create a compliance requriement with both internal and external controls
            var internalAndExternalControls = new ComplianceRequirement("internalAndExternalControls", ComplianceRequirementArgs.builder()
                .frameworkId(example.frameworkId())
                .namespacePath(example.namespacePath())
                .name("Combined Security Check")
                .description("Verifies compliance via both internal and external controls")
                .internalControls(ComplianceRequirementInternalControlArgs.builder()
                    .name("scanner_dep_scanning_running")
                    .expression(ComplianceRequirementInternalControlExpressionArgs.builder()
                        .field("scanner_dep_scanning_running")
                        .operator("=")
                        .value("true")
                        .build())
                    .build())
                .externalControls(ComplianceRequirementExternalControlArgs.builder()
                    .externalUrl("https://example.com/compliance-check")
                    .secretToken("my-secret-token")
                    .pingEnabled(true)
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Example: Create a compliance requirement with an internal control
      internalControl:
        type: gitlab:ComplianceRequirement
        name: internal_control
        properties:
          frameworkId: ${example.frameworkId}
          namespacePath: ${example.namespacePath}
          name: Dependency Scanning Required
          description: Ensures dependency scanning is enabled and running
          internalControls:
            - name: scanner_dep_scanning_running
              expression:
                field: scanner_dep_scanning_running
                operator: =
                value: 'true'
      # Example: Create a compliance requirement with an external control
      externalControl:
        type: gitlab:ComplianceRequirement
        name: external_control
        properties:
          frameworkId: ${example.frameworkId}
          namespacePath: ${example.namespacePath}
          name: External Security Check
          description: Verifies compliance via an external security service
          externalControls:
            - externalUrl: https://example.com/compliance-check
              secretToken: my-secret-token
              pingEnabled: true
      # Example: Create a compliance requirement with an external control with all options
      externalControlAllOptions:
        type: gitlab:ComplianceRequirement
        name: external_control_all_options
        properties:
          frameworkId: ${example.frameworkId}
          namespacePath: ${example.namespacePath}
          name: External Security Check with All Options
          description: Verifies compliance via an external security service with all options configured
          externalControls:
            - externalUrl: https://example.com/compliance-check
              secretToken: my-secret-token
              externalControlName: My External Control
              pingEnabled: false
      # Example: Create a compliance requriement with both internal and external controls
      internalAndExternalControls:
        type: gitlab:ComplianceRequirement
        name: internal_and_external_controls
        properties:
          frameworkId: ${example.frameworkId}
          namespacePath: ${example.namespacePath}
          name: Combined Security Check
          description: Verifies compliance via both internal and external controls
          internalControls:
            - name: scanner_dep_scanning_running
              expression:
                field: scanner_dep_scanning_running
                operator: =
                value: 'true'
          externalControls:
            - externalUrl: https://example.com/compliance-check
              secretToken: my-secret-token
              pingEnabled: true
    
    pulumi {
      required_providers {
        gitlab = {
          source = "pulumi/gitlab"
        }
      }
    }
    
    # Example: Create a compliance requirement with an internal control
    resource "gitlab_compliancerequirement" "internal_control" {
      framework_id   = example.frameworkId
      namespace_path = example.namespacePath
      name           = "Dependency Scanning Required"
      description    = "Ensures dependency scanning is enabled and running"
      internal_controls {
        name = "scanner_dep_scanning_running"
        expression = {
          field    = "scanner_dep_scanning_running"
          operator = "="
          value    = "true"
        }
      }
    }
    # Example: Create a compliance requirement with an external control
    resource "gitlab_compliancerequirement" "external_control" {
      framework_id   = example.frameworkId
      namespace_path = example.namespacePath
      name           = "External Security Check"
      description    = "Verifies compliance via an external security service"
      external_controls {
        external_url = "https://example.com/compliance-check"
        secret_token = "my-secret-token"
        ping_enabled = true
      }
    }
    # Example: Create a compliance requirement with an external control with all options
    resource "gitlab_compliancerequirement" "external_control_all_options" {
      framework_id   = example.frameworkId
      namespace_path = example.namespacePath
      name           = "External Security Check with All Options"
      description    = "Verifies compliance via an external security service with all options configured"
      external_controls {
        external_url          = "https://example.com/compliance-check"
        secret_token          = "my-secret-token"
        external_control_name = "My External Control"
        ping_enabled          = false
      }
    }
    # Example: Create a compliance requriement with both internal and external controls
    resource "gitlab_compliancerequirement" "internal_and_external_controls" {
      framework_id   = example.frameworkId
      namespace_path = example.namespacePath
      name           = "Combined Security Check"
      description    = "Verifies compliance via both internal and external controls"
      internal_controls {
        name = "scanner_dep_scanning_running"
        expression = {
          field    = "scanner_dep_scanning_running"
          operator = "="
          value    = "true"
        }
      }
      external_controls {
        external_url = "https://example.com/compliance-check"
        secret_token = "my-secret-token"
        ping_enabled = true
      }
    }
    

    Create ComplianceRequirement Resource

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

    Constructor syntax

    new ComplianceRequirement(name: string, args: ComplianceRequirementArgs, opts?: CustomResourceOptions);
    @overload
    def ComplianceRequirement(resource_name: str,
                              args: ComplianceRequirementArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def ComplianceRequirement(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              description: Optional[str] = None,
                              framework_id: Optional[str] = None,
                              namespace_path: Optional[str] = None,
                              external_controls: Optional[Sequence[ComplianceRequirementExternalControlArgs]] = None,
                              internal_controls: Optional[Sequence[ComplianceRequirementInternalControlArgs]] = None,
                              name: Optional[str] = None)
    func NewComplianceRequirement(ctx *Context, name string, args ComplianceRequirementArgs, opts ...ResourceOption) (*ComplianceRequirement, error)
    public ComplianceRequirement(string name, ComplianceRequirementArgs args, CustomResourceOptions? opts = null)
    public ComplianceRequirement(String name, ComplianceRequirementArgs args)
    public ComplianceRequirement(String name, ComplianceRequirementArgs args, CustomResourceOptions options)
    
    type: gitlab:ComplianceRequirement
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "gitlab_compliance_requirement" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ComplianceRequirementArgs
    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 ComplianceRequirementArgs
    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 ComplianceRequirementArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ComplianceRequirementArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ComplianceRequirementArgs
    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 complianceRequirementResource = new GitLab.ComplianceRequirement("complianceRequirementResource", new()
    {
        Description = "string",
        FrameworkId = "string",
        NamespacePath = "string",
        ExternalControls = new[]
        {
            new GitLab.Inputs.ComplianceRequirementExternalControlArgs
            {
                ExternalUrl = "string",
                PingEnabled = false,
                SecretToken = "string",
                ExternalControlName = "string",
                Id = "string",
                Name = "string",
            },
        },
        InternalControls = new[]
        {
            new GitLab.Inputs.ComplianceRequirementInternalControlArgs
            {
                Expression = new GitLab.Inputs.ComplianceRequirementInternalControlExpressionArgs
                {
                    Field = "string",
                    Operator = "string",
                    Value = "string",
                },
                Name = "string",
                Id = "string",
            },
        },
        Name = "string",
    });
    
    example, err := gitlab.NewComplianceRequirement(ctx, "complianceRequirementResource", &gitlab.ComplianceRequirementArgs{
    	Description:   pulumi.String("string"),
    	FrameworkId:   pulumi.String("string"),
    	NamespacePath: pulumi.String("string"),
    	ExternalControls: gitlab.ComplianceRequirementExternalControlArray{
    		&gitlab.ComplianceRequirementExternalControlArgs{
    			ExternalUrl:         pulumi.String("string"),
    			PingEnabled:         pulumi.Bool(false),
    			SecretToken:         pulumi.String("string"),
    			ExternalControlName: pulumi.String("string"),
    			Id:                  pulumi.String("string"),
    			Name:                pulumi.String("string"),
    		},
    	},
    	InternalControls: gitlab.ComplianceRequirementInternalControlArray{
    		&gitlab.ComplianceRequirementInternalControlArgs{
    			Expression: &gitlab.ComplianceRequirementInternalControlExpressionArgs{
    				Field:    pulumi.String("string"),
    				Operator: pulumi.String("string"),
    				Value:    pulumi.String("string"),
    			},
    			Name: pulumi.String("string"),
    			Id:   pulumi.String("string"),
    		},
    	},
    	Name: pulumi.String("string"),
    })
    
    resource "gitlab_compliance_requirement" "complianceRequirementResource" {
      lifecycle {
        create_before_destroy = true
      }
      description    = "string"
      framework_id   = "string"
      namespace_path = "string"
      external_controls {
        external_url          = "string"
        ping_enabled          = false
        secret_token          = "string"
        external_control_name = "string"
        id                    = "string"
        name                  = "string"
      }
      internal_controls {
        expression = {
          field    = "string"
          operator = "string"
          value    = "string"
        }
        name = "string"
        id   = "string"
      }
      name = "string"
    }
    
    var complianceRequirementResource = new ComplianceRequirement("complianceRequirementResource", ComplianceRequirementArgs.builder()
        .description("string")
        .frameworkId("string")
        .namespacePath("string")
        .externalControls(ComplianceRequirementExternalControlArgs.builder()
            .externalUrl("string")
            .pingEnabled(false)
            .secretToken("string")
            .externalControlName("string")
            .id("string")
            .name("string")
            .build())
        .internalControls(ComplianceRequirementInternalControlArgs.builder()
            .expression(ComplianceRequirementInternalControlExpressionArgs.builder()
                .field("string")
                .operator("string")
                .value("string")
                .build())
            .name("string")
            .id("string")
            .build())
        .name("string")
        .build());
    
    compliance_requirement_resource = gitlab.ComplianceRequirement("complianceRequirementResource",
        description="string",
        framework_id="string",
        namespace_path="string",
        external_controls=[{
            "external_url": "string",
            "ping_enabled": False,
            "secret_token": "string",
            "external_control_name": "string",
            "id": "string",
            "name": "string",
        }],
        internal_controls=[{
            "expression": {
                "field": "string",
                "operator": "string",
                "value": "string",
            },
            "name": "string",
            "id": "string",
        }],
        name="string")
    
    const complianceRequirementResource = new gitlab.ComplianceRequirement("complianceRequirementResource", {
        description: "string",
        frameworkId: "string",
        namespacePath: "string",
        externalControls: [{
            externalUrl: "string",
            pingEnabled: false,
            secretToken: "string",
            externalControlName: "string",
            id: "string",
            name: "string",
        }],
        internalControls: [{
            expression: {
                field: "string",
                operator: "string",
                value: "string",
            },
            name: "string",
            id: "string",
        }],
        name: "string",
    });
    
    type: gitlab:ComplianceRequirement
    properties:
        description: string
        externalControls:
            - externalControlName: string
              externalUrl: string
              id: string
              name: string
              pingEnabled: false
              secretToken: string
        frameworkId: string
        internalControls:
            - expression:
                field: string
                operator: string
                value: string
              id: string
              name: string
        name: string
        namespacePath: string
    

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

    Description string
    Description for the compliance requirement.
    FrameworkId string
    The globally unique ID of the compliance framework to add the requirement to.
    NamespacePath string
    Full path of the namespace where the compliance framework resides.
    ExternalControls List<Pulumi.GitLab.Inputs.ComplianceRequirementExternalControl>
    Set of external controls for this compliance requirement. Controls define how compliance is verified.
    InternalControls List<Pulumi.GitLab.Inputs.ComplianceRequirementInternalControl>
    Set of internal controls for this compliance requirement. Controls define how compliance is verified.
    Name string
    Name for the compliance requirement.
    Description string
    Description for the compliance requirement.
    FrameworkId string
    The globally unique ID of the compliance framework to add the requirement to.
    NamespacePath string
    Full path of the namespace where the compliance framework resides.
    ExternalControls []ComplianceRequirementExternalControlArgs
    Set of external controls for this compliance requirement. Controls define how compliance is verified.
    InternalControls []ComplianceRequirementInternalControlArgs
    Set of internal controls for this compliance requirement. Controls define how compliance is verified.
    Name string
    Name for the compliance requirement.
    description string
    Description for the compliance requirement.
    framework_id string
    The globally unique ID of the compliance framework to add the requirement to.
    namespace_path string
    Full path of the namespace where the compliance framework resides.
    external_controls list(object)
    Set of external controls for this compliance requirement. Controls define how compliance is verified.
    internal_controls list(object)
    Set of internal controls for this compliance requirement. Controls define how compliance is verified.
    name string
    Name for the compliance requirement.
    description String
    Description for the compliance requirement.
    frameworkId String
    The globally unique ID of the compliance framework to add the requirement to.
    namespacePath String
    Full path of the namespace where the compliance framework resides.
    externalControls List<ComplianceRequirementExternalControl>
    Set of external controls for this compliance requirement. Controls define how compliance is verified.
    internalControls List<ComplianceRequirementInternalControl>
    Set of internal controls for this compliance requirement. Controls define how compliance is verified.
    name String
    Name for the compliance requirement.
    description string
    Description for the compliance requirement.
    frameworkId string
    The globally unique ID of the compliance framework to add the requirement to.
    namespacePath string
    Full path of the namespace where the compliance framework resides.
    externalControls ComplianceRequirementExternalControl[]
    Set of external controls for this compliance requirement. Controls define how compliance is verified.
    internalControls ComplianceRequirementInternalControl[]
    Set of internal controls for this compliance requirement. Controls define how compliance is verified.
    name string
    Name for the compliance requirement.
    description str
    Description for the compliance requirement.
    framework_id str
    The globally unique ID of the compliance framework to add the requirement to.
    namespace_path str
    Full path of the namespace where the compliance framework resides.
    external_controls Sequence[ComplianceRequirementExternalControlArgs]
    Set of external controls for this compliance requirement. Controls define how compliance is verified.
    internal_controls Sequence[ComplianceRequirementInternalControlArgs]
    Set of internal controls for this compliance requirement. Controls define how compliance is verified.
    name str
    Name for the compliance requirement.
    description String
    Description for the compliance requirement.
    frameworkId String
    The globally unique ID of the compliance framework to add the requirement to.
    namespacePath String
    Full path of the namespace where the compliance framework resides.
    externalControls List<Property Map>
    Set of external controls for this compliance requirement. Controls define how compliance is verified.
    internalControls List<Property Map>
    Set of internal controls for this compliance requirement. Controls define how compliance is verified.
    name String
    Name for the compliance requirement.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ComplianceRequirement 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 ComplianceRequirement Resource

    Get an existing ComplianceRequirement 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?: ComplianceRequirementState, opts?: CustomResourceOptions): ComplianceRequirement
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            external_controls: Optional[Sequence[ComplianceRequirementExternalControlArgs]] = None,
            framework_id: Optional[str] = None,
            internal_controls: Optional[Sequence[ComplianceRequirementInternalControlArgs]] = None,
            name: Optional[str] = None,
            namespace_path: Optional[str] = None) -> ComplianceRequirement
    func GetComplianceRequirement(ctx *Context, name string, id IDInput, state *ComplianceRequirementState, opts ...ResourceOption) (*ComplianceRequirement, error)
    public static ComplianceRequirement Get(string name, Input<string> id, ComplianceRequirementState? state, CustomResourceOptions? opts = null)
    public static ComplianceRequirement get(String name, Output<String> id, ComplianceRequirementState state, CustomResourceOptions options)
    resources:  _:    type: gitlab:ComplianceRequirement    get:      id: ${id}
    import {
      to = gitlab_compliance_requirement.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:
    Description string
    Description for the compliance requirement.
    ExternalControls List<Pulumi.GitLab.Inputs.ComplianceRequirementExternalControl>
    Set of external controls for this compliance requirement. Controls define how compliance is verified.
    FrameworkId string
    The globally unique ID of the compliance framework to add the requirement to.
    InternalControls List<Pulumi.GitLab.Inputs.ComplianceRequirementInternalControl>
    Set of internal controls for this compliance requirement. Controls define how compliance is verified.
    Name string
    Name for the compliance requirement.
    NamespacePath string
    Full path of the namespace where the compliance framework resides.
    Description string
    Description for the compliance requirement.
    ExternalControls []ComplianceRequirementExternalControlArgs
    Set of external controls for this compliance requirement. Controls define how compliance is verified.
    FrameworkId string
    The globally unique ID of the compliance framework to add the requirement to.
    InternalControls []ComplianceRequirementInternalControlArgs
    Set of internal controls for this compliance requirement. Controls define how compliance is verified.
    Name string
    Name for the compliance requirement.
    NamespacePath string
    Full path of the namespace where the compliance framework resides.
    description string
    Description for the compliance requirement.
    external_controls list(object)
    Set of external controls for this compliance requirement. Controls define how compliance is verified.
    framework_id string
    The globally unique ID of the compliance framework to add the requirement to.
    internal_controls list(object)
    Set of internal controls for this compliance requirement. Controls define how compliance is verified.
    name string
    Name for the compliance requirement.
    namespace_path string
    Full path of the namespace where the compliance framework resides.
    description String
    Description for the compliance requirement.
    externalControls List<ComplianceRequirementExternalControl>
    Set of external controls for this compliance requirement. Controls define how compliance is verified.
    frameworkId String
    The globally unique ID of the compliance framework to add the requirement to.
    internalControls List<ComplianceRequirementInternalControl>
    Set of internal controls for this compliance requirement. Controls define how compliance is verified.
    name String
    Name for the compliance requirement.
    namespacePath String
    Full path of the namespace where the compliance framework resides.
    description string
    Description for the compliance requirement.
    externalControls ComplianceRequirementExternalControl[]
    Set of external controls for this compliance requirement. Controls define how compliance is verified.
    frameworkId string
    The globally unique ID of the compliance framework to add the requirement to.
    internalControls ComplianceRequirementInternalControl[]
    Set of internal controls for this compliance requirement. Controls define how compliance is verified.
    name string
    Name for the compliance requirement.
    namespacePath string
    Full path of the namespace where the compliance framework resides.
    description str
    Description for the compliance requirement.
    external_controls Sequence[ComplianceRequirementExternalControlArgs]
    Set of external controls for this compliance requirement. Controls define how compliance is verified.
    framework_id str
    The globally unique ID of the compliance framework to add the requirement to.
    internal_controls Sequence[ComplianceRequirementInternalControlArgs]
    Set of internal controls for this compliance requirement. Controls define how compliance is verified.
    name str
    Name for the compliance requirement.
    namespace_path str
    Full path of the namespace where the compliance framework resides.
    description String
    Description for the compliance requirement.
    externalControls List<Property Map>
    Set of external controls for this compliance requirement. Controls define how compliance is verified.
    frameworkId String
    The globally unique ID of the compliance framework to add the requirement to.
    internalControls List<Property Map>
    Set of internal controls for this compliance requirement. Controls define how compliance is verified.
    name String
    Name for the compliance requirement.
    namespacePath String
    Full path of the namespace where the compliance framework resides.

    Supporting Types

    ComplianceRequirementExternalControl, ComplianceRequirementExternalControlArgs

    ExternalUrl string
    External URL for external controls.
    PingEnabled bool
    Whether ping is enabled for external controls.
    SecretToken string
    Secret token for external controls. The secretToken is not available in imported resources.
    ExternalControlName string
    Name of the external control.
    Id string
    Compliance requirements control ID.
    Name string
    Name of the control. Set to externalControl from the API.
    ExternalUrl string
    External URL for external controls.
    PingEnabled bool
    Whether ping is enabled for external controls.
    SecretToken string
    Secret token for external controls. The secretToken is not available in imported resources.
    ExternalControlName string
    Name of the external control.
    Id string
    Compliance requirements control ID.
    Name string
    Name of the control. Set to externalControl from the API.
    external_url string
    External URL for external controls.
    ping_enabled bool
    Whether ping is enabled for external controls.
    secret_token string
    Secret token for external controls. The secretToken is not available in imported resources.
    external_control_name string
    Name of the external control.
    id string
    Compliance requirements control ID.
    name string
    Name of the control. Set to externalControl from the API.
    externalUrl String
    External URL for external controls.
    pingEnabled Boolean
    Whether ping is enabled for external controls.
    secretToken String
    Secret token for external controls. The secretToken is not available in imported resources.
    externalControlName String
    Name of the external control.
    id String
    Compliance requirements control ID.
    name String
    Name of the control. Set to externalControl from the API.
    externalUrl string
    External URL for external controls.
    pingEnabled boolean
    Whether ping is enabled for external controls.
    secretToken string
    Secret token for external controls. The secretToken is not available in imported resources.
    externalControlName string
    Name of the external control.
    id string
    Compliance requirements control ID.
    name string
    Name of the control. Set to externalControl from the API.
    external_url str
    External URL for external controls.
    ping_enabled bool
    Whether ping is enabled for external controls.
    secret_token str
    Secret token for external controls. The secretToken is not available in imported resources.
    external_control_name str
    Name of the external control.
    id str
    Compliance requirements control ID.
    name str
    Name of the control. Set to externalControl from the API.
    externalUrl String
    External URL for external controls.
    pingEnabled Boolean
    Whether ping is enabled for external controls.
    secretToken String
    Secret token for external controls. The secretToken is not available in imported resources.
    externalControlName String
    Name of the external control.
    id String
    Compliance requirements control ID.
    name String
    Name of the control. Set to externalControl from the API.

    ComplianceRequirementInternalControl, ComplianceRequirementInternalControlArgs

    Expression Pulumi.GitLab.Inputs.ComplianceRequirementInternalControlExpression
    Expression for internal controls.
    Name string
    Name of the control, from the list of Control IDs here: GitLab Compliance Controls
    Id string
    Compliance requirements control ID.
    Expression ComplianceRequirementInternalControlExpression
    Expression for internal controls.
    Name string
    Name of the control, from the list of Control IDs here: GitLab Compliance Controls
    Id string
    Compliance requirements control ID.
    expression object
    Expression for internal controls.
    name string
    Name of the control, from the list of Control IDs here: GitLab Compliance Controls
    id string
    Compliance requirements control ID.
    expression ComplianceRequirementInternalControlExpression
    Expression for internal controls.
    name String
    Name of the control, from the list of Control IDs here: GitLab Compliance Controls
    id String
    Compliance requirements control ID.
    expression ComplianceRequirementInternalControlExpression
    Expression for internal controls.
    name string
    Name of the control, from the list of Control IDs here: GitLab Compliance Controls
    id string
    Compliance requirements control ID.
    expression ComplianceRequirementInternalControlExpression
    Expression for internal controls.
    name str
    Name of the control, from the list of Control IDs here: GitLab Compliance Controls
    id str
    Compliance requirements control ID.
    expression Property Map
    Expression for internal controls.
    name String
    Name of the control, from the list of Control IDs here: GitLab Compliance Controls
    id String
    Compliance requirements control ID.

    ComplianceRequirementInternalControlExpression, ComplianceRequirementInternalControlExpressionArgs

    Field string
    The field to evaluate (e.g., scannerDepScanningRunning).
    Operator string
    The operator for comparison. Valid values are =, !=, >, <, >=, <=.
    Value string
    The value to compare against. Use true or false for boolean values.
    Field string
    The field to evaluate (e.g., scannerDepScanningRunning).
    Operator string
    The operator for comparison. Valid values are =, !=, >, <, >=, <=.
    Value string
    The value to compare against. Use true or false for boolean values.
    field string
    The field to evaluate (e.g., scannerDepScanningRunning).
    operator string
    The operator for comparison. Valid values are =, !=, >, <, >=, <=.
    value string
    The value to compare against. Use true or false for boolean values.
    field String
    The field to evaluate (e.g., scannerDepScanningRunning).
    operator String
    The operator for comparison. Valid values are =, !=, >, <, >=, <=.
    value String
    The value to compare against. Use true or false for boolean values.
    field string
    The field to evaluate (e.g., scannerDepScanningRunning).
    operator string
    The operator for comparison. Valid values are =, !=, >, <, >=, <=.
    value string
    The value to compare against. Use true or false for boolean values.
    field str
    The field to evaluate (e.g., scannerDepScanningRunning).
    operator str
    The operator for comparison. Valid values are =, !=, >, <, >=, <=.
    value str
    The value to compare against. Use true or false for boolean values.
    field String
    The field to evaluate (e.g., scannerDepScanningRunning).
    operator String
    The operator for comparison. Valid values are =, !=, >, <, >=, <=.
    value String
    The value to compare against. Use true or false for boolean values.

    Import

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

    Importing using the CLI is supported with the following syntax:

    GitLab compliance requirements can be imported using an id made up of <namespace_path>|<framework_id>|<requirement_id> Both IDs are GraphQL global IDs (GIDs) from GitLab. The pipe separator is used because GIDs contain colons.

    $ pulumi import gitlab:index/complianceRequirement:ComplianceRequirement example "top-level-group|gid://gitlab/ComplianceManagement::Framework/123|gid://gitlab/ComplianceManagement::ComplianceRequirement/456"
    

    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.2.0
    published on Wednesday, Aug 26, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial