com.pulumi.awsnative.arczonalshift.kotlin.ZonalAutoshiftConfiguration.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.arczonalshift.kotlin
import com.pulumi.awsnative.arczonalshift.kotlin.enums.ZonalAutoshiftConfigurationZonalAutoshiftStatus
import com.pulumi.awsnative.arczonalshift.kotlin.outputs.ZonalAutoshiftConfigurationPracticeRunConfiguration
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 com.pulumi.awsnative.arczonalshift.kotlin.enums.ZonalAutoshiftConfigurationZonalAutoshiftStatus.Companion.toKotlin as zonalAutoshiftConfigurationZonalAutoshiftStatusToKotlin
import com.pulumi.awsnative.arczonalshift.kotlin.outputs.ZonalAutoshiftConfigurationPracticeRunConfiguration.Companion.toKotlin as zonalAutoshiftConfigurationPracticeRunConfigurationToKotlin
/**
* Builder for [ZonalAutoshiftConfiguration].
*/
@PulumiTagMarker
public class ZonalAutoshiftConfigurationResourceBuilder internal constructor() {
public var name: String? = null
public var args: ZonalAutoshiftConfigurationArgs = ZonalAutoshiftConfigurationArgs()
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 ZonalAutoshiftConfigurationArgsBuilder.() -> Unit) {
val builder = ZonalAutoshiftConfigurationArgsBuilder()
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(): ZonalAutoshiftConfiguration {
val builtJavaResource =
com.pulumi.awsnative.arczonalshift.ZonalAutoshiftConfiguration(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ZonalAutoshiftConfiguration(builtJavaResource)
}
}
/**
* Definition of AWS::ARCZonalShift::ZonalAutoshiftConfiguration Resource Type
*/
public class ZonalAutoshiftConfiguration internal constructor(
override val javaResource: com.pulumi.awsnative.arczonalshift.ZonalAutoshiftConfiguration,
) : KotlinCustomResource(javaResource, ZonalAutoshiftConfigurationMapper) {
/**
* A practice run configuration for a resource includes the Amazon CloudWatch alarms that you've specified for a practice run, as well as any blocked dates or blocked windows for the practice run. When a resource has a practice run configuration, Route 53 ARC shifts traffic for the resource weekly for practice runs.
* Practice runs are required for zonal autoshift. The zonal shifts that Route 53 ARC starts for practice runs help you to ensure that shifting away traffic from an Availability Zone during an autoshift is safe for your application.
* You can update or delete a practice run configuration. Before you delete a practice run configuration, you must disable zonal autoshift for the resource. A practice run configuration is required when zonal autoshift is enabled.
*/
public val practiceRunConfiguration: Output?
get() = javaResource.practiceRunConfiguration().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
zonalAutoshiftConfigurationPracticeRunConfigurationToKotlin(args0)
})
}).orElse(null)
})
/**
* The identifier for the resource that AWS shifts traffic for. The identifier is the Amazon Resource Name (ARN) for the resource.
* At this time, supported resources are Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.
*/
public val resourceIdentifier: Output?
get() = javaResource.resourceIdentifier().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* When zonal autoshift is `ENABLED` , you authorize AWS to shift away resource traffic for an application from an Availability Zone during events, on your behalf, to help reduce time to recovery. Traffic is also shifted away for the required weekly practice runs.
*/
public val zonalAutoshiftStatus: Output?
get() = javaResource.zonalAutoshiftStatus().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
zonalAutoshiftConfigurationZonalAutoshiftStatusToKotlin(args0)
})
}).orElse(null)
})
}
public object ZonalAutoshiftConfigurationMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.arczonalshift.ZonalAutoshiftConfiguration::class == javaResource::class
override fun map(javaResource: Resource): ZonalAutoshiftConfiguration =
ZonalAutoshiftConfiguration(
javaResource as
com.pulumi.awsnative.arczonalshift.ZonalAutoshiftConfiguration,
)
}
/**
* @see [ZonalAutoshiftConfiguration].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [ZonalAutoshiftConfiguration].
*/
public suspend fun zonalAutoshiftConfiguration(
name: String,
block: suspend ZonalAutoshiftConfigurationResourceBuilder.() -> Unit,
): ZonalAutoshiftConfiguration {
val builder = ZonalAutoshiftConfigurationResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [ZonalAutoshiftConfiguration].
* @param name The _unique_ name of the resulting resource.
*/
public fun zonalAutoshiftConfiguration(name: String): ZonalAutoshiftConfiguration {
val builder = ZonalAutoshiftConfigurationResourceBuilder()
builder.name(name)
return builder.build()
}