com.pulumi.awsnative.iot.kotlin.ScheduledAudit.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.iot.kotlin
import com.pulumi.awsnative.iot.kotlin.enums.ScheduledAuditDayOfWeek
import com.pulumi.awsnative.iot.kotlin.enums.ScheduledAuditFrequency
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.iot.kotlin.enums.ScheduledAuditDayOfWeek.Companion.toKotlin as scheduledAuditDayOfWeekToKotlin
import com.pulumi.awsnative.iot.kotlin.enums.ScheduledAuditFrequency.Companion.toKotlin as scheduledAuditFrequencyToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [ScheduledAudit].
*/
@PulumiTagMarker
public class ScheduledAuditResourceBuilder internal constructor() {
public var name: String? = null
public var args: ScheduledAuditArgs = ScheduledAuditArgs()
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 ScheduledAuditArgsBuilder.() -> Unit) {
val builder = ScheduledAuditArgsBuilder()
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(): ScheduledAudit {
val builtJavaResource = com.pulumi.awsnative.iot.ScheduledAudit(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ScheduledAudit(builtJavaResource)
}
}
/**
* Scheduled audits can be used to specify the checks you want to perform during an audit and how often the audit should be run.
*/
public class ScheduledAudit internal constructor(
override val javaResource: com.pulumi.awsnative.iot.ScheduledAudit,
) : KotlinCustomResource(javaResource, ScheduledAuditMapper) {
/**
* The day of the month on which the scheduled audit takes place. Can be 1 through 31 or LAST. This field is required if the frequency parameter is set to MONTHLY.
*/
public val dayOfMonth: Output?
get() = javaResource.dayOfMonth().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The day of the week on which the scheduled audit takes place. Can be one of SUN, MON, TUE,WED, THU, FRI, or SAT. This field is required if the frequency parameter is set to WEEKLY or BIWEEKLY.
*/
public val dayOfWeek: Output?
get() = javaResource.dayOfWeek().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
scheduledAuditDayOfWeekToKotlin(args0)
})
}).orElse(null)
})
/**
* How often the scheduled audit takes place. Can be one of DAILY, WEEKLY, BIWEEKLY, or MONTHLY.
*/
public val frequency: Output
get() = javaResource.frequency().applyValue({ args0 ->
args0.let({ args0 ->
scheduledAuditFrequencyToKotlin(args0)
})
})
/**
* The ARN (Amazon resource name) of the scheduled audit.
*/
public val scheduledAuditArn: Output
get() = javaResource.scheduledAuditArn().applyValue({ args0 -> args0 })
/**
* The name you want to give to the scheduled audit.
*/
public val scheduledAuditName: Output?
get() = javaResource.scheduledAuditName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* An array of key-value pairs to apply to this resource.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
/**
* Which checks are performed during the scheduled audit. Checks must be enabled for your account.
*/
public val targetCheckNames: Output>
get() = javaResource.targetCheckNames().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
}
public object ScheduledAuditMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.iot.ScheduledAudit::class == javaResource::class
override fun map(javaResource: Resource): ScheduledAudit = ScheduledAudit(
javaResource as
com.pulumi.awsnative.iot.ScheduledAudit,
)
}
/**
* @see [ScheduledAudit].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [ScheduledAudit].
*/
public suspend fun scheduledAudit(
name: String,
block: suspend ScheduledAuditResourceBuilder.() -> Unit,
): ScheduledAudit {
val builder = ScheduledAuditResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [ScheduledAudit].
* @param name The _unique_ name of the resulting resource.
*/
public fun scheduledAudit(name: String): ScheduledAudit {
val builder = ScheduledAuditResourceBuilder()
builder.name(name)
return builder.build()
}