com.pulumi.vault.transform.kotlin.TemplateArgs.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.transform.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.transform.TemplateArgs.builder
import kotlin.Any
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* This resource supports the `/transform/template/{name}` Vault endpoint.
* It creates or updates a template with the given name. If a template with the name does not exist,
* it will be created. If the template exists, it will be updated with the new attributes.
* > Requires _Vault Enterprise with the Advanced Data Protection Transform Module_.
* See [Transform Secrets Engine](https://www.vaultproject.io/docs/secrets/transform)
* for more information.
* ## Example Usage
* Please note that the `pattern` below holds a regex. The regex shown
* is identical to the one in our [Setup](https://www.vaultproject.io/docs/secrets/transform#setup)
* docs, `(\d{4})-(\d{4})-(\d{4})-(\d{4})`. However, due to HCL, the
* backslashes must be escaped to appear correctly in Vault. For further
* assistance escaping your own custom regex, see String Literals.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const transform = new vault.Mount("transform", {
* path: "transform",
* type: "transform",
* });
* const numerics = new vault.transform.Alphabet("numerics", {
* path: transform.path,
* name: "numerics",
* alphabet: "0123456789",
* });
* const test = new vault.transform.Template("test", {
* path: numerics.path,
* name: "ccn",
* type: "regex",
* pattern: "(\\d{4})[- ](\\d{4})[- ](\\d{4})[- ](\\d{4})",
* alphabet: "numerics",
* encodeFormat: "$1-$2-$3-$4",
* decodeFormats: {
* "last-four-digits": "$4",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* transform = vault.Mount("transform",
* path="transform",
* type="transform")
* numerics = vault.transform.Alphabet("numerics",
* path=transform.path,
* name="numerics",
* alphabet="0123456789")
* test = vault.transform.Template("test",
* path=numerics.path,
* name="ccn",
* type="regex",
* pattern="(\\d{4})[- ](\\d{4})[- ](\\d{4})[- ](\\d{4})",
* alphabet="numerics",
* encode_format="$1-$2-$3-$4",
* decode_formats={
* "last-four-digits": "$4",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var transform = new Vault.Mount("transform", new()
* {
* Path = "transform",
* Type = "transform",
* });
* var numerics = new Vault.Transform.Alphabet("numerics", new()
* {
* Path = transform.Path,
* Name = "numerics",
* AlphabetSet = "0123456789",
* });
* var test = new Vault.Transform.Template("test", new()
* {
* Path = numerics.Path,
* Name = "ccn",
* Type = "regex",
* Pattern = "(\\d{4})[- ](\\d{4})[- ](\\d{4})[- ](\\d{4})",
* Alphabet = "numerics",
* EncodeFormat = "$1-$2-$3-$4",
* DecodeFormats =
* {
* { "last-four-digits", "$4" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault/transform"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* transform, err := vault.NewMount(ctx, "transform", &vault.MountArgs{
* Path: pulumi.String("transform"),
* Type: pulumi.String("transform"),
* })
* if err != nil {
* return err
* }
* numerics, err := transform.NewAlphabet(ctx, "numerics", &transform.AlphabetArgs{
* Path: transform.Path,
* Name: pulumi.String("numerics"),
* Alphabet: pulumi.String("0123456789"),
* })
* if err != nil {
* return err
* }
* _, err = transform.NewTemplate(ctx, "test", &transform.TemplateArgs{
* Path: numerics.Path,
* Name: pulumi.String("ccn"),
* Type: pulumi.String("regex"),
* Pattern: pulumi.String("(\\d{4})[- ](\\d{4})[- ](\\d{4})[- ](\\d{4})"),
* Alphabet: pulumi.String("numerics"),
* EncodeFormat: pulumi.String("$1-$2-$3-$4"),
* DecodeFormats: pulumi.Map{
* "last-four-digits": pulumi.Any("$4"),
* },
* })
* 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.Mount;
* import com.pulumi.vault.MountArgs;
* import com.pulumi.vault.transform.Alphabet;
* import com.pulumi.vault.transform.AlphabetArgs;
* import com.pulumi.vault.transform.Template;
* import com.pulumi.vault.transform.TemplateArgs;
* 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 transform = new Mount("transform", MountArgs.builder()
* .path("transform")
* .type("transform")
* .build());
* var numerics = new Alphabet("numerics", AlphabetArgs.builder()
* .path(transform.path())
* .name("numerics")
* .alphabet("0123456789")
* .build());
* var test = new Template("test", TemplateArgs.builder()
* .path(numerics.path())
* .name("ccn")
* .type("regex")
* .pattern("(\\d{4})[- ](\\d{4})[- ](\\d{4})[- ](\\d{4})")
* .alphabet("numerics")
* .encodeFormat("$1-$2-$3-$4")
* .decodeFormats(Map.of("last-four-digits", "$4"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* transform:
* type: vault:Mount
* properties:
* path: transform
* type: transform
* numerics:
* type: vault:transform:Alphabet
* properties:
* path: ${transform.path}
* name: numerics
* alphabet: '0123456789'
* test:
* type: vault:transform:Template
* properties:
* path: ${numerics.path}
* name: ccn
* type: regex
* pattern: (\d{4})[- ](\d{4})[- ](\d{4})[- ](\d{4})
* alphabet: numerics
* encodeFormat: $1-$2-$3-$4
* decodeFormats:
* last-four-digits: $4
* ```
*
* @property alphabet The alphabet to use for this template. This is only used during FPE transformations.
* @property decodeFormats Optional mapping of name to regular expression template, used to customize
* the decoded output. (requires Vault Enterprise 1.9+)
* @property encodeFormat The regular expression template used to format encoded values.
* (requires Vault Enterprise 1.9+)
* @property name The name of the template.
* @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 path Path to where the back-end is mounted within Vault.
* @property pattern The pattern used for matching. Currently, only regular expression pattern is supported.
* @property type The pattern type to use for match detection. Currently, only regex is supported.
*/
public data class TemplateArgs(
public val alphabet: Output? = null,
public val decodeFormats: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy