this module does not seem to be idempotent. Here is the documentation:,  which seems to 
indicate that VPC's will NOT be created if a VPC already exists with 
equivalent resource_tags and cidr_block values. 

Unfortunately, as many times as I run this role, it will create a new VPC. 

Here is my usage: 
- name: create vpcs
    state: '{{ item.state }}'
    region: '{{ item.region }}'
    vpc_id: '{{ item.vpc_id }}'
    cidr_block: '{{ item.cidr_block }}'
    resource_tags: { "Name": "{{}}" }
    subnets: '{{ item.subnets }}'
    internet_gateway: '{{ item.internet_gateway }}'
      - subnets: '{{ item.route_tables.private_subnets.subnets }}'
          - dest: '{{ item.route_tables.private_subnets.routes.dest }}'
            gw: '{{ }}'
      - subnets: '{{ item.route_tables.public_subnets.subnets }}'
          - dest: '{{ item.route_tables.public_subnets.routes.dest }}'
            gw: '{{ }}'
  with_items: vpcs
  register: vpc

Thanks for any help/guidance. 

You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

Reply via email to