detachInternetGateway
abstract suspend fun detachInternetGateway(input: DetachInternetGatewayRequest): DetachInternetGatewayResponse
Detaches an internet gateway from a VPC, disabling connectivity between the internet and the VPC. The VPC must not contain any running instances with Elastic IP addresses or public IPv4 addresses.
Samples
fun main() {
//sampleStart
// This example detaches the specified Internet gateway from the specified VPC.
ec2Client.detachInternetGateway {
internetGatewayId = "igw-c0a643a9"
vpcId = "vpc-a01106c2"
}
//sampleEnd
}