
com.pulumi.vault.kotlin.RgpPolicyArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-vault-kotlin Show documentation
Show all versions of pulumi-vault-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.vault.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.vault.RgpPolicyArgs.builder
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Provides a resource to manage Role Governing Policy (RGP) via [Sentinel](https://www.vaultproject.io/docs/enterprise/sentinel/index.html).
* **Note** this feature is available only with Vault Enterprise.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const allow_all = new vault.RgpPolicy("allow-all", {
* name: "allow-all",
* enforcementLevel: "soft-mandatory",
* policy: `main = rule {
* true
* }
* `,
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* allow_all = vault.RgpPolicy("allow-all",
* name="allow-all",
* enforcement_level="soft-mandatory",
* policy="""main = rule {
* true
* }
* """)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var allow_all = new Vault.RgpPolicy("allow-all", new()
* {
* Name = "allow-all",
* EnforcementLevel = "soft-mandatory",
* Policy = @"main = rule {
* true
* }
* ",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := vault.NewRgpPolicy(ctx, "allow-all", &vault.RgpPolicyArgs{
* Name: pulumi.String("allow-all"),
* EnforcementLevel: pulumi.String("soft-mandatory"),
* Policy: pulumi.String("main = rule {\n true\n}\n"),
* })
* 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.vault.RgpPolicy;
* import com.pulumi.vault.RgpPolicyArgs;
* 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 allow_all = new RgpPolicy("allow-all", RgpPolicyArgs.builder()
* .name("allow-all")
* .enforcementLevel("soft-mandatory")
* .policy("""
* main = rule {
* true
* }
* """)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* allow-all:
* type: vault:RgpPolicy
* properties:
* name: allow-all
* enforcementLevel: soft-mandatory
* policy: |
* main = rule {
* true
* }
* ```
*
* @property enforcementLevel Enforcement level of Sentinel policy. Can be either `advisory` or `soft-mandatory` or `hard-mandatory`
* @property name The name of the policy
* @property namespace The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
* @property policy String containing a Sentinel policy
*/
public data class RgpPolicyArgs(
public val enforcementLevel: Output? = null,
public val name: Output? = null,
public val namespace: Output? = null,
public val policy: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.vault.RgpPolicyArgs = com.pulumi.vault.RgpPolicyArgs.builder()
.enforcementLevel(enforcementLevel?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.namespace(namespace?.applyValue({ args0 -> args0 }))
.policy(policy?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [RgpPolicyArgs].
*/
@PulumiTagMarker
public class RgpPolicyArgsBuilder internal constructor() {
private var enforcementLevel: Output? = null
private var name: Output? = null
private var namespace: Output? = null
private var policy: Output? = null
/**
* @param value Enforcement level of Sentinel policy. Can be either `advisory` or `soft-mandatory` or `hard-mandatory`
*/
@JvmName("gnefsuwausgwphub")
public suspend fun enforcementLevel(`value`: Output) {
this.enforcementLevel = value
}
/**
* @param value The name of the policy
*/
@JvmName("mvqyopddeowmdvel")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
*/
@JvmName("frvmqxfurbgvbhbf")
public suspend fun namespace(`value`: Output) {
this.namespace = value
}
/**
* @param value String containing a Sentinel policy
*/
@JvmName("eeclwlyyeheohugc")
public suspend fun policy(`value`: Output) {
this.policy = value
}
/**
* @param value Enforcement level of Sentinel policy. Can be either `advisory` or `soft-mandatory` or `hard-mandatory`
*/
@JvmName("xcnfndjuhltetbcs")
public suspend fun enforcementLevel(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.enforcementLevel = mapped
}
/**
* @param value The name of the policy
*/
@JvmName("wutkoaaybtxprdqv")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
*/
@JvmName("atfpldhnloskcsph")
public suspend fun namespace(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.namespace = mapped
}
/**
* @param value String containing a Sentinel policy
*/
@JvmName("btaxetwtfbcgjryw")
public suspend fun policy(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.policy = mapped
}
internal fun build(): RgpPolicyArgs = RgpPolicyArgs(
enforcementLevel = enforcementLevel,
name = name,
namespace = namespace,
policy = policy,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy