lib/cloudstrap/amazon/ec2.rb in cloudstrap-0.31.1.pre vs lib/cloudstrap/amazon/ec2.rb in cloudstrap-0.32.5.pre
- old
+ new
@@ -13,9 +13,14 @@
Contract None => ArrayOf[::Aws::EC2::Types::Vpc]
def vpcs!
@vpcs = call_api(:describe_vpcs).vpcs
end
+ Contract None => Bool
+ def vpc_exists?(vpc_id)
+ vpcs.any? { |vpc| vpc.vpc_id == vpc_id }
+ end
+
Contract String => Bool
def vpc_supports_dns?(vpc_id)
call_api(:describe_vpc_attribute, vpc_id: vpc_id, attribute: "enableDnsSupport").enable_dns_support.value
end