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

com.pulumi.awsnative.securityhub.kotlin.DelegatedAdmin.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.securityhub.kotlin

import com.pulumi.awsnative.securityhub.kotlin.enums.DelegatedAdminStatus
import com.pulumi.awsnative.securityhub.kotlin.enums.DelegatedAdminStatus.Companion.toKotlin
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

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

    public var args: DelegatedAdminArgs = DelegatedAdminArgs()

    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 DelegatedAdminArgsBuilder.() -> Unit) {
        val builder = DelegatedAdminArgsBuilder()
        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(): DelegatedAdmin {
        val builtJavaResource = com.pulumi.awsnative.securityhub.DelegatedAdmin(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return DelegatedAdmin(builtJavaResource)
    }
}

/**
 * The ``AWS::SecurityHub::DelegatedAdmin`` resource designates the delegated ASHlong administrator account for an organization. You must enable the integration between ASH and AOlong before you can designate a delegated ASH administrator. Only the management account for an organization can designate the delegated ASH administrator account. For more information, see [Designating the delegated administrator](https://docs.aws.amazon.com/securityhub/latest/userguide/designate-orgs-admin-account.html#designate-admin-instructions) in the *User Guide*.
 *  To change the delegated administrator account, remove the current delegated administrator account, and then designate the new account.
 *  To designate multiple delegated administrators in different organizations and AWS-Regions, we recommend using [mappings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/mappings-section-structure.html).
 *  Tags aren't supported for this resource.
 */
public class DelegatedAdmin internal constructor(
    override val javaResource: com.pulumi.awsnative.securityhub.DelegatedAdmin,
) : KotlinCustomResource(javaResource, DelegatedAdminMapper) {
    /**
     * The AWS-account identifier of the account to designate as the Security Hub administrator account.
     */
    public val adminAccountId: Output
        get() = javaResource.adminAccountId().applyValue({ args0 -> args0 })

    /**
     * The ID of the delegated Security Hub administrator account, in the format of `accountID/Region` .
     */
    public val delegatedAdminIdentifier: Output
        get() = javaResource.delegatedAdminIdentifier().applyValue({ args0 -> args0 })

    /**
     * Whether the delegated Security Hub administrator is set for the organization.
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })
}

public object DelegatedAdminMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.securityhub.DelegatedAdmin::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy