replaceRoute
inline suspend fun Ec2Client.replaceRoute(crossinline block: ReplaceRouteRequest.Builder.() -> Unit): ReplaceRouteResponse
Replaces an existing route within a route table in a VPC.
You must specify either a destination CIDR block or a prefix list ID. You must also specify exactly one of the resources from the parameter list, or reset the local route to its default target.
For more information, see Route tables in the Amazon VPC User Guide.
Samples
fun main() {
//sampleStart
// This example replaces the specified route in the specified table table. The new route matches the
// specified CIDR and sends the traffic to the specified virtual private gateway.
ec2Client.replaceRoute {
routeTableId = "rtb-22574640"
destinationCidrBlock = "10.0.0.0/16"
gatewayId = "vgw-9a4cacf3"
}
//sampleEnd
}