com.pulumi.gitlab.kotlin.InstanceVariableArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gitlab-kotlin Show documentation
Show all versions of pulumi-gitlab-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gitlab.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gitlab.InstanceVariableArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* The `gitlab.InstanceVariable` resource allows to manage the lifecycle of an instance-level CI/CD variable.
* **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/instance_level_ci_variables.html)
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gitlab from "@pulumi/gitlab";
* const example = new gitlab.InstanceVariable("example", {
* key: "instance_variable_key",
* value: "instance_variable_value",
* "protected": false,
* masked: false,
* });
* ```
* ```python
* import pulumi
* import pulumi_gitlab as gitlab
* example = gitlab.InstanceVariable("example",
* key="instance_variable_key",
* value="instance_variable_value",
* protected=False,
* masked=False)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using GitLab = Pulumi.GitLab;
* return await Deployment.RunAsync(() =>
* {
* var example = new GitLab.InstanceVariable("example", new()
* {
* Key = "instance_variable_key",
* Value = "instance_variable_value",
* Protected = false,
* Masked = false,
* });
* });
* ```
* ```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 {
* _, err := gitlab.NewInstanceVariable(ctx, "example", &gitlab.InstanceVariableArgs{
* Key: pulumi.String("instance_variable_key"),
* Value: pulumi.String("instance_variable_value"),
* Protected: pulumi.Bool(false),
* Masked: pulumi.Bool(false),
* })
* 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.InstanceVariable;
* import com.pulumi.gitlab.InstanceVariableArgs;
* 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 example = new InstanceVariable("example", InstanceVariableArgs.builder()
* .key("instance_variable_key")
* .value("instance_variable_value")
* .protected_(false)
* .masked(false)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: gitlab:InstanceVariable
* properties:
* key: instance_variable_key
* value: instance_variable_value
* protected: false
* masked: false
* ```
*
* ## Import
* Starting in Terraform v1.5.0 you can use an import block to import `gitlab_instance_variable`. For example:
* terraform
* import {
* to = gitlab_instance_variable.example
* id = "see CLI command below for ID"
* }
* Import using the CLI is supported using the following syntax:
* GitLab instance variables can be imported using an id made up of `variablename`, e.g.
* ```sh
* $ pulumi import gitlab:index/instanceVariable:InstanceVariable example instance_variable_key
* ```
* @property description The description of the variable. Maximum of 255 characters.
* @property key The name of the variable.
* @property masked If set to `true`, the value of the variable will be hidden in job logs. The value must meet the [masking requirements](https://docs.gitlab.com/ee/ci/variables/#masked-variables). Defaults to `false`.
* @property protected If set to `true`, the variable will be passed only to pipelines running on protected branches and tags. Defaults to `false`.
* @property raw Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
* @property value The value of the variable.
* @property variableType The type of a variable. Valid values are: `env_var`, `file`. Default is `env_var`.
*/
public data class InstanceVariableArgs(
public val description: Output? = null,
public val key: Output? = null,
public val masked: Output? = null,
public val `protected`: Output? = null,
public val raw: Output? = null,
public val `value`: Output? = null,
public val variableType: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gitlab.InstanceVariableArgs =
com.pulumi.gitlab.InstanceVariableArgs.builder()
.description(description?.applyValue({ args0 -> args0 }))
.key(key?.applyValue({ args0 -> args0 }))
.masked(masked?.applyValue({ args0 -> args0 }))
.protected_(`protected`?.applyValue({ args0 -> args0 }))
.raw(raw?.applyValue({ args0 -> args0 }))
.`value`(`value`?.applyValue({ args0 -> args0 }))
.variableType(variableType?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [InstanceVariableArgs].
*/
@PulumiTagMarker
public class InstanceVariableArgsBuilder internal constructor() {
private var description: Output? = null
private var key: Output? = null
private var masked: Output? = null
private var `protected`: Output? = null
private var raw: Output? = null
private var `value`: Output? = null
private var variableType: Output? = null
/**
* @param value The description of the variable. Maximum of 255 characters.
*/
@JvmName("flvgssfxxkqnjwva")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value The name of the variable.
*/
@JvmName("xuscxpbyqkarhnjy")
public suspend fun key(`value`: Output) {
this.key = value
}
/**
* @param value If set to `true`, the value of the variable will be hidden in job logs. The value must meet the [masking requirements](https://docs.gitlab.com/ee/ci/variables/#masked-variables). Defaults to `false`.
*/
@JvmName("ahnyweyvhhnqtmlw")
public suspend fun masked(`value`: Output) {
this.masked = value
}
/**
* @param value If set to `true`, the variable will be passed only to pipelines running on protected branches and tags. Defaults to `false`.
*/
@JvmName("bvevttoslefnwjhm")
public suspend fun `protected`(`value`: Output) {
this.`protected` = value
}
/**
* @param value Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
*/
@JvmName("mctlpkconpynpbyg")
public suspend fun raw(`value`: Output) {
this.raw = value
}
/**
* @param value The value of the variable.
*/
@JvmName("hrvvblwwrimbnjhy")
public suspend fun `value`(`value`: Output) {
this.`value` = value
}
/**
* @param value The type of a variable. Valid values are: `env_var`, `file`. Default is `env_var`.
*/
@JvmName("rdsipkartldxeqor")
public suspend fun variableType(`value`: Output) {
this.variableType = value
}
/**
* @param value The description of the variable. Maximum of 255 characters.
*/
@JvmName("gyxgcvqgvmftbbhj")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value The name of the variable.
*/
@JvmName("shxpsdxdtgaunlno")
public suspend fun key(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.key = mapped
}
/**
* @param value If set to `true`, the value of the variable will be hidden in job logs. The value must meet the [masking requirements](https://docs.gitlab.com/ee/ci/variables/#masked-variables). Defaults to `false`.
*/
@JvmName("agnnvugyffxeakna")
public suspend fun masked(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.masked = mapped
}
/**
* @param value If set to `true`, the variable will be passed only to pipelines running on protected branches and tags. Defaults to `false`.
*/
@JvmName("npfmbgwxuddtosmc")
public suspend fun `protected`(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.`protected` = mapped
}
/**
* @param value Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
*/
@JvmName("pmljchtykkyqssaf")
public suspend fun raw(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.raw = mapped
}
/**
* @param value The value of the variable.
*/
@JvmName("blirspdrbafrpint")
public suspend fun `value`(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.`value` = mapped
}
/**
* @param value The type of a variable. Valid values are: `env_var`, `file`. Default is `env_var`.
*/
@JvmName("neelgukkngbnumxh")
public suspend fun variableType(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.variableType = mapped
}
internal fun build(): InstanceVariableArgs = InstanceVariableArgs(
description = description,
key = key,
masked = masked,
`protected` = `protected`,
raw = raw,
`value` = `value`,
variableType = variableType,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy