com.pulumi.alicloud.cs.kotlin.Swarm.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-alicloud-kotlin Show documentation
Show all versions of pulumi-alicloud-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.alicloud.cs.kotlin
import com.pulumi.alicloud.cs.kotlin.outputs.SwarmNode
import com.pulumi.alicloud.cs.kotlin.outputs.SwarmNode.Companion.toKotlin
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.Deprecated
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [Swarm].
*/
@PulumiTagMarker
public class SwarmResourceBuilder internal constructor() {
public var name: String? = null
public var args: SwarmArgs = SwarmArgs()
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 SwarmArgsBuilder.() -> Unit) {
val builder = SwarmArgsBuilder()
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(): Swarm {
val builtJavaResource = com.pulumi.alicloud.cs.Swarm(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Swarm(builtJavaResource)
}
}
public class Swarm internal constructor(
override val javaResource: com.pulumi.alicloud.cs.Swarm,
) : KotlinCustomResource(javaResource, SwarmMapper) {
public val agentVersion: Output
get() = javaResource.agentVersion().applyValue({ args0 -> args0 })
public val cidrBlock: Output
get() = javaResource.cidrBlock().applyValue({ args0 -> args0 })
public val diskCategory: Output?
get() = javaResource.diskCategory().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
public val diskSize: Output?
get() = javaResource.diskSize().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
public val imageId: Output?
get() = javaResource.imageId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
public val instanceType: Output
get() = javaResource.instanceType().applyValue({ args0 -> args0 })
public val isOutdated: Output?
get() = javaResource.isOutdated().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
public val namePrefix: Output?
get() = javaResource.namePrefix().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
public val needSlb: Output?
get() = javaResource.needSlb().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
public val nodeNumber: Output?
get() = javaResource.nodeNumber().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
public val nodes: Output>
get() = javaResource.nodes().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
toKotlin(args0)
})
})
})
public val password: Output
get() = javaResource.password().applyValue({ args0 -> args0 })
public val releaseEip: Output?
get() = javaResource.releaseEip().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
public val securityGroupId: Output
get() = javaResource.securityGroupId().applyValue({ args0 -> args0 })
@Deprecated(
message = """
Field 'size' has been deprecated from provider version 1.9.1. New field 'node_number' replaces it.
""",
)
public val size: Output?
get() = javaResource.size().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
public val slbId: Output
get() = javaResource.slbId().applyValue({ args0 -> args0 })
public val vpcId: Output
get() = javaResource.vpcId().applyValue({ args0 -> args0 })
public val vswitchId: Output
get() = javaResource.vswitchId().applyValue({ args0 -> args0 })
}
public object SwarmMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.alicloud.cs.Swarm::class == javaResource::class
override fun map(javaResource: Resource): Swarm = Swarm(
javaResource as
com.pulumi.alicloud.cs.Swarm,
)
}
/**
* @see [Swarm].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Swarm].
*/
public suspend fun swarm(name: String, block: suspend SwarmResourceBuilder.() -> Unit): Swarm {
val builder = SwarmResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Swarm].
* @param name The _unique_ name of the resulting resource.
*/
public fun swarm(name: String): Swarm {
val builder = SwarmResourceBuilder()
builder.name(name)
return builder.build()
}