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

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

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

package com.pulumi.awsnative.securityhub.kotlin

import com.pulumi.awsnative.securityhub.kotlin.enums.FindingAggregatorRegionLinkingMode
import com.pulumi.awsnative.securityhub.kotlin.enums.FindingAggregatorRegionLinkingMode.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
import kotlin.collections.List

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

    public var args: FindingAggregatorArgs = FindingAggregatorArgs()

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

/**
 * The ``AWS::SecurityHub::FindingAggregator`` resource enables cross-Region aggregation. When cross-Region aggregation is enabled, you can aggregate findings, finding updates, insights, control compliance statuses, and security scores from one or more linked Regions to a single aggregation Region. You can then view and manage all of this data from the aggregation Region. For more details about cross-Region aggregation, see [Cross-Region aggregation](https://docs.aws.amazon.com/securityhub/latest/userguide/finding-aggregation.html) in the *User Guide*
 *  This resource must be created in the Region that you want to designate as your aggregation Region.
 *  Cross-Region aggregation is also a prerequisite for using [central configuration](https://docs.aws.amazon.com/securityhub/latest/userguide/central-configuration-intro.html) in ASH.
 */
public class FindingAggregator internal constructor(
    override val javaResource: com.pulumi.awsnative.securityhub.FindingAggregator,
) : KotlinCustomResource(javaResource, FindingAggregatorMapper) {
    /**
     * The aggregation Region.
     */
    public val findingAggregationRegion: Output
        get() = javaResource.findingAggregationRegion().applyValue({ args0 -> args0 })

    /**
     * The ARN of the finding aggregator. You use the finding aggregator ARN to retrieve details for, update, and delete the finding aggregator.
     */
    public val findingAggregatorArn: Output
        get() = javaResource.findingAggregatorArn().applyValue({ args0 -> args0 })

    /**
     * Indicates whether to aggregate findings from all of the available Regions in the current partition. Also determines whether to automatically aggregate findings from new Regions as Security Hub supports them and you opt into them.
     *  The selected option also determines how to use the Regions provided in the Regions list.
     *  The options are as follows:
     *   +   ``ALL_REGIONS`` - Aggregates findings from all of the Regions where Security Hub is enabled. When you choose this option, Security Hub also automatically aggregates findings from new Regions as Security Hub supports them and you opt into them.
     *   +   ``ALL_REGIONS_EXCEPT_SPECIFIED`` - Aggregates findings from all of the Regions where Security Hub is enabled, except for the Regions listed in the ``Regions`` parameter. When you choose this option, Security Hub also automatically aggregates findings from new Regions as Security Hub supports them and you opt into them.
     *   +   ``SPECIFIED_REGIONS`` - Aggregates findings only from the Regions listed in the ``Regions`` parameter. Security Hub does not automatically aggregate findings from new Regions.
     *   +   ``NO_REGIONS`` - Aggregates no data because no Regions are selected as linked Regions.
     */
    public val regionLinkingMode: Output
        get() = javaResource.regionLinkingMode().applyValue({ args0 ->
            args0.let({ args0 ->
                toKotlin(args0)
            })
        })

    /**
     * If ``RegionLinkingMode`` is ``ALL_REGIONS_EXCEPT_SPECIFIED``, then this is a space-separated list of Regions that do not aggregate findings to the aggregation Region.
     *  If ``RegionLinkingMode`` is ``SPECIFIED_REGIONS``, then this is a space-separated list of Regions that do aggregate findings to the aggregation Region.
     *  An ``InvalidInputException`` error results if you populate this field while ``RegionLinkingMode`` is ``NO_REGIONS``.
     */
    public val regions: Output>?
        get() = javaResource.regions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy