com.pulumi.awsnative.ec2.kotlin.Route.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 [Route].
*/
@PulumiTagMarker
public class RouteResourceBuilder internal constructor() {
public var name: String? = null
public var args: RouteArgs = RouteArgs()
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 RouteArgsBuilder.() -> Unit) {
val builder = RouteArgsBuilder()
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(): Route {
val builtJavaResource = com.pulumi.awsnative.ec2.Route(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Route(builtJavaResource)
}
}
/**
* Specifies a route in a route table. For more information, see [Routes](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html#route-table-routes) in the *Amazon VPC User Guide*.
* You must specify either a destination CIDR block or prefix list ID. You must also specify exactly one of the resources as the target.
* If you create a route that references a transit gateway in the same template where you create the transit gateway, you must declare a dependency on the transit gateway attachment. The route table cannot use the transit gateway until it has successfully attached to the VPC. Add a [DependsOn Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) in the ``AWS::EC2::Route`` resource to explicitly declare a dependency on the ``AWS::EC2::TransitGatewayAttachment`` resource.
*/
public class Route internal constructor(
override val javaResource: com.pulumi.awsnative.ec2.Route,
) : KotlinCustomResource(javaResource, RouteMapper) {
/**
* The ID of the carrier gateway.
* You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.
*/
public val carrierGatewayId: Output?
get() = javaResource.carrierGatewayId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The IPv4 CIDR block.
*/
public val cidrBlock: Output
get() = javaResource.cidrBlock().applyValue({ args0 -> args0 })
/**
* The Amazon Resource Name (ARN) of the core network.
*/
public val coreNetworkArn: Output?
get() = javaResource.coreNetworkArn().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify ``100.68.0.18/18``, we modify it to ``100.68.0.0/18``.
*/
public val destinationCidrBlock: Output?
get() = javaResource.destinationCidrBlock().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
*/
public val destinationIpv6CidrBlock: Output?
get() = javaResource.destinationIpv6CidrBlock().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ID of a prefix list used for the destination match.
*/
public val destinationPrefixListId: Output?
get() = javaResource.destinationPrefixListId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* [IPv6 traffic only] The ID of an egress-only internet gateway.
*/
public val egressOnlyInternetGatewayId: Output?
get() = javaResource.egressOnlyInternetGatewayId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ID of an internet gateway or virtual private gateway attached to your VPC.
*/
public val gatewayId: Output?
get() = javaResource.gatewayId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
*/
public val instanceId: Output?
get() = javaResource.instanceId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ID of the local gateway.
*/
public val localGatewayId: Output?
get() = javaResource.localGatewayId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* [IPv4 traffic only] The ID of a NAT gateway.
*/
public val natGatewayId: Output?
get() = javaResource.natGatewayId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ID of a network interface.
*/
public val networkInterfaceId: Output?
get() = javaResource.networkInterfaceId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ID of the route table for the route.
*/
public val routeTableId: Output
get() = javaResource.routeTableId().applyValue({ args0 -> args0 })
/**
* The ID of a transit gateway.
*/
public val transitGatewayId: Output?
get() = javaResource.transitGatewayId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
*/
public val vpcEndpointId: Output?
get() = javaResource.vpcEndpointId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ID of a VPC peering connection.
*/
public val vpcPeeringConnectionId: Output?
get() = javaResource.vpcPeeringConnectionId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object RouteMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.ec2.Route::class == javaResource::class
override fun map(javaResource: Resource): Route = Route(
javaResource as
com.pulumi.awsnative.ec2.Route,
)
}
/**
* @see [Route].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Route].
*/
public suspend fun route(name: String, block: suspend RouteResourceBuilder.() -> Unit): Route {
val builder = RouteResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Route].
* @param name The _unique_ name of the resulting resource.
*/
public fun route(name: String): Route {
val builder = RouteResourceBuilder()
builder.name(name)
return builder.build()
}