com.pulumi.awsnative.ce.kotlin.AnomalySubscription.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.ce.kotlin
import com.pulumi.awsnative.ce.kotlin.enums.AnomalySubscriptionFrequency
import com.pulumi.awsnative.ce.kotlin.outputs.AnomalySubscriptionResourceTag
import com.pulumi.awsnative.ce.kotlin.outputs.AnomalySubscriptionSubscriber
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
import com.pulumi.awsnative.ce.kotlin.enums.AnomalySubscriptionFrequency.Companion.toKotlin as anomalySubscriptionFrequencyToKotlin
import com.pulumi.awsnative.ce.kotlin.outputs.AnomalySubscriptionResourceTag.Companion.toKotlin as anomalySubscriptionResourceTagToKotlin
import com.pulumi.awsnative.ce.kotlin.outputs.AnomalySubscriptionSubscriber.Companion.toKotlin as anomalySubscriptionSubscriberToKotlin
/**
* Builder for [AnomalySubscription].
*/
@PulumiTagMarker
public class AnomalySubscriptionResourceBuilder internal constructor() {
public var name: String? = null
public var args: AnomalySubscriptionArgs = AnomalySubscriptionArgs()
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 AnomalySubscriptionArgsBuilder.() -> Unit) {
val builder = AnomalySubscriptionArgsBuilder()
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(): AnomalySubscription {
val builtJavaResource = com.pulumi.awsnative.ce.AnomalySubscription(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return AnomalySubscription(builtJavaResource)
}
}
/**
* AWS Cost Anomaly Detection leverages advanced Machine Learning technologies to identify anomalous spend and root causes, so you can quickly take action. Create subscription to be notified
* ## Example Usage
* ### Example
* No Java example available.
* ### Example
* No Java example available.
* ### Example
* No Java example available.
* ### Example
* No Java example available.
* ### Example
* No Java example available.
* ### Example
* No Java example available.
*/
public class AnomalySubscription internal constructor(
override val javaResource: com.pulumi.awsnative.ce.AnomalySubscription,
) : KotlinCustomResource(javaResource, AnomalySubscriptionMapper) {
/**
* The accountId
*/
public val accountId: Output
get() = javaResource.accountId().applyValue({ args0 -> args0 })
/**
* The frequency at which anomaly reports are sent over email.
*/
public val frequency: Output
get() = javaResource.frequency().applyValue({ args0 ->
args0.let({ args0 ->
anomalySubscriptionFrequencyToKotlin(args0)
})
})
/**
* A list of cost anomaly monitors.
*/
public val monitorArnList: Output>
get() = javaResource.monitorArnList().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
/**
* Tags to assign to subscription.
*/
public val resourceTags: Output>?
get() = javaResource.resourceTags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> anomalySubscriptionResourceTagToKotlin(args0) })
})
}).orElse(null)
})
/**
* A list of subscriber
*/
public val subscribers: Output>
get() = javaResource.subscribers().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
anomalySubscriptionSubscriberToKotlin(args0)
})
})
})
/**
* The `AnomalySubscription` Amazon Resource Name (ARN).
*/
public val subscriptionArn: Output
get() = javaResource.subscriptionArn().applyValue({ args0 -> args0 })
/**
* The name of the subscription.
*/
public val subscriptionName: Output
get() = javaResource.subscriptionName().applyValue({ args0 -> args0 })
/**
* The dollar value that triggers a notification if the threshold is exceeded.
*/
public val threshold: Output?
get() = javaResource.threshold().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* An Expression object in JSON String format used to specify the anomalies that you want to generate alerts for.
*/
public val thresholdExpression: Output?
get() = javaResource.thresholdExpression().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object AnomalySubscriptionMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.ce.AnomalySubscription::class == javaResource::class
override fun map(javaResource: Resource): AnomalySubscription = AnomalySubscription(
javaResource
as com.pulumi.awsnative.ce.AnomalySubscription,
)
}
/**
* @see [AnomalySubscription].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [AnomalySubscription].
*/
public suspend fun anomalySubscription(
name: String,
block: suspend AnomalySubscriptionResourceBuilder.() -> Unit,
): AnomalySubscription {
val builder = AnomalySubscriptionResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [AnomalySubscription].
* @param name The _unique_ name of the resulting resource.
*/
public fun anomalySubscription(name: String): AnomalySubscription {
val builder = AnomalySubscriptionResourceBuilder()
builder.name(name)
return builder.build()
}