com.pulumi.aws.iam.kotlin.AccountPasswordPolicyArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-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.aws.iam.kotlin
import com.pulumi.aws.iam.AccountPasswordPolicyArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Int
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* > **Note:** There is only a single policy allowed per AWS account. An existing policy will be lost when using this resource as an effect of this limitation.
* Manages Password Policy for the AWS Account.
* See more about [Account Password Policy](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html)
* in the official AWS docs.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const strict = new aws.iam.AccountPasswordPolicy("strict", {
* minimumPasswordLength: 8,
* requireLowercaseCharacters: true,
* requireNumbers: true,
* requireUppercaseCharacters: true,
* requireSymbols: true,
* allowUsersToChangePassword: true,
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* strict = aws.iam.AccountPasswordPolicy("strict",
* minimum_password_length=8,
* require_lowercase_characters=True,
* require_numbers=True,
* require_uppercase_characters=True,
* require_symbols=True,
* allow_users_to_change_password=True)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var strict = new Aws.Iam.AccountPasswordPolicy("strict", new()
* {
* MinimumPasswordLength = 8,
* RequireLowercaseCharacters = true,
* RequireNumbers = true,
* RequireUppercaseCharacters = true,
* RequireSymbols = true,
* AllowUsersToChangePassword = true,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := iam.NewAccountPasswordPolicy(ctx, "strict", &iam.AccountPasswordPolicyArgs{
* MinimumPasswordLength: pulumi.Int(8),
* RequireLowercaseCharacters: pulumi.Bool(true),
* RequireNumbers: pulumi.Bool(true),
* RequireUppercaseCharacters: pulumi.Bool(true),
* RequireSymbols: pulumi.Bool(true),
* AllowUsersToChangePassword: pulumi.Bool(true),
* })
* 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.aws.iam.AccountPasswordPolicy;
* import com.pulumi.aws.iam.AccountPasswordPolicyArgs;
* 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 strict = new AccountPasswordPolicy("strict", AccountPasswordPolicyArgs.builder()
* .minimumPasswordLength(8)
* .requireLowercaseCharacters(true)
* .requireNumbers(true)
* .requireUppercaseCharacters(true)
* .requireSymbols(true)
* .allowUsersToChangePassword(true)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* strict:
* type: aws:iam:AccountPasswordPolicy
* properties:
* minimumPasswordLength: 8
* requireLowercaseCharacters: true
* requireNumbers: true
* requireUppercaseCharacters: true
* requireSymbols: true
* allowUsersToChangePassword: true
* ```
*
* ## Import
* Using `pulumi import`, import IAM Account Password Policy using the word `iam-account-password-policy`. For example:
* ```sh
* $ pulumi import aws:iam/accountPasswordPolicy:AccountPasswordPolicy strict iam-account-password-policy
* ```
* @property allowUsersToChangePassword Whether to allow users to change their own password
* @property hardExpiry Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)
* @property maxPasswordAge The number of days that an user password is valid.
* @property minimumPasswordLength Minimum length to require for user passwords.
* @property passwordReusePrevention The number of previous passwords that users are prevented from reusing.
* @property requireLowercaseCharacters Whether to require lowercase characters for user passwords.
* @property requireNumbers Whether to require numbers for user passwords.
* @property requireSymbols Whether to require symbols for user passwords.
* @property requireUppercaseCharacters Whether to require uppercase characters for user passwords.
*/
public data class AccountPasswordPolicyArgs(
public val allowUsersToChangePassword: Output? = null,
public val hardExpiry: Output? = null,
public val maxPasswordAge: Output? = null,
public val minimumPasswordLength: Output? = null,
public val passwordReusePrevention: Output? = null,
public val requireLowercaseCharacters: Output? = null,
public val requireNumbers: Output? = null,
public val requireSymbols: Output? = null,
public val requireUppercaseCharacters: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.iam.AccountPasswordPolicyArgs =
com.pulumi.aws.iam.AccountPasswordPolicyArgs.builder()
.allowUsersToChangePassword(allowUsersToChangePassword?.applyValue({ args0 -> args0 }))
.hardExpiry(hardExpiry?.applyValue({ args0 -> args0 }))
.maxPasswordAge(maxPasswordAge?.applyValue({ args0 -> args0 }))
.minimumPasswordLength(minimumPasswordLength?.applyValue({ args0 -> args0 }))
.passwordReusePrevention(passwordReusePrevention?.applyValue({ args0 -> args0 }))
.requireLowercaseCharacters(requireLowercaseCharacters?.applyValue({ args0 -> args0 }))
.requireNumbers(requireNumbers?.applyValue({ args0 -> args0 }))
.requireSymbols(requireSymbols?.applyValue({ args0 -> args0 }))
.requireUppercaseCharacters(requireUppercaseCharacters?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [AccountPasswordPolicyArgs].
*/
@PulumiTagMarker
public class AccountPasswordPolicyArgsBuilder internal constructor() {
private var allowUsersToChangePassword: Output? = null
private var hardExpiry: Output? = null
private var maxPasswordAge: Output? = null
private var minimumPasswordLength: Output? = null
private var passwordReusePrevention: Output? = null
private var requireLowercaseCharacters: Output? = null
private var requireNumbers: Output? = null
private var requireSymbols: Output? = null
private var requireUppercaseCharacters: Output? = null
/**
* @param value Whether to allow users to change their own password
*/
@JvmName("xnmtngsyydulcesl")
public suspend fun allowUsersToChangePassword(`value`: Output) {
this.allowUsersToChangePassword = value
}
/**
* @param value Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)
*/
@JvmName("rroytbdlaelrucpu")
public suspend fun hardExpiry(`value`: Output) {
this.hardExpiry = value
}
/**
* @param value The number of days that an user password is valid.
*/
@JvmName("abdmdlhgdrsrjsyj")
public suspend fun maxPasswordAge(`value`: Output) {
this.maxPasswordAge = value
}
/**
* @param value Minimum length to require for user passwords.
*/
@JvmName("gkorxdbjryssjfvf")
public suspend fun minimumPasswordLength(`value`: Output) {
this.minimumPasswordLength = value
}
/**
* @param value The number of previous passwords that users are prevented from reusing.
*/
@JvmName("ptagvnajqeuppegl")
public suspend fun passwordReusePrevention(`value`: Output) {
this.passwordReusePrevention = value
}
/**
* @param value Whether to require lowercase characters for user passwords.
*/
@JvmName("iexnvufxohcoujax")
public suspend fun requireLowercaseCharacters(`value`: Output) {
this.requireLowercaseCharacters = value
}
/**
* @param value Whether to require numbers for user passwords.
*/
@JvmName("knypbqpoecneeoqo")
public suspend fun requireNumbers(`value`: Output) {
this.requireNumbers = value
}
/**
* @param value Whether to require symbols for user passwords.
*/
@JvmName("uknmrmosctcjltnn")
public suspend fun requireSymbols(`value`: Output) {
this.requireSymbols = value
}
/**
* @param value Whether to require uppercase characters for user passwords.
*/
@JvmName("ppofxvvkslugtxac")
public suspend fun requireUppercaseCharacters(`value`: Output) {
this.requireUppercaseCharacters = value
}
/**
* @param value Whether to allow users to change their own password
*/
@JvmName("twwmjbdrovtgshsa")
public suspend fun allowUsersToChangePassword(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.allowUsersToChangePassword = mapped
}
/**
* @param value Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)
*/
@JvmName("fjnkhrcdvgmfrmms")
public suspend fun hardExpiry(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.hardExpiry = mapped
}
/**
* @param value The number of days that an user password is valid.
*/
@JvmName("vmjkdkwofqdhipch")
public suspend fun maxPasswordAge(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.maxPasswordAge = mapped
}
/**
* @param value Minimum length to require for user passwords.
*/
@JvmName("rcqvjpvktgisnoht")
public suspend fun minimumPasswordLength(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.minimumPasswordLength = mapped
}
/**
* @param value The number of previous passwords that users are prevented from reusing.
*/
@JvmName("olmjrafffagjsmck")
public suspend fun passwordReusePrevention(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.passwordReusePrevention = mapped
}
/**
* @param value Whether to require lowercase characters for user passwords.
*/
@JvmName("ksyuaslueqqdqpqm")
public suspend fun requireLowercaseCharacters(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.requireLowercaseCharacters = mapped
}
/**
* @param value Whether to require numbers for user passwords.
*/
@JvmName("tcaiyvsklydurntf")
public suspend fun requireNumbers(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.requireNumbers = mapped
}
/**
* @param value Whether to require symbols for user passwords.
*/
@JvmName("nxwpnyarjydjbpgk")
public suspend fun requireSymbols(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.requireSymbols = mapped
}
/**
* @param value Whether to require uppercase characters for user passwords.
*/
@JvmName("kfeahmlkusquoonm")
public suspend fun requireUppercaseCharacters(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.requireUppercaseCharacters = mapped
}
internal fun build(): AccountPasswordPolicyArgs = AccountPasswordPolicyArgs(
allowUsersToChangePassword = allowUsersToChangePassword,
hardExpiry = hardExpiry,
maxPasswordAge = maxPasswordAge,
minimumPasswordLength = minimumPasswordLength,
passwordReusePrevention = passwordReusePrevention,
requireLowercaseCharacters = requireLowercaseCharacters,
requireNumbers = requireNumbers,
requireSymbols = requireSymbols,
requireUppercaseCharacters = requireUppercaseCharacters,
)
}