There is an existing subnet say subnet-11223344. In my code I want to know the VPC it belongs to.
I am referring java SDK http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/ec2/model/Subnet.html
// I am not sure if this actually refres to a subnet that I want
Subnet subnet = new Subnet().withSubnetId("subnet-11223344");
String vpcId = subnet.getVpcId();
System.out.println("VPC id"+vpcId);
This returns null.