com.pulumi.awsnative.redshift.kotlin.ScheduledAction.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.redshift.kotlin
import com.pulumi.awsnative.redshift.kotlin.enums.ScheduledActionState
import com.pulumi.awsnative.redshift.kotlin.outputs.ScheduledActionType
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.redshift.kotlin.enums.ScheduledActionState.Companion.toKotlin as scheduledActionStateToKotlin
import com.pulumi.awsnative.redshift.kotlin.outputs.ScheduledActionType.Companion.toKotlin as scheduledActionTypeToKotlin
/**
* Builder for [ScheduledAction].
*/
@PulumiTagMarker
public class ScheduledActionResourceBuilder internal constructor() {
public var name: String? = null
public var args: ScheduledActionArgs = ScheduledActionArgs()
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 ScheduledActionArgsBuilder.() -> Unit) {
val builder = ScheduledActionArgsBuilder()
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(): ScheduledAction {
val builtJavaResource = com.pulumi.awsnative.redshift.ScheduledAction(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ScheduledAction(builtJavaResource)
}
}
/**
* The `AWS::Redshift::ScheduledAction` resource creates an Amazon Redshift Scheduled Action.
*/
public class ScheduledAction internal constructor(
override val javaResource: com.pulumi.awsnative.redshift.ScheduledAction,
) : KotlinCustomResource(javaResource, ScheduledActionMapper) {
/**
* If true, the schedule is enabled. If false, the scheduled action does not trigger.
*/
public val enable: Output?
get() = javaResource.enable().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The end time in UTC of the scheduled action. After this time, the scheduled action does not trigger.
*/
public val endTime: Output?
get() = javaResource.endTime().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The IAM role to assume to run the target action.
*/
public val iamRole: Output?
get() = javaResource.iamRole().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* List of times when the scheduled action will run.
*/
public val nextInvocations: Output>
get() = javaResource.nextInvocations().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
/**
* The schedule in `at( )` or `cron( )` format.
*/
public val schedule: Output?
get() = javaResource.schedule().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The description of the scheduled action.
*/
public val scheduledActionDescription: Output?
get() = javaResource.scheduledActionDescription().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the scheduled action. The name must be unique within an account.
*/
public val scheduledActionName: Output
get() = javaResource.scheduledActionName().applyValue({ args0 -> args0 })
/**
* The start time in UTC of the scheduled action. Before this time, the scheduled action does not trigger.
*/
public val startTime: Output?
get() = javaResource.startTime().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The state of the scheduled action.
*/
public val state: Output
get() = javaResource.state().applyValue({ args0 ->
args0.let({ args0 ->
scheduledActionStateToKotlin(args0)
})
})
/**
* A JSON format string of the Amazon Redshift API operation with input parameters.
*/
public val targetAction: Output?
get() = javaResource.targetAction().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
scheduledActionTypeToKotlin(args0)
})
}).orElse(null)
})
}
public object ScheduledActionMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.redshift.ScheduledAction::class == javaResource::class
override fun map(javaResource: Resource): ScheduledAction = ScheduledAction(
javaResource as
com.pulumi.awsnative.redshift.ScheduledAction,
)
}
/**
* @see [ScheduledAction].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [ScheduledAction].
*/
public suspend fun scheduledAction(
name: String,
block: suspend ScheduledActionResourceBuilder.() -> Unit,
): ScheduledAction {
val builder = ScheduledActionResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [ScheduledAction].
* @param name The _unique_ name of the resulting resource.
*/
public fun scheduledAction(name: String): ScheduledAction {
val builder = ScheduledActionResourceBuilder()
builder.name(name)
return builder.build()
}