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

com.pulumi.aws.iot.kotlin.RoleAliasArgs.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.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.iot.kotlin

import com.pulumi.aws.iot.RoleAliasArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Provides an IoT role alias.
 * ## Example Usage
 * 
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.iam.IamFunctions;
 * import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
 * import com.pulumi.aws.iam.Role;
 * import com.pulumi.aws.iam.RoleArgs;
 * import com.pulumi.aws.iot.RoleAlias;
 * import com.pulumi.aws.iot.RoleAliasArgs;
 * 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) {
 *         final var assumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
 *             .effect("Allow")
 *             .principals(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
 *             .actions("sts:AssumeRole")
 *             .build());
 *         var role = new Role("role", RoleArgs.builder()
 *             .name("dynamodb-access-role")
 *             .assumeRolePolicy(assumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
 *             .build());
 *         var alias = new RoleAlias("alias", RoleAliasArgs.builder()
 *             .alias("Thermostat-dynamodb-access-role-alias")
 *             .roleArn(role.arn())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   role:
 *     type: aws:iam:Role
 *     properties:
 *       name: dynamodb-access-role
 *       assumeRolePolicy: ${assumeRole.json}
 *   alias:
 *     type: aws:iot:RoleAlias
 *     properties:
 *       alias: Thermostat-dynamodb-access-role-alias
 *       roleArn: ${role.arn}
 * variables:
 *   assumeRole:
 *     fn::invoke:
 *       Function: aws:iam:getPolicyDocument
 *       Arguments:
 *         effect: Allow
 *         principals:
 *           - type: Service
 *             identifiers:
 *               - credentials.iot.amazonaws.com
 *         actions:
 *           - sts:AssumeRole
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import IOT Role Alias using the alias. For example:
 * ```sh
 * $ pulumi import aws:iot/roleAlias:RoleAlias example myalias
 * ```
 * @property alias The name of the role alias.
 * @property credentialDuration The duration of the credential, in seconds. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 900 seconds (15 minutes) to 43200 seconds (12 hours).
 * @property roleArn The identity of the role to which the alias refers.
 * @property tags Key-value mapping of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
 */
public data class RoleAliasArgs(
    public val alias: Output? = null,
    public val credentialDuration: Output? = null,
    public val roleArn: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.iot.RoleAliasArgs =
        com.pulumi.aws.iot.RoleAliasArgs.builder()
            .alias(alias?.applyValue({ args0 -> args0 }))
            .credentialDuration(credentialDuration?.applyValue({ args0 -> args0 }))
            .roleArn(roleArn?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [RoleAliasArgs].
 */
@PulumiTagMarker
public class RoleAliasArgsBuilder internal constructor() {
    private var alias: Output? = null

    private var credentialDuration: Output? = null

    private var roleArn: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The name of the role alias.
     */
    @JvmName("bqwkqvsctfqijdkr")
    public suspend fun alias(`value`: Output) {
        this.alias = value
    }

    /**
     * @param value The duration of the credential, in seconds. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 900 seconds (15 minutes) to 43200 seconds (12 hours).
     */
    @JvmName("hsisiqdjkoiymyjw")
    public suspend fun credentialDuration(`value`: Output) {
        this.credentialDuration = value
    }

    /**
     * @param value The identity of the role to which the alias refers.
     */
    @JvmName("vjjkyqhihoqrxvxu")
    public suspend fun roleArn(`value`: Output) {
        this.roleArn = value
    }

    /**
     * @param value Key-value mapping of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("nhkqqxglluuqtnfd")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The name of the role alias.
     */
    @JvmName("iwmhvhxhnfcymagt")
    public suspend fun alias(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.alias = mapped
    }

    /**
     * @param value The duration of the credential, in seconds. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 900 seconds (15 minutes) to 43200 seconds (12 hours).
     */
    @JvmName("xmpfadacdjncvvwf")
    public suspend fun credentialDuration(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.credentialDuration = mapped
    }

    /**
     * @param value The identity of the role to which the alias refers.
     */
    @JvmName("uqjlfyehodkkaryn")
    public suspend fun roleArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.roleArn = mapped
    }

    /**
     * @param value Key-value mapping of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("ipxnfyotdtuxjljf")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Key-value mapping of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("qbbjcjuykeimwsmy")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): RoleAliasArgs = RoleAliasArgs(
        alias = alias,
        credentialDuration = credentialDuration,
        roleArn = roleArn,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy