
com.pulumi.awsnative.lookoutmetrics.kotlin.AnomalyDetector.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.lookoutmetrics.kotlin
import com.pulumi.awsnative.lookoutmetrics.kotlin.outputs.AnomalyDetectorConfig
import com.pulumi.awsnative.lookoutmetrics.kotlin.outputs.AnomalyDetectorMetricSet
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.lookoutmetrics.kotlin.outputs.AnomalyDetectorConfig.Companion.toKotlin as anomalyDetectorConfigToKotlin
import com.pulumi.awsnative.lookoutmetrics.kotlin.outputs.AnomalyDetectorMetricSet.Companion.toKotlin as anomalyDetectorMetricSetToKotlin
/**
* Builder for [AnomalyDetector].
*/
@PulumiTagMarker
public class AnomalyDetectorResourceBuilder internal constructor() {
public var name: String? = null
public var args: AnomalyDetectorArgs = AnomalyDetectorArgs()
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 AnomalyDetectorArgsBuilder.() -> Unit) {
val builder = AnomalyDetectorArgsBuilder()
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(): AnomalyDetector {
val builtJavaResource =
com.pulumi.awsnative.lookoutmetrics.AnomalyDetector(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return AnomalyDetector(builtJavaResource)
}
}
/**
* An Amazon Lookout for Metrics Detector
*/
public class AnomalyDetector internal constructor(
override val javaResource: com.pulumi.awsnative.lookoutmetrics.AnomalyDetector,
) : KotlinCustomResource(javaResource, AnomalyDetectorMapper) {
/**
* Configuration options for the AnomalyDetector
*/
public val anomalyDetectorConfig: Output
get() = javaResource.anomalyDetectorConfig().applyValue({ args0 ->
args0.let({ args0 ->
anomalyDetectorConfigToKotlin(args0)
})
})
/**
* A description for the AnomalyDetector.
*/
public val anomalyDetectorDescription: Output?
get() = javaResource.anomalyDetectorDescription().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Name for the Amazon Lookout for Metrics Anomaly Detector
*/
public val anomalyDetectorName: Output?
get() = javaResource.anomalyDetectorName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Amazon Resource Name (ARN) of the detector. For example, `arn:aws:lookoutmetrics:us-east-2:123456789012:AnomalyDetector:my-detector`
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* KMS key used to encrypt the AnomalyDetector data
*/
public val kmsKeyArn: Output?
get() = javaResource.kmsKeyArn().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* List of metric sets for anomaly detection
*/
public val metricSetList: Output>
get() = javaResource.metricSetList().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> anomalyDetectorMetricSetToKotlin(args0) })
})
})
}
public object AnomalyDetectorMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.lookoutmetrics.AnomalyDetector::class == javaResource::class
override fun map(javaResource: Resource): AnomalyDetector = AnomalyDetector(
javaResource as
com.pulumi.awsnative.lookoutmetrics.AnomalyDetector,
)
}
/**
* @see [AnomalyDetector].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [AnomalyDetector].
*/
public suspend fun anomalyDetector(
name: String,
block: suspend AnomalyDetectorResourceBuilder.() -> Unit,
): AnomalyDetector {
val builder = AnomalyDetectorResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [AnomalyDetector].
* @param name The _unique_ name of the resulting resource.
*/
public fun anomalyDetector(name: String): AnomalyDetector {
val builder = AnomalyDetectorResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy