com.pulumi.googlenative.compute.v1.kotlin.NodeGroup.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.googlenative.compute.v1.kotlin
import com.pulumi.core.Output
import com.pulumi.googlenative.compute.v1.kotlin.outputs.NodeGroupAutoscalingPolicyResponse
import com.pulumi.googlenative.compute.v1.kotlin.outputs.NodeGroupMaintenanceWindowResponse
import com.pulumi.googlenative.compute.v1.kotlin.outputs.ShareSettingsResponse
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.googlenative.compute.v1.kotlin.outputs.NodeGroupAutoscalingPolicyResponse.Companion.toKotlin as nodeGroupAutoscalingPolicyResponseToKotlin
import com.pulumi.googlenative.compute.v1.kotlin.outputs.NodeGroupMaintenanceWindowResponse.Companion.toKotlin as nodeGroupMaintenanceWindowResponseToKotlin
import com.pulumi.googlenative.compute.v1.kotlin.outputs.ShareSettingsResponse.Companion.toKotlin as shareSettingsResponseToKotlin
/**
* Builder for [NodeGroup].
*/
@PulumiTagMarker
public class NodeGroupResourceBuilder internal constructor() {
public var name: String? = null
public var args: NodeGroupArgs = NodeGroupArgs()
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 NodeGroupArgsBuilder.() -> Unit) {
val builder = NodeGroupArgsBuilder()
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(): NodeGroup {
val builtJavaResource = com.pulumi.googlenative.compute.v1.NodeGroup(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return NodeGroup(builtJavaResource)
}
}
/**
* Creates a NodeGroup resource in the specified project using the data included in the request.
*/
public class NodeGroup internal constructor(
override val javaResource: com.pulumi.googlenative.compute.v1.NodeGroup,
) : KotlinCustomResource(javaResource, NodeGroupMapper) {
/**
* Specifies how autoscaling should behave.
*/
public val autoscalingPolicy: Output
get() = javaResource.autoscalingPolicy().applyValue({ args0 ->
args0.let({ args0 ->
nodeGroupAutoscalingPolicyResponseToKotlin(args0)
})
})
/**
* Creation timestamp in RFC3339 text format.
*/
public val creationTimestamp: Output
get() = javaResource.creationTimestamp().applyValue({ args0 -> args0 })
/**
* An optional description of this resource. Provide this property when you create the resource.
*/
public val description: Output
get() = javaResource.description().applyValue({ args0 -> args0 })
public val fingerprint: Output
get() = javaResource.fingerprint().applyValue({ args0 -> args0 })
/**
* Initial count of nodes in the node group.
*/
public val initialNodeCount: Output
get() = javaResource.initialNodeCount().applyValue({ args0 -> args0 })
/**
* The type of the resource. Always compute#nodeGroup for node group.
*/
public val kind: Output
get() = javaResource.kind().applyValue({ args0 -> args0 })
/**
* An opaque location hint used to place the Node close to other resources. This field is for use by internal tools that use the public API. The location hint here on the NodeGroup overrides any location_hint present in the NodeTemplate.
*/
public val locationHint: Output
get() = javaResource.locationHint().applyValue({ args0 -> args0 })
/**
* Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. For more information, see Maintenance policies.
*/
public val maintenancePolicy: Output
get() = javaResource.maintenancePolicy().applyValue({ args0 -> args0 })
public val maintenanceWindow: Output
get() = javaResource.maintenanceWindow().applyValue({ args0 ->
args0.let({ args0 ->
nodeGroupMaintenanceWindowResponseToKotlin(args0)
})
})
/**
* The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* URL of the node template to create the node group from.
*/
public val nodeTemplate: Output
get() = javaResource.nodeTemplate().applyValue({ args0 -> args0 })
public val project: Output
get() = javaResource.project().applyValue({ args0 -> args0 })
/**
* An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
*/
public val requestId: Output?
get() = javaResource.requestId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Server-defined URL for the resource.
*/
public val selfLink: Output
get() = javaResource.selfLink().applyValue({ args0 -> args0 })
/**
* Share-settings for the node group
*/
public val shareSettings: Output
get() = javaResource.shareSettings().applyValue({ args0 ->
args0.let({ args0 ->
shareSettingsResponseToKotlin(args0)
})
})
/**
* The total number of nodes in the node group.
*/
public val size: Output
get() = javaResource.size().applyValue({ args0 -> args0 })
public val status: Output
get() = javaResource.status().applyValue({ args0 -> args0 })
public val zone: Output
get() = javaResource.zone().applyValue({ args0 -> args0 })
}
public object NodeGroupMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.googlenative.compute.v1.NodeGroup::class == javaResource::class
override fun map(javaResource: Resource): NodeGroup = NodeGroup(
javaResource as
com.pulumi.googlenative.compute.v1.NodeGroup,
)
}
/**
* @see [NodeGroup].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [NodeGroup].
*/
public suspend fun nodeGroup(name: String, block: suspend NodeGroupResourceBuilder.() -> Unit): NodeGroup {
val builder = NodeGroupResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [NodeGroup].
* @param name The _unique_ name of the resulting resource.
*/
public fun nodeGroup(name: String): NodeGroup {
val builder = NodeGroupResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy