com.pulumi.awsnative.guardduty.kotlin.Detector.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.guardduty.kotlin
import com.pulumi.awsnative.guardduty.kotlin.outputs.DetectorCfnDataSourceConfigurations
import com.pulumi.awsnative.guardduty.kotlin.outputs.DetectorCfnFeatureConfiguration
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.guardduty.kotlin.outputs.DetectorCfnDataSourceConfigurations.Companion.toKotlin as detectorCfnDataSourceConfigurationsToKotlin
import com.pulumi.awsnative.guardduty.kotlin.outputs.DetectorCfnFeatureConfiguration.Companion.toKotlin as detectorCfnFeatureConfigurationToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [Detector].
*/
@PulumiTagMarker
public class DetectorResourceBuilder internal constructor() {
public var name: String? = null
public var args: DetectorArgs = DetectorArgs()
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 DetectorArgsBuilder.() -> Unit) {
val builder = DetectorArgsBuilder()
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(): Detector {
val builtJavaResource = com.pulumi.awsnative.guardduty.Detector(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Detector(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::GuardDuty::Detector
*/
public class Detector internal constructor(
override val javaResource: com.pulumi.awsnative.guardduty.Detector,
) : KotlinCustomResource(javaResource, DetectorMapper) {
/**
* The unique ID of the detector.
*/
public val awsId: Output
get() = javaResource.awsId().applyValue({ args0 -> args0 })
/**
* Describes which data sources will be enabled for the detector.
*/
public val dataSources: Output?
get() = javaResource.dataSources().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
detectorCfnDataSourceConfigurationsToKotlin(args0)
})
}).orElse(null)
})
/**
* Specifies whether the detector is to be enabled on creation.
*/
public val enable: Output
get() = javaResource.enable().applyValue({ args0 -> args0 })
/**
* A list of features that will be configured for the detector.
*/
public val features: Output>?
get() = javaResource.features().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> detectorCfnFeatureConfigurationToKotlin(args0) })
})
}).orElse(null)
})
/**
* Specifies how frequently updated findings are exported.
*/
public val findingPublishingFrequency: Output?
get() = javaResource.findingPublishingFrequency().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specifies tags added to a new detector resource. Each tag consists of a key and an optional value, both of which you define.
* Currently, support is available only for creating and deleting a tag. No support exists for updating the tags.
* For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) .
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
}
public object DetectorMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.guardduty.Detector::class == javaResource::class
override fun map(javaResource: Resource): Detector = Detector(
javaResource as
com.pulumi.awsnative.guardduty.Detector,
)
}
/**
* @see [Detector].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Detector].
*/
public suspend fun detector(name: String, block: suspend DetectorResourceBuilder.() -> Unit): Detector {
val builder = DetectorResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Detector].
* @param name The _unique_ name of the resulting resource.
*/
public fun detector(name: String): Detector {
val builder = DetectorResourceBuilder()
builder.name(name)
return builder.build()
}