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

com.pulumi.awsnative.iam.kotlin.InstanceProfile.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.iam.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

/**
 * Builder for [InstanceProfile].
 */
@PulumiTagMarker
public class InstanceProfileResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: InstanceProfileArgs = InstanceProfileArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend InstanceProfileArgsBuilder.() -> Unit) {
        val builder = InstanceProfileArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): InstanceProfile {
        val builtJavaResource = com.pulumi.awsnative.iam.InstanceProfile(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return InstanceProfile(builtJavaResource)
    }
}

/**
 * Creates a new instance profile. For information about instance profiles, see [Using instance profiles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html).
 *   For information about the number of instance profiles you can create, see [object quotas](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html) in the *User Guide*.
 * ## Example Usage
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 */
public class InstanceProfile internal constructor(
    override val javaResource: com.pulumi.awsnative.iam.InstanceProfile,
) : KotlinCustomResource(javaResource, InstanceProfileMapper) {
    /**
     * Returns the Amazon Resource Name (ARN) for the instance profile. For example:
     * `{"Fn::GetAtt" : ["MyProfile", "Arn"] }`
     * This returns a value such as `arn:aws:iam::1234567890:instance-profile/MyProfile-ASDNSDLKJ` .
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The name of the instance profile to create.
     *  This parameter allows (through its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
     */
    public val instanceProfileName: Output?
        get() = javaResource.instanceProfileName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The path to the instance profile. For more information about paths, see [IAM Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) in the *IAM User Guide*.
     *  This parameter is optional. If it is not included, it defaults to a slash (/).
     *  This parameter allows (through its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (``\u0021``) through the DEL character (``\u007F``), including most punctuation characters, digits, and upper and lowercased letters.
     */
    public val path: Output?
        get() = javaResource.path().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The name of the role to associate with the instance profile. Only one role can be assigned to an EC2 instance at a time, and all applications on the instance share the same role and permissions.
     */
    public val roles: Output>
        get() = javaResource.roles().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
}

public object InstanceProfileMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.iam.InstanceProfile::class == javaResource::class

    override fun map(javaResource: Resource): InstanceProfile = InstanceProfile(
        javaResource as
            com.pulumi.awsnative.iam.InstanceProfile,
    )
}

/**
 * @see [InstanceProfile].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [InstanceProfile].
 */
public suspend fun instanceProfile(
    name: String,
    block: suspend InstanceProfileResourceBuilder.() -> Unit,
): InstanceProfile {
    val builder = InstanceProfileResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [InstanceProfile].
 * @param name The _unique_ name of the resulting resource.
 */
public fun instanceProfile(name: String): InstanceProfile {
    val builder = InstanceProfileResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy