Ansible Code to create AWS VPC

ansible aws vpc 5 years, 11 months ago
--- - name: Create/Delete VPC ec2_vpc: wait: true state: "{{ item.state }}" cidr_block: "{{ item.cidr_block }}" resource_tags: { "Name": "{{ item.vpc_name }}", "Tag": "{{ item.tag | default('none') }}" } region: "{{ item.region }}" internet_gateway: yes subnets: - cidr: "{{ item.default_subnet }}" resource_tags: { "Name":"subnet" } route_tables: - subnets: - "{{ item.default_subnet }}" routes: - dest: 0.0.0.0/0 gw: igw with_items: "{{ vpcs }}" register: result_vpc
1091
Posted By