
com.pulumi.awsnative.ec2.kotlin.SubnetRouteTableAssociation.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.ec2.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 [SubnetRouteTableAssociation].
*/
@PulumiTagMarker
public class SubnetRouteTableAssociationResourceBuilder internal constructor() {
public var name: String? = null
public var args: SubnetRouteTableAssociationArgs = SubnetRouteTableAssociationArgs()
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 SubnetRouteTableAssociationArgsBuilder.() -> Unit) {
val builder = SubnetRouteTableAssociationArgsBuilder()
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(): SubnetRouteTableAssociation {
val builtJavaResource =
com.pulumi.awsnative.ec2.SubnetRouteTableAssociation(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return SubnetRouteTableAssociation(builtJavaResource)
}
}
/**
* Associates a subnet with a route table. The subnet and route table must be in the same VPC. This association causes traffic originating from the subnet to be routed according to the routes in the route table. A route table can be associated with multiple subnets. To create a route table, see [AWS::EC2::RouteTable](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-routetable.html).
*/
public class SubnetRouteTableAssociation internal constructor(
override val javaResource: com.pulumi.awsnative.ec2.SubnetRouteTableAssociation,
) : KotlinCustomResource(javaResource, SubnetRouteTableAssociationMapper) {
/**
* The ID of the subnet route table association.
*/
public val awsId: Output
get() = javaResource.awsId().applyValue({ args0 -> args0 })
/**
* The ID of the route table.
* The physical ID changes when the route table ID is changed.
*/
public val routeTableId: Output
get() = javaResource.routeTableId().applyValue({ args0 -> args0 })
/**
* The ID of the subnet.
*/
public val subnetId: Output
get() = javaResource.subnetId().applyValue({ args0 -> args0 })
}
public object SubnetRouteTableAssociationMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.ec2.SubnetRouteTableAssociation::class == javaResource::class
override fun map(javaResource: Resource): SubnetRouteTableAssociation =
SubnetRouteTableAssociation(
javaResource as
com.pulumi.awsnative.ec2.SubnetRouteTableAssociation,
)
}
/**
* @see [SubnetRouteTableAssociation].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [SubnetRouteTableAssociation].
*/
public suspend fun subnetRouteTableAssociation(
name: String,
block: suspend SubnetRouteTableAssociationResourceBuilder.() -> Unit,
): SubnetRouteTableAssociation {
val builder = SubnetRouteTableAssociationResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [SubnetRouteTableAssociation].
* @param name The _unique_ name of the resulting resource.
*/
public fun subnetRouteTableAssociation(name: String): SubnetRouteTableAssociation {
val builder = SubnetRouteTableAssociationResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy