Aws_vpc creation using chef provisioning


#1

Hi All,

Im trying to use chef provisioning with aws driver to create a vpc.
#######################################
require 'chef/provisioning/aws_driver'
with_driver 'aws::ap-south-1'
aws_vpc 'name' do
cidr_block '10.0.0.0/24'
internet_gateway true
main_routes '0.0.0.0/0' => :internet_gateway
aws_tags :chef_type => 'aws_vpc'
end
#######################################

VPC got created when checked in the console, but internet gateway did not get linked.
Getting below error.

RuntimeError
------------
aws_internet_gateway[igw-managed-by-vpc-xxxxxxxxxxxx] (no AWS object id) (basic_chef_client::block line 267) had an error: RuntimeError: Chef::Resource::AwsVpc[vpc-xxxxxxxxxxx] does not exist!

please help me in resolving this issue.

Thanks in advance,
Bhaskar S