com.pulumi.awsnative.vpclattice.kotlin.TargetGroup.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.vpclattice.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.vpclattice.kotlin.enums.TargetGroupStatus
import com.pulumi.awsnative.vpclattice.kotlin.enums.TargetGroupType
import com.pulumi.awsnative.vpclattice.kotlin.outputs.TargetGroupConfig
import com.pulumi.awsnative.vpclattice.kotlin.outputs.TargetGroupTarget
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.vpclattice.kotlin.enums.TargetGroupStatus.Companion.toKotlin as targetGroupStatusToKotlin
import com.pulumi.awsnative.vpclattice.kotlin.enums.TargetGroupType.Companion.toKotlin as targetGroupTypeToKotlin
import com.pulumi.awsnative.vpclattice.kotlin.outputs.TargetGroupConfig.Companion.toKotlin as targetGroupConfigToKotlin
import com.pulumi.awsnative.vpclattice.kotlin.outputs.TargetGroupTarget.Companion.toKotlin as targetGroupTargetToKotlin
/**
* Builder for [TargetGroup].
*/
@PulumiTagMarker
public class TargetGroupResourceBuilder internal constructor() {
public var name: String? = null
public var args: TargetGroupArgs = TargetGroupArgs()
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 TargetGroupArgsBuilder.() -> Unit) {
val builder = TargetGroupArgsBuilder()
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(): TargetGroup {
val builtJavaResource = com.pulumi.awsnative.vpclattice.TargetGroup(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return TargetGroup(builtJavaResource)
}
}
/**
* A target group is a collection of targets, or compute resources, that run your application or service. A target group can only be used by a single service.
*/
public class TargetGroup internal constructor(
override val javaResource: com.pulumi.awsnative.vpclattice.TargetGroup,
) : KotlinCustomResource(javaResource, TargetGroupMapper) {
/**
* The Amazon Resource Name (ARN) of the target group.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The ID of the target group.
*/
public val awsId: Output
get() = javaResource.awsId().applyValue({ args0 -> args0 })
/**
* The target group configuration.
*/
public val config: Output?
get() = javaResource.config().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
targetGroupConfigToKotlin(args0)
})
}).orElse(null)
})
/**
* The date and time that the target group was created, specified in ISO-8601 format.
*/
public val createdAt: Output
get() = javaResource.createdAt().applyValue({ args0 -> args0 })
/**
* The date and time that the target group was last updated, specified in ISO-8601 format.
*/
public val lastUpdatedAt: Output
get() = javaResource.lastUpdatedAt().applyValue({ args0 -> args0 })
/**
* The name of the target group. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.
* If you don't specify a name, CloudFormation generates one. However, if you specify a name, and later want to replace the resource, you must specify a new name.
*/
public val name: Output?
get() = javaResource.name().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The operation's status. You can retry the operation if the status is `CREATE_FAILED` . However, if you retry it while the status is `CREATE_IN_PROGRESS` , there is no change in the status.
*/
public val status: Output
get() = javaResource.status().applyValue({ args0 ->
args0.let({ args0 ->
targetGroupStatusToKotlin(args0)
})
})
/**
* The tags for the target group.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
/**
* Describes a target.
*/
public val targets: Output>?
get() = javaResource.targets().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> targetGroupTargetToKotlin(args0) })
})
}).orElse(null)
})
/**
* The type of target group.
*/
public val type: Output
get() = javaResource.type().applyValue({ args0 ->
args0.let({ args0 ->
targetGroupTypeToKotlin(args0)
})
})
}
public object TargetGroupMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.vpclattice.TargetGroup::class == javaResource::class
override fun map(javaResource: Resource): TargetGroup = TargetGroup(
javaResource as
com.pulumi.awsnative.vpclattice.TargetGroup,
)
}
/**
* @see [TargetGroup].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [TargetGroup].
*/
public suspend fun targetGroup(name: String, block: suspend TargetGroupResourceBuilder.() -> Unit): TargetGroup {
val builder = TargetGroupResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [TargetGroup].
* @param name The _unique_ name of the resulting resource.
*/
public fun targetGroup(name: String): TargetGroup {
val builder = TargetGroupResourceBuilder()
builder.name(name)
return builder.build()
}