com.pulumi.awsnative.lightsail.kotlin.StaticIp.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.lightsail.kotlin
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
/**
* Builder for [StaticIp].
*/
@PulumiTagMarker
public class StaticIpResourceBuilder internal constructor() {
public var name: String? = null
public var args: StaticIpArgs = StaticIpArgs()
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 StaticIpArgsBuilder.() -> Unit) {
val builder = StaticIpArgsBuilder()
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(): StaticIp {
val builtJavaResource = com.pulumi.awsnative.lightsail.StaticIp(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return StaticIp(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::Lightsail::StaticIp
*/
public class StaticIp internal constructor(
override val javaResource: com.pulumi.awsnative.lightsail.StaticIp,
) : KotlinCustomResource(javaResource, StaticIpMapper) {
/**
* The instance where the static IP is attached.
*/
public val attachedTo: Output?
get() = javaResource.attachedTo().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The static IP address.
*/
public val ipAddress: Output
get() = javaResource.ipAddress().applyValue({ args0 -> args0 })
/**
* A Boolean value indicating whether the static IP is attached.
*/
public val isAttached: Output
get() = javaResource.isAttached().applyValue({ args0 -> args0 })
/**
* The Amazon Resource Name (ARN) of the static IP (for example, `arn:aws:lightsail:us-east-2:123456789101:StaticIp/244ad76f-8aad-4741-809f-12345EXAMPLE` ).
*/
public val staticIpArn: Output
get() = javaResource.staticIpArn().applyValue({ args0 -> args0 })
/**
* The name of the static IP address.
*/
public val staticIpName: Output
get() = javaResource.staticIpName().applyValue({ args0 -> args0 })
}
public object StaticIpMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.lightsail.StaticIp::class == javaResource::class
override fun map(javaResource: Resource): StaticIp = StaticIp(
javaResource as
com.pulumi.awsnative.lightsail.StaticIp,
)
}
/**
* @see [StaticIp].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [StaticIp].
*/
public suspend fun staticIp(name: String, block: suspend StaticIpResourceBuilder.() -> Unit): StaticIp {
val builder = StaticIpResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [StaticIp].
* @param name The _unique_ name of the resulting resource.
*/
public fun staticIp(name: String): StaticIp {
val builder = StaticIpResourceBuilder()
builder.name(name)
return builder.build()
}