1. Packages
  2. Gitlab Provider
  3. API Docs
  4. ProjectComplianceFrameworks
GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi

gitlab.ProjectComplianceFrameworks

Explore with Pulumi AI

The gitlab.ProjectComplianceFrameworks resource allows to manage the lifecycle of compliance frameworks on a project.

This resource requires a GitLab Enterprise instance with a Premium license to set the compliance frameworks on a project.

Upstream API: GitLab GraphQL API docs

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const alpha = new gitlab.ComplianceFramework("alpha", {
    namespacePath: "top-level-group",
    name: "HIPAA",
    description: "A HIPAA Compliance Framework",
    color: "#87BEEF",
    "default": false,
});
const beta = new gitlab.ComplianceFramework("beta", {
    namespacePath: "top-level-group",
    name: "SOC",
    description: "A SOC Compliance Framework",
    color: "#223344",
    "default": false,
});
const sample = new gitlab.ProjectComplianceFrameworks("sample", {
    complianceFrameworkIds: [
        alpha.frameworkId,
        beta.frameworkId,
    ],
    project: "12345678",
});
Copy
import pulumi
import pulumi_gitlab as gitlab

alpha = gitlab.ComplianceFramework("alpha",
    namespace_path="top-level-group",
    name="HIPAA",
    description="A HIPAA Compliance Framework",
    color="#87BEEF",
    default=False)
beta = gitlab.ComplianceFramework("beta",
    namespace_path="top-level-group",
    name="SOC",
    description="A SOC Compliance Framework",
    color="#223344",
    default=False)
sample = gitlab.ProjectComplianceFrameworks("sample",
    compliance_framework_ids=[
        alpha.framework_id,
        beta.framework_id,
    ],
    project="12345678")
Copy
package main

import (
	"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		alpha, err := gitlab.NewComplianceFramework(ctx, "alpha", &gitlab.ComplianceFrameworkArgs{
			NamespacePath: pulumi.String("top-level-group"),
			Name:          pulumi.String("HIPAA"),
			Description:   pulumi.String("A HIPAA Compliance Framework"),
			Color:         pulumi.String("#87BEEF"),
			Default:       pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		beta, err := gitlab.NewComplianceFramework(ctx, "beta", &gitlab.ComplianceFrameworkArgs{
			NamespacePath: pulumi.String("top-level-group"),
			Name:          pulumi.String("SOC"),
			Description:   pulumi.String("A SOC Compliance Framework"),
			Color:         pulumi.String("#223344"),
			Default:       pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		_, err = gitlab.NewProjectComplianceFrameworks(ctx, "sample", &gitlab.ProjectComplianceFrameworksArgs{
			ComplianceFrameworkIds: pulumi.StringArray{
				alpha.FrameworkId,
				beta.FrameworkId,
			},
			Project: pulumi.String("12345678"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;

return await Deployment.RunAsync(() => 
{
    var alpha = new GitLab.ComplianceFramework("alpha", new()
    {
        NamespacePath = "top-level-group",
        Name = "HIPAA",
        Description = "A HIPAA Compliance Framework",
        Color = "#87BEEF",
        Default = false,
    });

    var beta = new GitLab.ComplianceFramework("beta", new()
    {
        NamespacePath = "top-level-group",
        Name = "SOC",
        Description = "A SOC Compliance Framework",
        Color = "#223344",
        Default = false,
    });

    var sample = new GitLab.ProjectComplianceFrameworks("sample", new()
    {
        ComplianceFrameworkIds = new[]
        {
            alpha.FrameworkId,
            beta.FrameworkId,
        },
        Project = "12345678",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.ComplianceFramework;
import com.pulumi.gitlab.ComplianceFrameworkArgs;
import com.pulumi.gitlab.ProjectComplianceFrameworks;
import com.pulumi.gitlab.ProjectComplianceFrameworksArgs;
import java.util.List;
import java.util.ArrayList;
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 alpha = new ComplianceFramework("alpha", ComplianceFrameworkArgs.builder()
            .namespacePath("top-level-group")
            .name("HIPAA")
            .description("A HIPAA Compliance Framework")
            .color("#87BEEF")
            .default_(false)
            .build());

        var beta = new ComplianceFramework("beta", ComplianceFrameworkArgs.builder()
            .namespacePath("top-level-group")
            .name("SOC")
            .description("A SOC Compliance Framework")
            .color("#223344")
            .default_(false)
            .build());

        var sample = new ProjectComplianceFrameworks("sample", ProjectComplianceFrameworksArgs.builder()
            .complianceFrameworkIds(            
                alpha.frameworkId(),
                beta.frameworkId())
            .project("12345678")
            .build());

    }
}
Copy
resources:
  alpha:
    type: gitlab:ComplianceFramework
    properties:
      namespacePath: top-level-group
      name: HIPAA
      description: A HIPAA Compliance Framework
      color: '#87BEEF'
      default: false
  beta:
    type: gitlab:ComplianceFramework
    properties:
      namespacePath: top-level-group
      name: SOC
      description: A SOC Compliance Framework
      color: '#223344'
      default: false
  sample:
    type: gitlab:ProjectComplianceFrameworks
    properties:
      complianceFrameworkIds:
        - ${alpha.frameworkId}
        - ${beta.frameworkId}
      project: '12345678'
Copy

Create ProjectComplianceFrameworks Resource

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

Constructor syntax

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

@overload
def ProjectComplianceFrameworks(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                compliance_framework_ids: Optional[Sequence[str]] = None,
                                project: Optional[str] = None)
func NewProjectComplianceFrameworks(ctx *Context, name string, args ProjectComplianceFrameworksArgs, opts ...ResourceOption) (*ProjectComplianceFrameworks, error)
public ProjectComplianceFrameworks(string name, ProjectComplianceFrameworksArgs args, CustomResourceOptions? opts = null)
public ProjectComplianceFrameworks(String name, ProjectComplianceFrameworksArgs args)
public ProjectComplianceFrameworks(String name, ProjectComplianceFrameworksArgs args, CustomResourceOptions options)
type: gitlab:ProjectComplianceFrameworks
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ProjectComplianceFrameworksArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ProjectComplianceFrameworksArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ProjectComplianceFrameworksArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ProjectComplianceFrameworksArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ProjectComplianceFrameworksArgs
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 projectComplianceFrameworksResource = new GitLab.ProjectComplianceFrameworks("projectComplianceFrameworksResource", new()
{
    ComplianceFrameworkIds = new[]
    {
        "string",
    },
    Project = "string",
});
Copy
example, err := gitlab.NewProjectComplianceFrameworks(ctx, "projectComplianceFrameworksResource", &gitlab.ProjectComplianceFrameworksArgs{
	ComplianceFrameworkIds: pulumi.StringArray{
		pulumi.String("string"),
	},
	Project: pulumi.String("string"),
})
Copy
var projectComplianceFrameworksResource = new ProjectComplianceFrameworks("projectComplianceFrameworksResource", ProjectComplianceFrameworksArgs.builder()
    .complianceFrameworkIds("string")
    .project("string")
    .build());
Copy
project_compliance_frameworks_resource = gitlab.ProjectComplianceFrameworks("projectComplianceFrameworksResource",
    compliance_framework_ids=["string"],
    project="string")
Copy
const projectComplianceFrameworksResource = new gitlab.ProjectComplianceFrameworks("projectComplianceFrameworksResource", {
    complianceFrameworkIds: ["string"],
    project: "string",
});
Copy
type: gitlab:ProjectComplianceFrameworks
properties:
    complianceFrameworkIds:
        - string
    project: string
Copy

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

ComplianceFrameworkIds This property is required. List<string>
Globally unique IDs of the compliance frameworks to assign to the project.
Project This property is required. string
The ID or full path of the project to change the compliance frameworks of.
ComplianceFrameworkIds This property is required. []string
Globally unique IDs of the compliance frameworks to assign to the project.
Project This property is required. string
The ID or full path of the project to change the compliance frameworks of.
complianceFrameworkIds This property is required. List<String>
Globally unique IDs of the compliance frameworks to assign to the project.
project This property is required. String
The ID or full path of the project to change the compliance frameworks of.
complianceFrameworkIds This property is required. string[]
Globally unique IDs of the compliance frameworks to assign to the project.
project This property is required. string
The ID or full path of the project to change the compliance frameworks of.
compliance_framework_ids This property is required. Sequence[str]
Globally unique IDs of the compliance frameworks to assign to the project.
project This property is required. str
The ID or full path of the project to change the compliance frameworks of.
complianceFrameworkIds This property is required. List<String>
Globally unique IDs of the compliance frameworks to assign to the project.
project This property is required. String
The ID or full path of the project to change the compliance frameworks of.

Outputs

All input properties are implicitly available as output properties. Additionally, the ProjectComplianceFrameworks 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 str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ProjectComplianceFrameworks Resource

Get an existing ProjectComplianceFrameworks 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?: ProjectComplianceFrameworksState, opts?: CustomResourceOptions): ProjectComplianceFrameworks
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        compliance_framework_ids: Optional[Sequence[str]] = None,
        project: Optional[str] = None) -> ProjectComplianceFrameworks
func GetProjectComplianceFrameworks(ctx *Context, name string, id IDInput, state *ProjectComplianceFrameworksState, opts ...ResourceOption) (*ProjectComplianceFrameworks, error)
public static ProjectComplianceFrameworks Get(string name, Input<string> id, ProjectComplianceFrameworksState? state, CustomResourceOptions? opts = null)
public static ProjectComplianceFrameworks get(String name, Output<String> id, ProjectComplianceFrameworksState state, CustomResourceOptions options)
resources:  _:    type: gitlab:ProjectComplianceFrameworks    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ComplianceFrameworkIds List<string>
Globally unique IDs of the compliance frameworks to assign to the project.
Project string
The ID or full path of the project to change the compliance frameworks of.
ComplianceFrameworkIds []string
Globally unique IDs of the compliance frameworks to assign to the project.
Project string
The ID or full path of the project to change the compliance frameworks of.
complianceFrameworkIds List<String>
Globally unique IDs of the compliance frameworks to assign to the project.
project String
The ID or full path of the project to change the compliance frameworks of.
complianceFrameworkIds string[]
Globally unique IDs of the compliance frameworks to assign to the project.
project string
The ID or full path of the project to change the compliance frameworks of.
compliance_framework_ids Sequence[str]
Globally unique IDs of the compliance frameworks to assign to the project.
project str
The ID or full path of the project to change the compliance frameworks of.
complianceFrameworkIds List<String>
Globally unique IDs of the compliance frameworks to assign to the project.
project String
The ID or full path of the project to change the compliance frameworks of.

Import

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

terraform

import {

to = gitlab_project_compliance_frameworks.example

id = “see CLI command below for ID”

}

Import using the CLI is supported using the following syntax:

Gitlab project compliance frameworks can be imported with a key composed of <project_id>, e.g.

$ pulumi import gitlab:index/projectComplianceFrameworks:ProjectComplianceFrameworks sample "42"
Copy

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.