com.pulumi.awsnative.logs.kotlin.LogAnomalyDetector.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.logs.kotlin
import com.pulumi.awsnative.logs.kotlin.enums.LogAnomalyDetectorEvaluationFrequency
import com.pulumi.awsnative.logs.kotlin.enums.LogAnomalyDetectorEvaluationFrequency.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.Double
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [LogAnomalyDetector].
*/
@PulumiTagMarker
public class LogAnomalyDetectorResourceBuilder internal constructor() {
public var name: String? = null
public var args: LogAnomalyDetectorArgs = LogAnomalyDetectorArgs()
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 LogAnomalyDetectorArgsBuilder.() -> Unit) {
val builder = LogAnomalyDetectorArgsBuilder()
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(): LogAnomalyDetector {
val builtJavaResource = com.pulumi.awsnative.logs.LogAnomalyDetector(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return LogAnomalyDetector(builtJavaResource)
}
}
/**
* The AWS::Logs::LogAnomalyDetector resource specifies a CloudWatch Logs LogAnomalyDetector.
*/
public class LogAnomalyDetector internal constructor(
override val javaResource: com.pulumi.awsnative.logs.LogAnomalyDetector,
) : KotlinCustomResource(javaResource, LogAnomalyDetectorMapper) {
/**
* Account ID for owner of detector
*/
public val accountId: Output?
get() = javaResource.accountId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* ARN of LogAnomalyDetector
*/
public val anomalyDetectorArn: Output
get() = javaResource.anomalyDetectorArn().applyValue({ args0 -> args0 })
/**
* Current status of detector.
*/
public val anomalyDetectorStatus: Output
get() = javaResource.anomalyDetectorStatus().applyValue({ args0 -> args0 })
/**
* The number of days to have visibility on an anomaly. After this time period has elapsed for an anomaly, it will be automatically baselined and the anomaly detector will treat new occurrences of a similar anomaly as normal. Therefore, if you do not correct the cause of an anomaly during the time period specified in `AnomalyVisibilityTime` , it will be considered normal going forward and will not be detected as an anomaly.
*/
public val anomalyVisibilityTime: Output?
get() = javaResource.anomalyVisibilityTime().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* When detector was created.
*/
public val creationTimeStamp: Output
get() = javaResource.creationTimeStamp().applyValue({ args0 -> args0 })
/**
* Name of detector
*/
public val detectorName: Output?
get() = javaResource.detectorName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* How often log group is evaluated
*/
public val evaluationFrequency: Output?
get() = javaResource.evaluationFrequency().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
}).orElse(null)
})
/**
* You can use this parameter to limit the anomaly detection model to examine only log events that match the pattern you specify here. For more information, see [Filter and Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) .
*/
public val filterPattern: Output?
get() = javaResource.filterPattern().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Amazon Resource Name (ARN) of the CMK to use when encrypting log data.
*/
public val kmsKeyId: Output?
get() = javaResource.kmsKeyId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* When detector was lsat modified.
*/
public val lastModifiedTimeStamp: Output
get() = javaResource.lastModifiedTimeStamp().applyValue({ args0 -> args0 })
/**
* List of Arns for the given log group
*/
public val logGroupArnList: Output>?
get() = javaResource.logGroupArnList().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
}
public object LogAnomalyDetectorMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.logs.LogAnomalyDetector::class == javaResource::class
override fun map(javaResource: Resource): LogAnomalyDetector = LogAnomalyDetector(
javaResource as
com.pulumi.awsnative.logs.LogAnomalyDetector,
)
}
/**
* @see [LogAnomalyDetector].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [LogAnomalyDetector].
*/
public suspend fun logAnomalyDetector(
name: String,
block: suspend LogAnomalyDetectorResourceBuilder.() -> Unit,
): LogAnomalyDetector {
val builder = LogAnomalyDetectorResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [LogAnomalyDetector].
* @param name The _unique_ name of the resulting resource.
*/
public fun logAnomalyDetector(name: String): LogAnomalyDetector {
val builder = LogAnomalyDetectorResourceBuilder()
builder.name(name)
return builder.build()
}