All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gitlab.kotlin.ProjectComplianceFrameworks.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.4.2.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gitlab.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

/**
 * Builder for [ProjectComplianceFrameworks].
 */
@PulumiTagMarker
public class ProjectComplianceFrameworksResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ProjectComplianceFrameworksArgs = ProjectComplianceFrameworksArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend ProjectComplianceFrameworksArgsBuilder.() -> Unit) {
        val builder = ProjectComplianceFrameworksArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): ProjectComplianceFrameworks {
        val builtJavaResource = com.pulumi.gitlab.ProjectComplianceFrameworks(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return ProjectComplianceFrameworks(builtJavaResource)
    }
}

/**
 * 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](https://docs.gitlab.com/ee/api/graphql/reference/#mutationprojectupdatecomplianceframeworks)
 * ## Example Usage
 * 
 * ```typescript
 * 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",
 * });
 * ```
 * ```python
 * 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")
 * ```
 * ```csharp
 * 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",
 *     });
 * });
 * ```
 * ```go
 * 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
 * 	})
 * }
 * ```
 * ```java
 * 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());
 *     }
 * }
 * ```
 * ```yaml
 * 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'
 * ```
 * 
 * ## 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 ``, e.g.
 * ```sh
 * $ pulumi import gitlab:index/projectComplianceFrameworks:ProjectComplianceFrameworks sample "42"
 * ```
 */
public class ProjectComplianceFrameworks internal constructor(
    override val javaResource: com.pulumi.gitlab.ProjectComplianceFrameworks,
) : KotlinCustomResource(javaResource, ProjectComplianceFrameworksMapper) {
    /**
     * Globally unique IDs of the compliance frameworks to assign to the project.
     */
    public val complianceFrameworkIds: Output>
        get() = javaResource.complianceFrameworkIds().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * The ID or full path of the project to change the compliance frameworks of.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })
}

public object ProjectComplianceFrameworksMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gitlab.ProjectComplianceFrameworks::class == javaResource::class

    override fun map(javaResource: Resource): ProjectComplianceFrameworks =
        ProjectComplianceFrameworks(javaResource as com.pulumi.gitlab.ProjectComplianceFrameworks)
}

/**
 * @see [ProjectComplianceFrameworks].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [ProjectComplianceFrameworks].
 */
public suspend fun projectComplianceFrameworks(
    name: String,
    block: suspend ProjectComplianceFrameworksResourceBuilder.() -> Unit,
): ProjectComplianceFrameworks {
    val builder = ProjectComplianceFrameworksResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [ProjectComplianceFrameworks].
 * @param name The _unique_ name of the resulting resource.
 */
public fun projectComplianceFrameworks(name: String): ProjectComplianceFrameworks {
    val builder = ProjectComplianceFrameworksResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy