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

com.pulumi.vault.kotlin.EgpPolicyArgs.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: 6.4.0.0
Show newest version
@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.EgpPolicyArgs.builder
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a resource to manage Endpoint Governing Policy (EGP) 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.EgpPolicy("allow-all", {
 *     name: "allow-all",
 *     paths: ["*"],
 *     enforcementLevel: "soft-mandatory",
 *     policy: `main = rule {
 *   true
 * }
 * `,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_vault as vault
 * allow_all = vault.EgpPolicy("allow-all",
 *     name="allow-all",
 *     paths=["*"],
 *     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.EgpPolicy("allow-all", new()
 *     {
 *         Name = "allow-all",
 *         Paths = new[]
 *         {
 *             "*",
 *         },
 *         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.NewEgpPolicy(ctx, "allow-all", &vault.EgpPolicyArgs{
 * 			Name: pulumi.String("allow-all"),
 * 			Paths: pulumi.StringArray{
 * 				pulumi.String("*"),
 * 			},
 * 			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.EgpPolicy;
 * import com.pulumi.vault.EgpPolicyArgs;
 * 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 EgpPolicy("allow-all", EgpPolicyArgs.builder()
 *             .name("allow-all")
 *             .paths("*")
 *             .enforcementLevel("soft-mandatory")
 *             .policy("""
 * main = rule {
 *   true
 * }
 *             """)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   allow-all:
 *     type: vault:EgpPolicy
 *     properties:
 *       name: allow-all
 *       paths:
 *         - '*'
 *       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 paths List of paths to which the policy will be applied to
 * @property policy String containing a Sentinel policy
 */
public data class EgpPolicyArgs(
    public val enforcementLevel: Output? = null,
    public val name: Output? = null,
    public val namespace: Output? = null,
    public val paths: Output>? = null,
    public val policy: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.vault.EgpPolicyArgs = com.pulumi.vault.EgpPolicyArgs.builder()
        .enforcementLevel(enforcementLevel?.applyValue({ args0 -> args0 }))
        .name(name?.applyValue({ args0 -> args0 }))
        .namespace(namespace?.applyValue({ args0 -> args0 }))
        .paths(paths?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
        .policy(policy?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [EgpPolicyArgs].
 */
@PulumiTagMarker
public class EgpPolicyArgsBuilder internal constructor() {
    private var enforcementLevel: Output? = null

    private var name: Output? = null

    private var namespace: Output? = null

    private var paths: 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("clqyjitxteukkgvo")
    public suspend fun enforcementLevel(`value`: Output) {
        this.enforcementLevel = value
    }

    /**
     * @param value The name of the policy
     */
    @JvmName("augpnbyvrjeccass")
    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("kqqsouoyrujqscfu")
    public suspend fun namespace(`value`: Output) {
        this.namespace = value
    }

    /**
     * @param value List of paths to which the policy will be applied to
     */
    @JvmName("dsdijojftcqajcmt")
    public suspend fun paths(`value`: Output>) {
        this.paths = value
    }

    @JvmName("kxjgrbsufuadkihk")
    public suspend fun paths(vararg values: Output) {
        this.paths = Output.all(values.asList())
    }

    /**
     * @param values List of paths to which the policy will be applied to
     */
    @JvmName("rkjkcfsadvmmoubl")
    public suspend fun paths(values: List>) {
        this.paths = Output.all(values)
    }

    /**
     * @param value String containing a Sentinel policy
     */
    @JvmName("fpthohmliceojdyl")
    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("bivduaxrkghsmete")
    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("vihfrluljwpgkxmv")
    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("kdccgkaxtugqkgtu")
    public suspend fun namespace(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namespace = mapped
    }

    /**
     * @param value List of paths to which the policy will be applied to
     */
    @JvmName("kgcdrxexgqtingsi")
    public suspend fun paths(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.paths = mapped
    }

    /**
     * @param values List of paths to which the policy will be applied to
     */
    @JvmName("pdaxkmwgwieyhnbi")
    public suspend fun paths(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.paths = mapped
    }

    /**
     * @param value String containing a Sentinel policy
     */
    @JvmName("fmbwbvigefvcoiow")
    public suspend fun policy(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.policy = mapped
    }

    internal fun build(): EgpPolicyArgs = EgpPolicyArgs(
        enforcementLevel = enforcementLevel,
        name = name,
        namespace = namespace,
        paths = paths,
        policy = policy,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy