
com.pulumi.vault.kotlin.PasswordPolicyArgs.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.PasswordPolicyArgs.builder
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Provides a resource to manage Password Policies
* **Note** this feature is available only Vault 1.5+
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const alphanumeric = new vault.PasswordPolicy("alphanumeric", {
* name: "alphanumeric",
* policy: ` length = 20
* rule "charset" {
* charset = "abcdefghijklmnopqrstuvwxyz0123456789"
* }
* `,
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* alphanumeric = vault.PasswordPolicy("alphanumeric",
* name="alphanumeric",
* policy=""" length = 20
* rule "charset" {
* charset = "abcdefghijklmnopqrstuvwxyz0123456789"
* }
* """)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var alphanumeric = new Vault.PasswordPolicy("alphanumeric", new()
* {
* Name = "alphanumeric",
* Policy = @" length = 20
* rule ""charset"" {
* charset = ""abcdefghijklmnopqrstuvwxyz0123456789""
* }
* ",
* });
* });
* ```
* ```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.NewPasswordPolicy(ctx, "alphanumeric", &vault.PasswordPolicyArgs{
* Name: pulumi.String("alphanumeric"),
* Policy: pulumi.String(" length = 20\n rule \"charset\" {\n charset = \"abcdefghijklmnopqrstuvwxyz0123456789\"\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.PasswordPolicy;
* import com.pulumi.vault.PasswordPolicyArgs;
* 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 alphanumeric = new PasswordPolicy("alphanumeric", PasswordPolicyArgs.builder()
* .name("alphanumeric")
* .policy("""
* length = 20
* rule "charset" {
* charset = "abcdefghijklmnopqrstuvwxyz0123456789"
* }
* """)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* alphanumeric:
* type: vault:PasswordPolicy
* properties:
* name: alphanumeric
* policy: |2
* length = 20
* rule "charset" {
* charset = "abcdefghijklmnopqrstuvwxyz0123456789"
* }
* ```
*
* ## Import
* Password policies can be imported using the `name`, e.g.
* ```sh
* $ pulumi import vault:index/passwordPolicy:PasswordPolicy alphanumeric alphanumeric
* ```
* @property name The name of the password 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 password policy.
*/
public data class PasswordPolicyArgs(
public val name: Output? = null,
public val namespace: Output? = null,
public val policy: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.vault.PasswordPolicyArgs =
com.pulumi.vault.PasswordPolicyArgs.builder()
.name(name?.applyValue({ args0 -> args0 }))
.namespace(namespace?.applyValue({ args0 -> args0 }))
.policy(policy?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [PasswordPolicyArgs].
*/
@PulumiTagMarker
public class PasswordPolicyArgsBuilder internal constructor() {
private var name: Output? = null
private var namespace: Output? = null
private var policy: Output? = null
/**
* @param value The name of the password policy.
*/
@JvmName("nbccaodfnquwyuyo")
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("juvfbhqbnmgvinhi")
public suspend fun namespace(`value`: Output) {
this.namespace = value
}
/**
* @param value String containing a password policy.
*/
@JvmName("krymolcjiwcsooep")
public suspend fun policy(`value`: Output) {
this.policy = value
}
/**
* @param value The name of the password policy.
*/
@JvmName("mehiftsqeyrixvil")
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("ioqwbvhlbsciyogp")
public suspend fun namespace(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.namespace = mapped
}
/**
* @param value String containing a password policy.
*/
@JvmName("kvqgllncejhgeygj")
public suspend fun policy(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.policy = mapped
}
internal fun build(): PasswordPolicyArgs = PasswordPolicyArgs(
name = name,
namespace = namespace,
policy = policy,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy