com.pulumi.awsnative.rds.kotlin.OptionGroup.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.rds.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.rds.kotlin.outputs.OptionGroupOptionConfiguration
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.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.rds.kotlin.outputs.OptionGroupOptionConfiguration.Companion.toKotlin as optionGroupOptionConfigurationToKotlin
/**
* Builder for [OptionGroup].
*/
@PulumiTagMarker
public class OptionGroupResourceBuilder internal constructor() {
public var name: String? = null
public var args: OptionGroupArgs = OptionGroupArgs()
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 OptionGroupArgsBuilder.() -> Unit) {
val builder = OptionGroupArgsBuilder()
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(): OptionGroup {
val builtJavaResource = com.pulumi.awsnative.rds.OptionGroup(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return OptionGroup(builtJavaResource)
}
}
/**
* The ``AWS::RDS::OptionGroup`` resource creates or updates an option group, to enable and configure features that are specific to a particular DB engine.
*/
public class OptionGroup internal constructor(
override val javaResource: com.pulumi.awsnative.rds.OptionGroup,
) : KotlinCustomResource(javaResource, OptionGroupMapper) {
/**
* Specifies the name of the engine that this option group should be associated with.
* Valid Values:
* + ``mariadb``
* + ``mysql``
* + ``oracle-ee``
* + ``oracle-ee-cdb``
* + ``oracle-se2``
* + ``oracle-se2-cdb``
* + ``postgres``
* + ``sqlserver-ee``
* + ``sqlserver-se``
* + ``sqlserver-ex``
* + ``sqlserver-web``
*/
public val engineName: Output
get() = javaResource.engineName().applyValue({ args0 -> args0 })
/**
* Specifies the major version of the engine that this option group should be associated with.
*/
public val majorEngineVersion: Output
get() = javaResource.majorEngineVersion().applyValue({ args0 -> args0 })
/**
* A list of options and the settings for each option.
*/
public val optionConfigurations: Output>?
get() = javaResource.optionConfigurations().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
optionGroupOptionConfigurationToKotlin(args0)
})
})
}).orElse(null)
})
/**
* The description of the option group.
*/
public val optionGroupDescription: Output
get() = javaResource.optionGroupDescription().applyValue({ args0 -> args0 })
/**
* The name of the option group to be created.
* Constraints:
* + Must be 1 to 255 letters, numbers, or hyphens
* + First character must be a letter
* + Can't end with a hyphen or contain two consecutive hyphens
* Example: ``myoptiongroup``
* If you don't specify a value for ``OptionGroupName`` property, a name is automatically created for the option group.
* This value is stored as a lowercase string.
*/
public val optionGroupName: Output?
get() = javaResource.optionGroupName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* An optional array of key-value pairs to apply to this option group.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
}
public object OptionGroupMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.rds.OptionGroup::class == javaResource::class
override fun map(javaResource: Resource): OptionGroup = OptionGroup(
javaResource as
com.pulumi.awsnative.rds.OptionGroup,
)
}
/**
* @see [OptionGroup].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [OptionGroup].
*/
public suspend fun optionGroup(name: String, block: suspend OptionGroupResourceBuilder.() -> Unit): OptionGroup {
val builder = OptionGroupResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [OptionGroup].
* @param name The _unique_ name of the resulting resource.
*/
public fun optionGroup(name: String): OptionGroup {
val builder = OptionGroupResourceBuilder()
builder.name(name)
return builder.build()
}