com.pulumi.awsnative.lightsail.kotlin.LoadBalancer.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.lightsail.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.kotlin.outputs.Tag.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [LoadBalancer].
*/
@PulumiTagMarker
public class LoadBalancerResourceBuilder internal constructor() {
public var name: String? = null
public var args: LoadBalancerArgs = LoadBalancerArgs()
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 LoadBalancerArgsBuilder.() -> Unit) {
val builder = LoadBalancerArgsBuilder()
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(): LoadBalancer {
val builtJavaResource = com.pulumi.awsnative.lightsail.LoadBalancer(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return LoadBalancer(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::Lightsail::LoadBalancer
*/
public class LoadBalancer internal constructor(
override val javaResource: com.pulumi.awsnative.lightsail.LoadBalancer,
) : KotlinCustomResource(javaResource, LoadBalancerMapper) {
/**
* The names of the instances attached to the load balancer.
*/
public val attachedInstances: Output>?
get() = javaResource.attachedInstances().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* The path you provided to perform the load balancer health check. If you didn't specify a health check path, Lightsail uses the root path of your website (e.g., "/").
*/
public val healthCheckPath: Output?
get() = javaResource.healthCheckPath().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The instance port where you're creating your load balancer.
*/
public val instancePort: Output
get() = javaResource.instancePort().applyValue({ args0 -> args0 })
/**
* The IP address type for the load balancer. The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. The default value is dualstack.
*/
public val ipAddressType: Output?
get() = javaResource.ipAddressType().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Amazon Resource Name (ARN) of the load balancer.
*/
public val loadBalancerArn: Output
get() = javaResource.loadBalancerArn().applyValue({ args0 -> args0 })
/**
* The name of your load balancer.
*/
public val loadBalancerName: Output
get() = javaResource.loadBalancerName().applyValue({ args0 -> args0 })
/**
* Configuration option to enable session stickiness.
*/
public val sessionStickinessEnabled: Output?
get() = javaResource.sessionStickinessEnabled().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Configuration option to adjust session stickiness cookie duration parameter.
*/
public val sessionStickinessLbCookieDurationSeconds: Output?
get() = javaResource.sessionStickinessLbCookieDurationSeconds().applyValue({ args0 ->
args0.map({ args0 -> args0 }).orElse(null)
})
/**
* An array of key-value pairs to apply to this resource.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
}).orElse(null)
})
/**
* The name of the TLS policy to apply to the load balancer.
*/
public val tlsPolicyName: Output?
get() = javaResource.tlsPolicyName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object LoadBalancerMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.lightsail.LoadBalancer::class == javaResource::class
override fun map(javaResource: Resource): LoadBalancer = LoadBalancer(
javaResource as
com.pulumi.awsnative.lightsail.LoadBalancer,
)
}
/**
* @see [LoadBalancer].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [LoadBalancer].
*/
public suspend fun loadBalancer(
name: String,
block: suspend LoadBalancerResourceBuilder.() -> Unit,
): LoadBalancer {
val builder = LoadBalancerResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [LoadBalancer].
* @param name The _unique_ name of the resulting resource.
*/
public fun loadBalancer(name: String): LoadBalancer {
val builder = LoadBalancerResourceBuilder()
builder.name(name)
return builder.build()
}