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

com.pulumi.awsnative.accessanalyzer.kotlin.Analyzer.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.accessanalyzer.kotlin

import com.pulumi.awsnative.accessanalyzer.kotlin.outputs.AnalyzerArchiveRule
import com.pulumi.awsnative.accessanalyzer.kotlin.outputs.AnalyzerConfigurationProperties
import com.pulumi.awsnative.kotlin.outputs.Tag
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
import com.pulumi.awsnative.accessanalyzer.kotlin.outputs.AnalyzerArchiveRule.Companion.toKotlin as analyzerArchiveRuleToKotlin
import com.pulumi.awsnative.accessanalyzer.kotlin.outputs.AnalyzerConfigurationProperties.Companion.toKotlin as analyzerConfigurationPropertiesToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: AnalyzerArgs = AnalyzerArgs()

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

/**
 * The AWS::AccessAnalyzer::Analyzer type specifies an analyzer of the user's account
 * ## Example Usage
 * ### Example
 * No Java example available.
 */
public class Analyzer internal constructor(
    override val javaResource: com.pulumi.awsnative.accessanalyzer.Analyzer,
) : KotlinCustomResource(javaResource, AnalyzerMapper) {
    /**
     * The configuration for the analyzer
     */
    public val analyzerConfiguration: Output?
        get() = javaResource.analyzerConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> analyzerConfigurationPropertiesToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Analyzer name
     */
    public val analyzerName: Output?
        get() = javaResource.analyzerName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies the archive rules to add for the analyzer. Archive rules automatically archive findings that meet the criteria you define for the rule.
     */
    public val archiveRules: Output>?
        get() = javaResource.archiveRules().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> analyzerArchiveRuleToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * Amazon Resource Name (ARN) of the analyzer
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * An array of key-value pairs to apply to this resource.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The type of the analyzer, must be one of ACCOUNT, ORGANIZATION, ACCOUNT_UNUSED_ACCESS or ORGANIZATION_UNUSED_ACCESS
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })
}

public object AnalyzerMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.accessanalyzer.Analyzer::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy